[OSM-dev] Two scripts to make excerpts of planet.osm
Ralf at Zimmermann.com
Fri Nov 3 21:45:45 GMT 2006
I tried your scripts. I changed the following line in planetosm-excerpt-tags.pl:
214: my ($id,$lat,$long) = ($main_line =~ /^\s*<node id=['"](\d+)['"].*?lat=['"]?(\-?[\d\.]+)['"]? lon=['"]?(\-?[\d\.]+e?\-?\d*)['"]?/);
(Changed " " to ".*?")
I needed this because the planet.osm files differ to the ones written by JOSM.
When writing a node element, they behave differently:
planet.osm: <node id="" lat="" lon="" timestamp=""/>
josm.osm: <node id='' timestamp='' lat='' lon='' />
Obviously, JOSM writes the timestamp to a different place in the node definition. The script needs to be able to cope with that.
OSM files written by JOSM did not work with your script, therefore I made the patch.
The same change is needed in planetosm-excerpt-area.pl:
109: my ($id,$lat,$long) = ($line =~ /^\s*<node id=['"](\d+)['"].*?lat=['"]?(\-?[\d\.]+)['"]? lon=['"]?(\-?[\d\.]+e?\-?\d*)['"]?/);
With those changes, your scripts work just fine for me. Thanks a lot!
Nick Burch wrote:
> On Thu, 2 Nov 2006, Joerg Ostertag (OSM Munich/Germany) wrote:
>> what about
> I hadn't come across that one before. We should really have a central list
> of these scripts, what they do etc, so we can try to avoid duplicating
> dev mailing list
> dev at openstreetmap.org
More information about the dev