Discussion:
Problem with ogr2ogr
Elstermann, Mike
2004-10-14 12:55:41 UTC
Permalink
Hi MapServers,


I have a problem with OGR2OGR.
I try to convert DGN-Files in ESRI-Shape-Files with this usage:

/usr/local/bin/ogr2ogr -skipfailures -f "ESRI Shapefile" -nlt POLYGON
/susepool2/xxxpolygon /test.dgn

Many polygons were converted, but app. 50% were not converted. I've got only
Error-Messages for POINT and LINESTRING, but not for POLYGON.

a sniplett
ERROR 1: Attempt to write non-polygon (POINT) geometry to type shapefile.
ERROR 1: Attempt to write non-polygon (LINESTRING) geometry to type
shapefile.
ERROR 1: Attempt to write non-polygon (LINESTRING) geometry to type
shapefile.
ERROR 1: Attempt to write non-polygon (POINT) geometry to type shapefile.
ERROR 1: Attempt to write non-polygon (LINESTRING) geometry to type
shapefile.
ERROR 1: Attempt to write non-polygon (LINESTRING) geometry to type
shapefile.

ArcView/CAD-Reader shows all polygon!
In the DBF i can see the Item ENTITY with the values "Cell", "Circle", "Line
String" und "Shape". My convert lost all polygons with the entity "LINE
STRING". But the coversion with the option "-nlt LINESTRING" brings only
Line-Shapes.

Is there anywhere a tip?

Für Rückfragen stehe ich Ihnen gern zur Verfügung.

::: mfg. Mike Elstermann [mikeE.], Teamleiter GIS/e-Solutions
::: IT-Consult Halle GmbH, Bornknechtstraße 5, 06108 Halle (Saale)
::: Tel.: +49 345 581 7128, Fax: +49 345 581 1737, mobil: +49 160 71 545 02
::: ***@itc-halle.de ::: http://www.itc-halle.de
::: GeoDaten Online? -> http://halgis.halle.de; http://umweltatlas.halle.de
Frank Warmerdam
2004-10-14 14:48:06 UTC
Permalink
Post by Elstermann, Mike
Hi MapServers,
I have a problem with OGR2OGR.
/usr/local/bin/ogr2ogr -skipfailures -f "ESRI Shapefile" -nlt POLYGON
/susepool2/xxxpolygon /test.dgn
Many polygons were converted, but app. 50% were not converted. I've got only
Error-Messages for POINT and LINESTRING, but not for POLYGON.
Mike,

DGN files can contain a variety of geometry types in one layer. Shapefiles
can only have one geometry type in a file. You will need to do a translation
for each type of geometry you want to capture. Something like:

/usr/local/bin/ogr2ogr -skipfailures -f "ESRI Shapefile" -nlt POLYGON \
/susepool2/xxxpolygon.shp /test.dgn
/usr/local/bin/ogr2ogr -skipfailures -f "ESRI Shapefile" -nlt LINESTRING \
/susepool2/xxxline.shp /test.dgn
/usr/local/bin/ogr2ogr -skipfailures -f "ESRI Shapefile" -nlt POINT \
/susepool2/xxxpoint.shp /test.dgn

PS. this is really an OGR question and would be better addressed to the
gdal-dev mailing list.

Good luck,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Loading...