On Apr 20, 2009, at 10:39 AM, Joe Richards wrote:
I too have an .osm file floating around for upload from 0.5,
whereabouts can I get a copy of your Python script from to test it
against it (and 0.6)?
Turns every 0.5 into a 0.6-compatible file. BUT NOTE that it presumes
that nobody else has edited ANYTHING in the file, so you are very well
advised to upload your 0.5 files ASAP, otherwise you'll get conflicts
that you need to resolve.
#!/usr/bin/python
import sys
def fivetosix(fn):
inf = open(fn)
outf = open(fn.replace('.osm', '-6.osm'), "w")
for line in inf:
line = line.replace("<osm version='0.5' ","<osm version='0.6' ")
line = line.replace("<node ", "<node version='1' ")
line = line.replace("<way ", "<way version='1' ")
line = line.replace("<relation ", "<relation version='1' ")
outf.write(line)
for fn in sys.argv[1:]:
fivetosix(fn)
--
Russ Nelson - http://community.cloudmade.com/blog -
http://wiki.openstreetmap.org/wiki/User:RussNelson
[email protected] - Twitter: Russ_OSM -
http://openstreetmap.org/user/RussNelson
_______________________________________________
talk mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk