[postgis-users] Aggregate Function Malfunction

Stephen Woodbridge woodbri at swoodbridge.com
Mon May 23 05:24:19 PDT 2005


Mark,

Did you try something like:

SELECT IsValid( MultiIntersection( the_geom )) FROM myTable WHERE 
IsValid(the_geom);

to see what it reports?

-Steve

Mark Fenbers wrote:
> I have a table populated with geometries (polygons to be exact) that 
> were created with other PostGIS functions.  They were added to this 
> table after passing the IsValid() test.  A SELECT query using IsValid() 
> verifies that all geometries in the table are valid.  But when I run the 
> query,
> 
> SELECT Npoints( MultiIntersection( the_geom )) FROM myTable WHERE 
> IsValid(the_geom);
> 
> I get an error "parse error - invalid geometry".  I cannot tell which 
> record is triggering the error because MultiIntersection() is an 
> *aggregate* function I created to take the cumulative Intersection() of 
> several polygons in the table (one per row).  It is defined as such:
> 
> CREATE AGGREGATE MultiIntersection (
>    BASETYPE = GEOMETRY,
>    SFUNC = Intersection,
>    STYPE = GEOMETRY,
>    INITCOND = ''
> );
> 
> I'm going on the assumption that, because this is my first attempt at my 
> own aggregate function, I am doing something incorrectly.  But I can 
> figure out what it is I am doing wrong.  Can you help, please?
> Some of my cluelessness may be in part due to a lack of my understanding 
> the STYPE, and BASETYPE parameters as well as what the INITCOND setting 
> should be.  I have not successfully found any documentation on these 
> other than syntax and examples.
> 
> Mark
> 
> _______________________________________________
> 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