Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to transform the xml data here : http://wiki.openstreetmap.org/wiki/Berlin/Transportation into shape files or load into postGIS.

I think the thing I am missing is how these xmls files, which contains relations, can be used to get the data they represent.

I have tried opening the JOSM link, opening the GPX files in QGIS, and directing to the xml file to osm2shp.jar - none of these routes has given me what I need. The GPX files can be used to generate a shapefile, but when I 'Open Attributes Table' in QGIS all of the column values are NULL for all points. I would appreciate a step by step description of how to work with this data in postGIS or as a shape file.

share|improve this question

closed as too localized by underdark May 6 '13 at 18:12

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I'm not sure why you want to do the GPX thing, so this might not help, but have you tried osm2pgsql - wiki.openstreetmap.org/wiki/Osm2pgsql ? –  BradHards Apr 7 '13 at 4:17
    
why this is closed? This is a legitimate and common question. I see this question asked all over the web, but it is hard to find clear answer. –  Aras Nov 30 '13 at 20:00

1 Answer 1

On the wiki page, follow the gpx link to get a gpx file. In Quantum GIS, use Add Vector layer and select route, or the GPS Tool to add the data to QGIS.

Once it works, you can Save As into a shapefile or by copy and paste into an existing postgis layer.

share|improve this answer
    
The problem I find with this, is that the GPX file doesn't contain any contextual information about the points or lines - so I end up with a bunch of points in postGIS but no information about what the points are. That is to say, when I 'Open Attributes Table' every column is NULL. Have you experienced a different outcome? –  deepwinter Apr 6 '13 at 16:18
    
By selecting "routes", you should get lines, not points. And the line number is in the name field. Station points and names are not included. That needs some preprocessing; even osm2pgsql does not do that. –  Andre Joost Apr 6 '13 at 17:46
    
Thanks, that makes a start at clearing things up. Oddly, the 'routes' gpx for this particular XML contains only 1 entry which combines all the subway lines and connects their endpoints with straight diagonal lines across the map. Is that normal for OSM data? –  deepwinter Apr 6 '13 at 22:42
    
I realized I should also follow up and say that the route_points GPX is the one the contains all NULL values for every column, and this is where I would have expected to see some kind of station information. –  deepwinter Apr 7 '13 at 2:48
    
For your purpose, tracks would be better, but the service does not offer that. If you want full access to the data, you can store a Berlin extract into a postgis database with osm2pgsql or osmosis. But it still needs some handwork afterwards. –  Andre Joost Apr 7 '13 at 5:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.