[OSM-talk] Converting Shapefile to OSM

Christopher Schmidt crschmidt at metacarta.com
Wed Nov 21 13:24:37 GMT 2007


On Wed, Nov 21, 2007 at 01:07:50PM -0000, Russ Phillips wrote:
> I recently posted to the list about data that had been provided by the
> Falkland Islands government, in dxf format. I've managed to use grass to
> convert it into a shapefile, but I now need to turn it into a .osm file
> for upload.
> 
> Can anyone tell me how I can convert a shapefile into a .osm file? I
> thought I'd seen a script to do this, but I can't find one now. I tried to
> convert coast_josm.pl, but I don't understand perl, and I got nowhere.

http://boston.freemap.in/osm/files/mgis_to_osm.py

You're going to need:
1. OGR 
2. OGR Python bindings.

This code is merely an example: it won't cover everything, and it needs
a lot of tweaking for the specific data, but if you're diligent, it
could probably be taught to do what you need it to do.

(And I'm sorry I didn't get back to you; I passed it off to someone who
told me he would get to it 'right away' with manifold. You can see how
well that worked.)

Regards,
-- 
Christopher Schmidt
MetaCarta




More information about the talk mailing list