[postgis-devel] st_isvalid() does not return warning message
Martin Davis
mbdavis at refractions.net
Tue Sep 15 10:55:44 PDT 2009
It's definitely NOT because GEOS is collapsing the points into one - and
even if this were the cause, geometries are allowed to have repeated points.
It's because the two very close points cause the adjacent segments to
cross. This creates a small "loop" or self-intersection in the polygon
shell.
You can see this if you extract the line segments and compute their
relationship:
LINESTRING (-107 54.2, -108.616666666667 54.2)
LINESTRING (-108.616666666664 54.1999999999825, -108.600299787004
54.2475512622716)
The DE-9IM matrix for this is 0F1FF0102. This indicates that the line
segments cross (i.e intersect in a point interior to both segments).
This is indicated by the fact that the [Int, Int] entry of the matrix is
0 (rather than F).
Blake Crosby wrote:
> Maxime,
>
> Thanks, perhaps I will upgrade!
>
> So it looks like there is an issue with significant digits, in my view:
>
> (-108.616666666667 54.2) != (-108.616666666664 54.1999999999825)
>
> Cause it looks like its rounding up. and treating these two points as
> one.
>
> Blake
>
> Maxime van Noppen wrote:
>> On 09/12/09 15:43, Blake Crosby wrote:
>>> Any way I can figure out why this geometry isn't valid? Postgis version
>>> 1.3:
>>
>> This isn't goint to help much but in Postigs 1.4 there is a
>> ST_IsValidReason function that does this.
>>
>> http://postgis.refractions.net/documentation/manual-1.4/ST_IsValidReason.html
>>
>>
>> If it is possible for you to update this might be a solution.
>>
>> I've got a 1.4 version so here's the result for you polygon :
>>
>> st_isvalidreason
>> -----------------------------------
>> Self-intersection [-108.617 54.2]
>>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
More information about the postgis-devel
mailing list