[postgis-users] GEOS Problems

Martin Davis mbdavis at VividSolutions.com
Tue Apr 11 12:46:53 PDT 2006

The WKT for these geometries is:
POLYGON ((5416315.620858896 5657891.5790832825, 5416313.375312048 5657896.390969821, 5416306.81 5657888.38, 5416305.59 5657887.05, 5416307.29 5657885.63, 5416308.48 5657887.01, 5416310.51 5657885.35, 5416315.620858896 5657891.5790832825))
POLYGON ((5416313.375312049 5657896.39096982, 5416315.620858896 5657891.5790832825, 5416317.64 5657894.04, 5416313.94 5657897.08, 5416313.375312049 5657896.39096982))
A couple of observations:
- These are two geometries which touch at a single point  POINT (5416315.620858896 5657891.5790832825)   Given this, the expect result from Union IS a MultiPolygon.  They may appear on-screen to touch along a line, but the points POINT (5416313.375312048 5657896.390969821) and POINT (5416313.375312049 5657896.39096982) are very slightly different.
- The precision of these geometries is very high (10 decimal places).  My guess is this is much higher than your data accuracy.  You will have fewer problems with GEOS if you use lower precision data.  This means using SnapToGrid *all the way through* your computations.
If you have problems using snapped geometries, you should try posting an example of that.
Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046

	-----Original Message-----
	From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Rene Neidt
	Sent: April 11, 2006 11:24 AM
	To: postgis-users at postgis.refractions.net
	Subject: [postgis-users] GEOS Problems
	Hello Postgis Users,
	we are building a complex application with many gis operations.
	The most problems occured within the geomUnion, intersection and difference functions.
	We have some different problems using GEOS operations. We think that is a 
	problem with tolerances while processing the geometries.
	We have tried "SnapToGrid","Buffer" with zero distance and so on ... , but we can't find a
	solution that will work in all cases.
	Either we get an Error from Geos (eg. "No outgoing edge found" and many more), or we dont get the 
	expected result.
	The following example creates two different results for the same operation with the
	"same" geometries, but different geometrie casts.
	----- import with psql -----------------------------------------------

	    geom public.geometry
	COPY t1 (geom) FROM stdin;
	-- the statement below will produce a single-polygon with 10 Points, 
	-- this is the expected result ...
	select asText(geomUnion(asText(geom))) from t1

	-- but this statement produces a multipolygon with 13 points 
	select asText(geomUnion(geom)) from t1 

	-- Postgres Version : "PostgreSQL 8.1.2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)"
	-- Postgis Version  : "POSTGIS="1.1.1" GEOS="2.2.1-CAPI-1.0.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS (procs 1.1.0 upgrade)" 
	-- OS: Windows Server 2003
	-- Best regards 


	Rene Neidt
	Projektleiter Software
	IDU Ingenieurgesellschaft für Datenverarbeitung und Umweltschutz mbH
	Theodor-Körner-Allee 16
	02763 Zittau

	Tel ++49 3583 61-15-37
	Fax ++49 3583 61-12-10

	Internet http://www.idu.de/, http://www.webmapserver.de/
	Anfahrt: http://www.stadtplan-zittau.de/?alias=idu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060411/ca3c9c94/attachment.html>

More information about the postgis-users mailing list