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

Düster Horst Horst.Duester at bd.so.ch
Mon Jan 19 02:33:11 EST 2004


Frank

Thank you very much for your respond.

Best 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 20:45
An: gdal-dev at remotesensing.org
Betreff: Re: AW: [Gdal-dev] ERROR import Shape to PostgreSQL

Düster Horst wrote:
> 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.

Dr. Düster,

It seems there are a few things going on.

The OGR Shapefile reader now has a bunch of code for recognising
multipolygons
and returning them accordingly instead of returning them as polygons where
some inner rings are actually outer rings.  However, the code that works
this
out seems to just produce multipolygons with no components when things are
self-intersecting as in your case.

The second problem is that OGRMultiPolygon::exportToWkt() incorrectly
represents this as "MULTIPOLYGON()" instead of "MULTIPOLYGON(EMPTY)".

So I plan to address both issues, first fixing OGR's WKT processor to
support the empty forms.  Second to see if I can make the shapefile reader
at least produce an error, or perhaps return all the rings as a
multipolygon with everything as an outer ring (and a warning).

In the meantime, you can likely construct a attribute query that will
filter this problem polygon out for the transfer.

eg.

ogr2ogr -f postgresql PG:dbname=hdus lieg_lieg_geom.shp -lco overwrite=yes \
  -lco launder=yes -lco precision=no -nlt MULTIPOLYGON -nln liegen \
  -where 'SYS_OBID != 17869'

Lastly, I seem to be having problems with the overwrite support in the
postgis
driver.  Something about the relation for the <name>_ogc_fid_seq not being
deleted when layers are deleted.   I'll see what I can do about that too.

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