[Talk-ca] Setting up RoadMatcher and creating shapefiles

Frank Steggink steggink at steggink.org
Thu Oct 1 23:05:11 BST 2009


Hi,

A while back I created a python script to split a NRN GML file into 
smaller parts. This was done to speed up the conversion of geobase2osm. 
The updated version can be here, and it is very alpha: 
http://www.steggink.org/temp/nrn_splitter_02.py.txt

1st parameter (mandatory, no error handling): GML file to split up
2nd parameter: level
Level = 1 (default): file gets split up in 1:50000 NTS tiles (2 deg x 1 
deg, 999X99)
Level = 2: file gets split up in 1:250000 NTS tiles (8 deg x 4 deg, 999X)
This app only works below 68 deg latitude, because the tiling is 
different up north. This is not a big issue, because the few roads there 
are already in OSM (right?).

So far I haven't seen any serious issues with it, but better handle with 
care. I hope it fits your purpose.

Regards,

Frank

Emilie Laffray wrote:
> Hum,
> ok, where can I find the gml files? What size do you want your slice 
> to be?
> The solution would be to use ogr2ogr first to transform into a 
> shapefile. The next step is to transform the shapefile into an osm 
> file. Finally, you would be using Osmosis to cut using bounding box.
> No need for Postgis in this case. Postgis would be needed if you 
> wanted to have something more complicated. In this case, command line 
> tools are available. I could probably create a small python script 
> doing this in a few hours.
> Potential problem here is that shapefile contains only one layer of 
> the same type by default. Any GML files with different kind of 
> geometries like Linestring or polygone would need to be put into 
> separate shapefiles.
>
> Emilie Laffray
>
> 2009/10/1 Sam Vekemans <acrosscanadatrails at gmail.com 
> <mailto:acrosscanadatrails at gmail.com>>
>
>     Nothing, actually. :)
>
>     Just for a volunteer to take each whole province gml file and slice it
>     in a couple chunks, and make the .osm files available, (on a server
>     somewhere)
>     so then newbies like me, can run with it and just copy in the roads
>     that we need. (doing so in a tileBYtile area, claiming our working
>     area)
>     i have the rectangle areas available as .osm files and .shp files (its
>     included in the canvec-to-osm converted zip file for each area).
>
>
>     .... But we are all volunteers, so there is no rush, and its just a
>     request i keep bugging the smart PostGIS people about :)
>
>     Probably for round 2 (next year) a GUI might be helpful, but the
>     concept is the same, files on a website directory works just fine. imo
>
>     Sam
>
>     p.s, any special requests for a tile area to be converted from canvec?
>     Otherwise, i'll go with 082 area.
>
>     On 10/1/09, Emilie Laffray <emilie.laffray at gmail.com
>     <mailto:emilie.laffray at gmail.com>> wrote:
>     > 2009/9/27 Sam Vekemans <acrosscanadatrails at gmail.com
>     <mailto:acrosscanadatrails at gmail.com>>
>     >
>     >> Thanks,
>     >> Slowely but surely it's getting easier.   Awesome :)
>     >> I'm a newbie at this, but im sure there is a VisualBasic programmer
>     >> out there who can make a handy GUI with a bare-bones program.
>     If thats
>     >> technically possable? I dont know.   ... if there's a way to avoid
>     >> installing other programs. .. maybe not. :-)
>     >>
>     >
>     > Yuck Visual basic really stinks :)
>     > What is needed actually?
>     >
>     > Emilie Laffray
>     >
>
>
>     --
>     Twitter: @Acrosscanada
>     Facebook: http://www.facebook.com/sam.vekemans
>
>





More information about the Talk-ca mailing list