[mapserver-users] Re: help w/ ogr/tiles

Daniel Morissette morissette at dmsolutions.ca
Tue Jul 17 12:19:23 EDT 2001


Drew wrote:
> 
> awesome, thanks for the help, one last thing (hopefully)
> 
> ./ogr2ogr -f "ESRI Shapefile" output
> ../../../public_html/dev/itasca/data2/782221.dgn
> ERROR 1: Attempt to write non-linestring (POINT) geometry to ARC type
> shapefile.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer elements
> 
> [root at melbwireless ogr]# ls output/
> elements.dbf  elements.shp  elements.shx
> 
> still creates them, do i need to worry about the errors?
> 

Drew,

I think the translation aborted after the incompatible geometry type was
encountered, so the file was created but was incomplete.  This is
because shapefiles can contain only one geometry type at a time, and
ogr2ogr defaults to use the geometry type of the first shape it
encounters.

I'm really not an expert with OGR2OGR, but I think what you need to do
is force the type of the output file, and use the -skipfailures option 
to prevent the execution from aborting when incompatible geometries are
encountered:

 ./ogr2ogr -skipfailures -f "ESRI Shapefile" output_point 782221.dgn \
    -lco SHPT=POINT
 ./ogr2ogr -skipfailures -f "ESRI Shapefile" output_line 782221.dgn \
    -lco SHPT=ARC
 ./ogr2ogr -skipfailures -f "ESRI Shapefile" output_poly 782221.dgn \
    -lco SHPT=POLYGON

The -lco switch is to pass layer creation options which are
format-specific... in the case of shapefiles, the SHPT layer creation
option specifies the type of shapefile to create.  See also:
  http://gdal.velocet.ca/projects/opengis/ogrhtml/drv_shapefile.html

-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list