[postgis-users] union operation

Nathan Widmyer lighthousej at gmail.com
Fri Aug 7 14:16:53 PDT 2009


I understand what you mean, but maybe some more background is needed on my part.

I was having problems with some polygons where all coordinates are
zero, so not an valid geometry, which is why to me area=validity.
At this level, there is no possibility of inner rings, these will only
ever be completely filled polygons.

The problem from what I've seen is that two polygons are valid, but
they share a point, and when making a union, I get the error about a
non-noded intersection.
I'll try the latest versions of Pg/PGIS/GEOS and see if that can
handle the behavior.
I'll take a look at that ST_SnapToGrid.

Thank you,
Nate

On Fri, Aug 7, 2009 at 11:39 AM, Kevin Neufeld<kneufeld at refractions.net> wrote:
> lighthousej at gmail.com wrote:
>>
>> The geometries themselves look okay, they specify polygons that have some
>> area.
>
> Unfortunately, computing area is not indicative of valid geometries.  For
> example, consider this polygon that has a hole that extends outside of the
> polygon, but still returns an area ... whatever that might mean.
>
> SELECT ST_IsValid(geom), ST_Area(geom)
> FROM (
>  SELECT '
>    POLYGON(
>      (1 1, 1 4, 4 4, 4 1, 1 1),
>      (2 2, 5 6, 6 6, 6 5, 2 2)
>    )'::geometry AS geom
> ) AS foo;
> NOTICE:  Self-intersection at or near point 4 3.5
>  st_isvalid | st_area
> ------------+---------
>  f          |       5
> (1 row)
>
>
>
>> Any more things to look at would be much appreciated.
>
> As Regina eluded to, if you've ruled out geometry validity as the problem,
> it may be st_union is running into precision issues.  Try putting your
> geometries through ST_SnapToGrid()
>
> Cheers,
> -- Kevin
>
> _______________________________________________
> 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