[postgis-users] shp2pgsql inner/outer ring detection bug

strk strk at freek.keybit.net
Fri Dec 20 09:51:55 PST 2002


chodgson wrote:
> I think this code has been updated since 0.7.3. You should really try the CVS 
> version. Let us know if it that solves the problem or not.

These are the changes between 0.7.3 and current CVS:

	106c106
	<       char    *start, *end1, *end2 = NULL;
	---
	>       char    *start, *end1, *end2;

By the way.. I made some other tests importing from shapes to
postgis and then exporting back with shp2pgsql and pgsql2shp.
Each time a different polygons layout is generated in the database...
The shapefiles keep their original size but I can imagine the
oriantation of polygons are different between runs.

I think the ring_check function has to be controlled, it's
not easy to tell since the shp2pgsql code is pretty messy.

--strk;

> 
> Chris
> 
> Quoting strk <strk at freek.keybit.net>:
> 
> > Hi jeff,
> > 
> > I'm using shp2pgsql from postgis version 0.7.3.
> > The inner/outer ring detection code fails for this shape:
> > 
> > 	ftp://ftp.refractions.net/pub/refractions/dirty.tgz
> > 
> > In particular the resulting record with gid=2 will be a MULTIPOLYGON
> > with 26 polygons inside. The last one (geometryN 25) have just one ring
> > with vertex defined in counterclockwise order.
> > 
> > It is supposed to be a hole ( the shapefile is not dirty )
> > but shp2pgsql created a new polygon for it instead of defining
> > it as an inner ring.
> > 
> > Apart from this peculiar shapefile i think this is a general issue.
> > If I'm not wrong shp2pgsql should *never* create a polygon with
> > first/outer ring defined in counterclockwise order or a inner/hole
> > ring defined in clockwise order ...
> > 
> > Can you please check this out ?
> > 
> > --strk;
> > 
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > 
> 
> 
> 
> 
> 
> _______________________________________________
> 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