[Imports] polyshp2osm.py

andrzej zaborowski balrogg at gmail.com
Wed Oct 21 01:52:02 BST 2009


2009/10/21 Sam Vekemans <acrosscanadatrails at gmail.com>:
> to: imports@ list
>     There ought to be a way that shp files can be 1st 'sliced'..
> Ie.  (Geographically cut into an arbitrary grid (regardless of the shape of
> the polygon) 4, 16, 256 or whatever size)  so then each square can be dealt
> with independently.
> .... ya i know it can be done with ArchGIS, but were looking for a command
> line alternative :)... Also, slicing AFTER processing will  help too.    Is
> that something that osmosis can do?

Kind of, it can extract a part of a .osm file inside a rectangle using
the --bb switch, so by running osmosis for each grid cell you can
slice a big rectangle into smaller rectangles.  However when a way or
relation crosses the grid cell boundary, osmsis will either include
all such ways or none of them, depending on the options you give it.
As a result you will either have missing ways or have duplicates
across your slices.

If we only had ways and nodes, it would be possible to split ways by
inserting a new node at the boundary and clipping to it, but with
relations I'm not sure how that could be done sensibly.

Cheers




More information about the Imports mailing list