diff --git a/prettymaps/draw.py b/prettymaps/draw.py index e5fcb6c..93fba1d 100644 --- a/prettymaps/draw.py +++ b/prettymaps/draw.py @@ -527,6 +527,7 @@ def create_background( Returns: Tuple[BaseGeometry, float, float, float, float, float, float]: background geometry, bounds, width and height """ + # Create background background_pad = 1.1 if "background" in style and "pad" in style["background"]: @@ -539,6 +540,9 @@ def create_background( background_pad, ) + if "background" in style and "dilate" in style["background"]: + background = background.buffer(style['background'].pop("dilate")) + # Get bounds xmin, ymin, xmax, ymax = background.bounds dx, dy = xmax - xmin, ymax - ymin @@ -958,7 +962,7 @@ def plot( zorder = style["background"].pop( "zorder") if "zorder" in style["background"] else -1 ax.add_patch(PolygonPatch( - background, **style["background"], zorder=zorder)) + background, **{k:v for k,v in style["background"].items() if k != 'dilate'}, zorder=zorder)) # 10. Draw credit message if (mode == "matplotlib") and (credit != False) and (not multiplot): diff --git a/requirements.txt b/requirements.txt index c213335..7e81ad5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ osmnx==1.1.2 tabulate==0.8.9 Shapely>=1.8,<2.0 descartes==1.1.0 +ipykernel==5.3.4 pyyaml==6.0.0 diff --git a/setup.py b/setup.py index a281ba0..688f8cd 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ presets_dir = os.path.abspath(os.path.join(os.path.pardir, 'presets')) setup( name="prettymaps", - version="v0.1.3", + version="v0.1.4", description="A simple python library to draw pretty maps from OpenStreetMap data", long_description=parent_dir.joinpath("README.md").read_text(), long_description_content_type="text/markdown",