Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to customize layer visibility #60

Open
makew0rld opened this issue Nov 7, 2024 · 0 comments
Open

Make it easier to customize layer visibility #60

makew0rld opened this issue Nov 7, 2024 · 0 comments

Comments

@makew0rld
Copy link

Currently this is the way I'm changing which layers are visible:

import prettymapp.settings

prettymapp.settings.LC_SETTINGS = {
    "water": {
        "natural": ["water", "bay"],
        "place": ["sea"],
    },
    "woodland": {"landuse": ["forest"]},
    "grassland": {
        "natural": ["island", "wood"],
    },
    "streets": {
        "highway": [
            "motorway",
            "trunk",
            "primary",
            "secondary",
        ],
        "railway": True,
    }
}

from prettymapp.geo import get_aoi
from prettymapp.osm import get_osm_geometries
from prettymapp.plotting import Plot

aoi = get_aoi(address="Toronto, Ontario, Canada", radius=1000, rectangular=True)
df = get_osm_geometries(aoi=aoi)

fig = Plot(
    df=df,
    aoi_bounds=aoi.bounds,
    draw_settings=prettymapp.settings.STYLES["Peach"]
).plot_all()

fig.savefig("map.jpg")

This is clunky and not easy to figure out. It would be nice if in the same way I set a custom style with draw_settings I could also set a custom layer list as an argument to get_aoi or something. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant