[Gdal-dev] ERROR import Shape to PostgreSQL

Frank Warmerdam warmerdam at pobox.com
Fri Jan 16 09:29:59 EST 2004


Düster Horst wrote:
> Hallo
>  
> Today I made an upgrade of gdal/ogr from 1.1.7.2 to cvs-040114. GDAL-1.1.7.2
> works very stable but I need to convert POLYGON to MULTIPOLYGON. Hence I
> made the upgrade. But now I'm not able to convert ESRI Shape to PostgreSQL
> in all cases. So some shapes which could be imported by the former Version
> of GDAL without problems  breakes down the import process with the following
> error message:
>  
> ERROR 1: INSERT command for new feature failed.
> ERROR:  couldnt parse objects in GEOMETRY
> 
> ERROR 1: Terminating translation prematurely after failed
> translation of layer lieg_lieg_geom
>  
>  
> I start ogr2ogr with the following command string:
>  
> ogr2ogr -f postgresql PG:dbname=hdus lieg_lieg_geom.shp -lco overwrite=yes
> -lco launder=yes -lco precision=no -nlt MULTIPOLYGON -nln liegen
>  
> To reproduce this error I can send the mentioned shape.
>  
> It would be great to solve this probem.

Dr. Düster,

Sorry for not getting back to you on your earlier message ... this issue looks
hard enough that I put it off a bit.  My first thought was that you were
getting multipolygons written to a polygon layer in postgis, but I see that
you selected the type multipolygon.  Ogr2ogr should try and force polygons
to multipolygons as well since you have selected multipolygon output.

I am not sure what is going wrong, so I think I will need the dataset.
I would also like to know what version of postgis you are running in
case that might be a factor.

You might also want to try setting CPL_DEBUG to ON before running ogr2ogr.
I believe this will report all the SQL statements used while loading
PostGIS.  Seeing the last statement might be helpful.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
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