[gdal-dev] ogr2ogr output layer type

Frank Warmerdam warmerdam at p...
Thu Nov 14 08:57:58 EST 2002


Radim Blazek wrote:
> Hi,
> 
> I cannot convert DGN file to shapefile because DGN contains more
> feature types and ogr2ogr stops with:
> 
> ERROR 1: Attempt to write non-linestring (POLYGON) geometry to ARC type 
> shapefile.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer elements
> 
> even if I use '-nlt LINESTRING'. Would it be possible to change ogr2ogr
> so that it works only on features of type specified by '-nlt'?
> 
> I can use somethink like where="Type = 3 or Type = 4" but it does not
> seem to be optimal.

Radim,

You could use -skipfailures with ogr2ogr to ensure it will continue after
failed features. Alternatively, the where clause you suggest could also be
used. I am not keen on changing the interpretation of the -nlt flag.

It would be nice to be able to do geometry based tests in a where clause ...
stuff like test if a geometry is a line string, but that would be quite a
bit of work.

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






More information about the Gdal-dev mailing list