New version of osm2poly.pl to extract from the cloudmade admin borders
Posted by h4ck3rm1k3 on 22 December 2009 in English.Here, now we have the start of a tool to extract the admin borders into polys from the cloudmade admin files. You can tweak it yourself to emit any way into a polygon.
https://code.launchpad.net/~jamesmikedupont/+junk/EPANatReg
The Osm2Poly now can work with the NJ county borders from cloudmade.
First you extract them, all the parts into an out dir
and then use the merger to create a file with all the subpolys.
#first we process the admin border, all nodes that are not know will be reported and you can
perl osm2poly.pl ../new_jersey_admin.osm
# then we run the get routine to pull all the missing nodes
bash get.sh
# then we merge all the osm files into one nice one
cat fetch_*.osm ../new_jersey_admin.osm | perl osmsimplemerge.pl > new.osm
# then we convert them to poly files, only things that are named will get processed, any tages not know will be emitted as regexs for you to past into the script: eg "elsif ($1 eq 'is_in:state_code'){}"
if you want to emit the node, then fill out the "$poly_file=$2; $poly_id=$2;"
perl osm2poly.pl new.osm
# the new version of the merger tool takes a name, not only for zipcodes
perl polymerger.pl NJADMIN
# then we create osm and bb files from all the polys
for x in merge/*.poly; do echo $x; perl poly2osm.pl $x> $x.osm; done
for x in merge/*.poly; do echo $x; perl poly2bb.pl $x> $x.bb; done
I am uploading the results now, they will be published here:
http://www.archive.org/details/NJ_Counties
Some of the counties are not complete, they do not contain all the parts, like
osm.org/browse/way/32209341 Rockland County...
Discussion
Comment from h4ck3rm1k3 on 22 December 2009 at 20:06
The upload is finished :
http://www.archive.org/details/NJ_Counties