[postgis-users] geomunion question, unexpected behavior

Ethan Alpert ealpert at digitalglobe.com
Wed Dec 1 09:43:14 PST 2004



I had a lot of these types of problems previously and I upgraded to
0.9.0 and GEOS 2.0 to correct the problem. I did narrow my problem down
to GEOS having problems with Geometries that were the same. You may try
selecting distinct geometries to pass to geomunion.

You may want to make sure all your geometries are valid. Do a select
isvalid(the_geom) 

-e

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
rm_postgis at cheapcomplexdevices.com
Sent: Wednesday, December 01, 2004 10:18 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] geomunion question, unexpected behavior



I think the two queries below are both computing the union of the exact 
set of polygons; yet they are producing different results.

In the first case, I create the union of all at once.
This gives me a TopologyException.

In the second case, I group the polygons into smaller subsets, and
create 
a geomunion of each - and then cerate a geomunion of the resulting 
subsets.  This works fine and gave me the expected results.

The polygons being unioned ( unionized? :-) ) are all the results of the
buffer() function being applied to MultiPoint objects; so I think
they're well-formed polygons.



Am I correct in guessing that this behavior is incorrect?
Any hints how to debug?

I could dump&send the data, but couldn't get it to fail with less than
720 
polygons yet.

     Thanks in advance
     Ron



fl=# explain analyze
      select geomunion(the_geom) from user_area_features;

NOTICE:  TopologyException: no outgoing dirEdge found (-84.2768,30.4646)
ERROR:  GEOS union() threw an error!
fl=#
fl=#
fl=# explain analyze
      select geomunion(the_geom) from
       (select featureid,geomunion(the_geom) as the_geom from
user_area_features group by featureid
      ) as a;
                                                               QUERY
PLAN
------------------------------------------------------------------------
--------------------------------------------------------------
  Aggregate  (cost=25.02..25.02 rows=1 width=32) (actual
time=985.487..985.493 rows=1 loops=1)
    ->  Subquery Scan a  (cost=25.00..25.01 rows=1 width=32) (actual
time=15.343..644.812 rows=45 loops=1)
          ->  HashAggregate  (cost=25.00..25.00 rows=1 width=910)
(actual time=15.324..644.047 rows=45 loops=1)
                ->  Seq Scan on user_area_features  (cost=0.00..20.00
rows=1000 width=910) (actual time=0.611..5.698 rows=720 loops=1)
  Total runtime: 986.676 ms
(5 rows)


fl=#
fl=# select count(*) from user_area_features;
  count
-------
    720
(1 row)

fl=# select postgis_full_version();
                                         postgis_full_version
------------------------------------------------------------------------
-----------------------------
  POSTGIS="0.9.0" GEOS="2.0.1" PROJ="Rel. 4.4.8, 3 May 2004" USE_STATS 
DBPROC="0.0.1" RELPROC="0.0.1"
(1 row)

fl=#


_______________________________________________
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