[Imports] Using Rewritten ogr2osm

RheinSkipper rheinskipper1000 at gmx.de
Wed Mar 7 11:19:58 UTC 2012


> 
> Hi!
> 
> Which tool do you actually use to convert ENC charts to OSM? How are those
> converted OSM objects then tagged?
> 
> Bernhard


Hi!

I use ogr2ogr to convert ENC to shape files. Next step will be to convert
the shape files to osm. This is done by ogr2osm. Tagging has to be
programmed as "translations" (python scripts) in ogr2osm. The seamark tags
as defined by openseamap should be used for the buoys, off course.

I don´t have ogr2osm running successfully, yet. But with the help of this
list chances are good. I will continue working on this as time permits.
Programming the translations for the tagging will be difficult for me as I
don´t know much about Python.

Here is an example how to extract an ENC object to a shape file. I will
start with the fairway (deep water area) of the Rhine as this will not
collide with any osm objects that already exist. The resulting shape file
already looks very good, when imported to Mercaator. For the buoys it will
be more difficult to avoid collisions. But I already have an idea...




set gdaldir=D:\ENC\gdal

SET
PATH=%gdaldir%\bin;%gdaldir%\bin\gdal\python\osgeo;%gdaldir%\bin\proj\apps;%
gdaldir%\bin\gdal\apps;%gdaldir%\bin\ms\apps;%gdaldir%\bin\gdal\csharp;%gdal
dir%\bin\ms\csharp;%gdaldir%\bin\curl;%PATH%
SET GDAL_DATA=%gdaldir%\bin\gdal-data
SET GDAL_DRIVER_PATH=%gdaldir%\bin\gdal\plugins
SET PYTHONPATH=%gdaldir%\bin\gdal\python\osgeo
SET PROJ_LIB=%gdaldir%\bin\proj\SHARE
rem set s57_csv=%gdaldir%\bin\gdal-data

set source=Rhein\ENC_ROOT
set geometry=POLYGON
set object=fairwy
for %%i in (%source%\*.000) do (if not exist out/%object%.shp (ogr2ogr
-skipfailure -nlt %geometry% shp %%i %object% --config S57_PROFILE iw)  else
(ogr2ogr -skipfailure -append -update -nlt %geometry% shp %%i %object%
--config S57_PROFILE iw))

pause




http://wiki.openstreetmap.org/wiki/User:RheinSkipper





More information about the Imports mailing list