Fetching the structure of regions, sub-regions, cities, streets and postal codes by hierarchy

I have a seemingly simple but, for me as a newcomer to the OpenStreetMap topic, difficult task to complete. I would like to display a complete list of regions and sub-regions of a selected State. At the lowest level is the city and then the streets belonging to the selected city and the postal codes corresponding to the streets.

I am aware of performing the following queries:

  1. display all regions at level 0 from a given State (in the case of the US, I should get 51 states).
  2. select one of the displayed States and display the sub-regions belonging to the selected State… etc. until I get to the cities.
    3 I display all the streets and then retrieve all the zip codes assigned to the selected street

I currently have imported Europe data from Geofabrik into my PostreSQL database using Osm2pgsql

Thank you in advance for your help.

2 posts - 2 participants

Read full topic


Ce sujet de discussion accompagne la publication sur https://community.openstreetmap.org/t/fetching-the-structure-of-regions-sub-regions-cities-streets-and-postal-codes-by-hierarchy/99208