I extracted both nodes and ways from OpenStreetMap in PostgreSQL with Osmosis. I'm looking for all restaurants in a given area. The issue is that some of them are coded in OSM as nodes and others as ways. How is it possible to have only one point when it is represented both as a node and a way? The intuitive answer is to intersect the ways with the nodes. If a node is inside a way, they will both count as one. Otherwise, if there is only a node or only a way without nodes inside, it's fine. The 'geometry' column in the 'ways' table does not contain information (it has something like a geometry, but all values are similar). Or maybe it is possible to use the 'nodes' table? The fundamental question is: How is it possible to have a proper geometry column in PostgreSQL with Osmosis? |
Alternatively, use osm2pgsql which builds geometries. answered 14 Apr '14, 20:00 Frederik Ramm ♦ How do you do tag-filtering with osm2pgsql? I guess via a style file. If I'm not interested in some key, I just delete them from the style file?
(15 Apr '14, 10:02)
antonind
1
Yes it would work; the only thing you can't do in the style file is saying "I want highway=A but not highway=B". You can only say that you want, or don't want, highway.
(16 Apr '14, 21:37)
Frederik Ramm ♦
1
It worked perfectly by just removing some lines in the style file and using 'osm2pgsql -S default.style --host=something.com --username myUsername --password --database myDB switzerland-latest.osm.pbf
(17 Apr '14, 13:33)
antonind
|
The general understand is already ok. For the postprocessing you might want to derive a own table/db as it's a custom procedure that depends on your own needs:
I guess you can do the processing just using PGSQL, but I would recommend e.g. a python script that:
Sorry, I can't provide code, but maybe this will be helpful if you decide to do it the Python way: http://conference.scipy.org/scipy2013/tutorial_detail.php?id=110 answered 14 Apr '14, 18:29 iii |