[postgis-users] Inner rings

strk at refractions.net strk at refractions.net
Sun Jan 30 01:54:44 PST 2005

On Sat, Jan 29, 2005 at 02:28:14AM +0900, Hartmut Tschauner wrote:
> Dear listers,
> In testing a PostGIS command line and query builder for free-form PostGIS
> queries in ArcGIS 9 (a hopefully improved successor to PGArc, soon to be
> released), I ran into some problems with holes and islands when importing
> shapefiles into PostGIS (not through my own extension!). Considerable
> numbers of holes disappear in the import process, islands hardly ever make
> it. I imported the shapes both using the loader and via WKB. My server
> version is "POSTGIS="1.0.0" GEOS="2.1.0" PROJ="Rel. 4.4.9, 29 Oct 2004"
> USE_STATS DBPROC="0.1.0" RELPROC="0.1.0" in PostgreSQL 8.0 beta5 on Windows.
> I have not installed RC1 or RC2 yet.

POSTGIS="1.0.0" is not out yet. RC1 and RC2 are the two "candidates"
precursing 1.0.0. If you think the problem is with the loader, you should
report RCSID of it:

$ shp2pgsql
RCSID: $Id: shp2pgsql.c,v 1.78 2005/01/17 09:21:13 strk Exp $
USAGE: shp2pgsql [<options>] <shapefile> [<schema>.]<table>

> Is this a known issue/behavior? Has anyone else run into it? Does it occur
> in RC1/RC2? In case someone wants to try to reproduce the problem, I attach
> a Zip archive with two test shapefiles. They contain bogus shapes created
> for testing my ArcGIS extension. None of the islands ever make it into
> PostGIS. Nor does the triangular hole in the left square. These are only two
> tiny samples; I ran into many similar problems with my "real" data.
> Any comments and particularly an explanation would be appreciated.

No geometries should "disappear". The only possible bug should be
shp2pgsql not realizing which is an hole and which is a shell.
Finding what is what is done using a Point-In-Polygon check, using
a random point from each ring. This would fail if input rings
intersect (which makes input 'invalid').


> Greetings from Seoul,
> Hartmut
> Hartmut Tschauner
> Dept. of Archaeology and Art History
> Seoul National University
> Seoul Kwan-ak Gu, Sillimdong 56-1
> 151-742
> Korea
> ph. +82 (2) 880-9260

> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

More information about the postgis-users mailing list