Hello guys,
first of all I’d like to say hello and thank you for all the good work on the OSM project.
I am currently developing a web platform as a university project where users can keep track of their personal “summit register”. So users can tag peaks or alpine huts they have been to so far and add pictures and stuff. The problem I am working on right now is to extract only the relevant data of peaks and huts from an OSM region (Austria in my case) and use it as a core for my database.
Best case scenario would be a minimalistic table (“peaks”) with records similar to this:
+-----------------------------+--------------+----------+----------+------+
| id (unique and primary key) | name | lat | long | ele |
+-----------------------------+--------------+----------+----------+------+
| ... | | | | |
| 123456789 | Grosglockner | xx.yyyyy | xx.yyyyy | 3798 |
| ... | | | | |
| 987654321 | Matterhorn | xx.yyyyy | xx.yyyyy | 4478 |
| ... | | | | |
+-----------------------------+--------------+----------+----------+------+
What I have tried so far is to extract all nodes/ways which contain the tags natural=peak and tourism=alpine_hut of the latest austria.osm via osmfilter and import it into my databse with osm2postgresql and a very reduced style file.
However I am getting a rather complex table scheme (for my use case) with points/polygons/lines etc. in separate tables which means peaks and hut data is scattered over various tables. This makes sense for map rendering and routing but not if I only want a searchable register.
So I tried to extract everything as simple POIs with the OsmPoisPbf project on Github which gives me a csv similar to this (areas are being centered according to the readme on github):
tag type|osm id (N..node, W.. way)|lat|long|name
65|N26862485|47.07279|14.80774|Ameringkogel
65|N26862562|47.47504|12.73383|Birnhorn
...
which is exactly what I was looking for (except that elevation is missing). But I am still looking for a way to keep things updateable and still keep the integrity of the connection between a peak and a user.
An example to make things clearer (I hope):
- User1 tags the peak “Mt. Everest” with the osm id 12345 for his register.
- I perform a diff with a new OSM version where “Mt. Everest” has been deleted and newly created with a new osm id 54321
- Now I either get a duplicate “Mt. Everest” entry in my db or lose the integrity between User1 <-> “Mt. Everest” since the id has changed
I hope my problem is somewhat understandable and someone can help me.
Thanks!