AW: [Gdal-dev] ERROR import Shape to PostgreSQL

Düster Horst Horst.Duester at bd.so.ch
Fri Jan 16 11:12:28 EST 2004


Frank

I got an idea and take a look at the shapes I sent to you with the JUMP QA
Basic Topology Analysis. The polygon where the mentioned ogr2ogr process
breaks is a self intersecting polygon. I seems that ogr2ogr 1.1.7.2 works
fine with this self intersecting features and the latest ogr2ogr not.

Regards
 
Dr. Horst Düster 
GIS-Koordinator
 
Amt für Geoinformation
Abteilung SO!GIS Koordination
Werkhofstr. 65
4509 Solothurn 

Tel.: 032 627 25 32 
Fax: 032 627 22 14

horst.duester at bd.so.ch <mailto:horst.duester at bd.so.ch> 
www.sogis.so.ch <http://www.sogis.so.ch/> 



-----Ursprüngliche Nachricht-----
Von: Frank Warmerdam [mailto:warmerdam at pobox.com]
Gesendet am: Freitag, 16. Januar 2004 15:30
An: gdal-dev at remotesensing.org
Betreff: Re: [Gdal-dev] ERROR import Shape to PostgreSQL

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


_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev



More information about the Gdal-dev mailing list