[Python] How to plot ANY kind of OSM water body (preferably with OSMnx)?

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to make a Python script to plot different "layers" of a map, such as water, grass, rocks, etc. At the moment I am exploring the way of OSM through the package OSMnx, bringing the different geopandas.GeoDataFrame (gdf) through these kind of calls:

    nature['rock'] = ox.features_from_point((latitude, longitude), dist=dist, tags={'natural': ['bare_rock', 'rock', 'scree']})


    However, I cannot get to the point of bringing all the diferent water bodies to a single graph in a way that works with any point in the globe (including islands, or coasts). I have tried it with the tags={'natural': ['water', 'bay']} and the tags={'natural': 'coastline'}, combined or by separate (and joined later). But it doesn't work.

    I also checked that the prettymaps package doesn't seem to work fine on this cases (coasts or islands).

    I expect something like this for the coast.

    [​IMG] But I get this: [​IMG]

    Continue reading...

Compartilhe esta Página