D
D
den2346242346422019-08-27 17:08:20
PostgreSQL
den234624234642, 2019-08-27 17:08:20

What is the best way to organize an export schema from OSM OpenStreetMap to PostgreSQL?

Good afternoon!
Tell me with advice - how to organize a schematic diagram of actions ... and in general, I'm acting correctly, or it can be somehow simpler.
This question is a continuation of the first question How to determine the occurrence of coordinates in an OpenStreetMap OSM polygon of interest?
The task is to get a table at the output (as I now understand PostgreSQL) with data from .osm and information about the occurrence of geodata of settlements in my polygons.
1 Downloaded central-fed-district-latest.osm.pbf from here https://download.geofabrik.de/russia/central-fed-d... - converted to .o5m - exported to .csv - made a selection of suitable and not very populated areas.
1.1 Because in central-fed-district-latest.osm.pbf did not find polygons of settlements - there are only coordinates of a point, and then not everywhere. Therefore, it is not possible to directly export from here. Not enough data.
2 I ran the settlements of interest through api https://nominatim.openstreetmap.org/search?format=...
3 I received my settlements with coordinates and polygons + additional data.
4 Now I need to convert the data I need to the PostgreSQL database
5 Install the PostGIS extension or similar
6 And in the end, I hope I will get a database that will contain all the necessary information to organize the project from the first question. City output with information about whether it is included in the delivery zone or not.
Those. in PostgreSQL, I can get information about the occurrence of one polygon in another - this is the main point
Tell / direct / correct - am I acting logically correctly or are there other options?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2019-08-28
@freeExec

  1. Before convert to o5m , that's right
  2. Use osmfilter to filter only objects with place=* tags , if you wish, you can specify specific place types
  3. osm2pgsql import filtered data into database
  4. If you really need only a specific list of IRs, then recreate in a new table filtered only by these IRs
  5. Add your delivery polygons to another new table
  6. Profit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question