[Talk-us] Shape to OSM conversion

Victor Snesarev victor.snesarev at gmail.com
Fri Jul 25 15:41:17 BST 2008


Ian,

I haven't used JOSM much at all. Thanks for pointing out the fact that it
can further massage data. I will look into it.

One issue I forgot to mention is the coordinate transformation from State
Plane projected coordinate system that's used by some (all?) local data to
OSM's WGS84. Seems like GDAL needs pretty explicit help on with setting the
right osr.SpatialReference(). I had no luck getting GDAL to evem recognize
the WKT from the .PRJ file that came as part of the Shapefile data set. Do
you know of an elegant way to handle this? Maybe pass an EPSG number as a
command line argument?

Shapefile points should be easy to convert to OSM POI, no?  No comment on
multipolygons; I have very little experience with OSM and GIS in general.

BTW, if you need help testing the script, I can run it on my county's data.
I know enough Python to be dangerous. I thought I'd start with Point data
like libraries, police stationes, etc. and work my way up to street
centerline data.

Victor


On Fri, Jul 25, 2008 at 9:55 AM, Ian Dees <ian.dees at gmail.com> wrote:

> On Fri, Jul 25, 2008 at 6:10 AM, Victor Snesarev <
> victor.snesarev at gmail.com> wrote:
>
>>
>> First of all, it seems that a generic Shapefile-to-OSM script is
>> impossible to write without writing a conversion application around it.
>>
>
> My thought on this is that there are two use cases:
>
> 1. Convert a relatively small (a county or city's worth of road
> centerlines, for example) shapefile to OSM, open it in JOSM, and use the
> find/tag features of JOSM to apply OSM tags and upload to OSM servers.
>
> 2. Mass import of huge sets of shapefiles (all of the TIGER data, for
> example). In this case, a set of rules mapping shapefile data fields to OSM
> key/value pairs could be pre-set via a rules file or in code.
>
> So far, I think (1) would work just fine in most cases.
>
>
>> Street centerline data is stored as a PolyLine shape type in the
>> Shapefile, while police station locations are Points, and parks are
>> Polygons. Is that right?
>>
>
> This is true. There are dozens of different geometry types in a shapefile.
> So far, the shp_to_osm.py script knows about lines and polygons. Points and
> multipolygons are next and would cover the geometry types I've seen in most
> shapefiles.
>
>
>> One more point... Can anyone comment on advantages/dissadvantages of
>> adding an OSM export plugin for something like MapWindow<http://www.mapwindow.org/>,
>> QGIS <http://www.qgis.org/>, Mapnik <http://mapnik.org/>or some other GIS
>> application?
>>
>
> I was thinking about writing a plugin for the ogr2ogr app, which would then
> allow is to do all sorts of exports/imports on OSM data. Shapefile <-> OSM,
> OSM <-> PostGIS, etc.
>
> -Ian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-us/attachments/20080725/5c30808f/attachment.html>


More information about the Talk-us mailing list