[OSM-dev] New planetosm-to-db.pl with bounding box support
Nick Whitelegg
nick at hogweed.org
Fri Aug 25 20:16:49 BST 2006
I've just added an altered and rather quick-and-dirty version of
planetosm-to-db.pl which allows the user to specify a bounding box to
retrieve.
It appears to "do the job" and took about two hours or so to do all the UK
between 50N and 58N and west of 1W. However the code needs tidying up/making
more robust; I've committed it to subversion in case someone else gets round
to this before I do. Note also that SQL/XML errors are just ignored for the
moment (this has some advantages e.g. the script doesn't stop if duplicate
ways are added, which might be the case if you run the script several times
as a batch job with different bounding boxes)
Example command for the 7W,49N,2E,59N bounding box:
./planetosm-to-db-bbox.pl -bbox -7,49,2,59 planet.osm
There is one real bug. When dealing with ways, the second segment in the way
is not added. An SQL error relating to duplicate segments is raised when the
second segment is added. Looking at the code I can't see an obvious reason
for this but will try and debug.
Nick
More information about the dev
mailing list