[postgis-users] geomunion question, unexpected behavior

rm_postgis at cheapcomplexdevices.com rm_postgis at cheapcomplexdevices.com
Wed Dec 1 09:17:42 PST 2004


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=#





More information about the postgis-users mailing list