[OSM-talk] Archicad to OSM (again!)

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Mar 17 08:24:04 GMT 2008


Andrew Harris <andrew <at> woowoowoo.com> writes:

> 
> When I first asked this question a week back, I got some advice about  
> using GRASS to convert .dwg/.dxf files to shape files, but in the end,  
> I ran into problem after problem and nothing seemed to work. Also,  
> from my reading, shape files aren't a lot of use for importing to OSM  
> anyway (http://lists.openstreetmap.org/pipermail/talk/2008-March/023968.html 
> ).
> 
> *gives up in despair!*
> 
> I'll ask again, in the hope of finding some more detailed instructions  
> (something a complete idjut like me can understand!) or even someone  
> prepared to convert the file for me to something OSM friendly like gpx  
> or osm-xml.

Here follows one way to convert shapefile to gpx with ready made
software. However, attributes will not be converted but only 
the geometry. Thus this method is not usable for mass imports, but 
for a couple of features it might be suitable and it does not need
any programming skills.

GPS TrackMaker software (www.gpstm.com) can open shapefiles and 
store them as gpx. Another possibility is to use ogr2ogr 
from gdal.org) and convert shapefile to gpx with a command
like this:
>ogr2ogr -f gpx -s_srs epsg:xxxx -t_srs epsg:4326
outpout.gpx input.shp

Here -s_srs means the projection your original data are in, and 
-t_srs the output projection, that must always be epsg:4326. 
However, I believe you have polygons on your map and ogr2ogr 
cannot convert them to gpx. Trackmaker solves this by making 
polygons to tracks.  First point will be dublicated and same
coordinates are used as end point. I will come back to this later.

The generated gpx files can be opened (not necessarily those 
generated with ogr2ogr) by JOSM and converted to data layer. 
Notice that if you had polygon in original shapefile then they 
are not converted to polygons in JOSM automatically. Each 
linestring will have one dublicate node. The starting point 
of the polygon must be searched and both nodes must be selected
and combined before they make a proper OSM closed way.

-Jukka Rahkonen-







More information about the talk mailing list