# [postgis-users] st_isvalid() does not return warning message

Chris Hermansen chris.hermansen at timberline.ca
Sun Sep 13 11:26:57 PDT 2009

```Hmm. The earth is 40000km in circumference, / 360 degrees is about 110 km per degree.

These two points are 1E-11 degrees apart, times 1E5 meters/degree, or about 1E-6 meters. Seems pretty close to me.

Over and above that, I would guess that PostGIS uses some kind of tolerance to compare for equality, and your coordinates are equal to 12+ decimal places.

Or am I missing something?
Chris Hermansen        chris.hermansen at timberline.ca
tel+1.604.714.2878 · fax+1.604.733.0631 · mob+1.778.840.4625
Timberline Natural Resource Group · www.timberline.ca
401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5

-----Original Message-----
From: Blake Crosby <me at blakecrosby.com>

Date: Sat, 12 Sep 2009 09:39:46
To: PostGIS Users Discussion<postgis-users at postgis.refractions.net>
Subject: Re: [postgis-users] st_isvalid() does not return warning message

Chris,

I hope this isn't the problem. Cause really:

(-108.616666666667 54.2) != (-108.616666666664 54.1999999999825)

Here is what the shape looks like:

http://www.blakecrosby.com/shape.jpg

Blake

Chris Hermansen wrote:
> Blake, I haven't sketched it out but it looks like two points are nearly on top of one another - at -108.616666666667 54.2,-108.616666666664
> 54.1999999999825
>
> And later at
> -108.683333333331
> 54.766666666652,-108.683333333333 54.7666666666667
>
> Could this be your problem?
> ------Original Message------
> From: Blake Crosby
> Sender: postgis-users-bounces at postgis.refractions.net
> To: PostGIS Users Discussion
> Subject: [postgis-users] st_isvalid() does not return warning message
> Sent: Sep 11, 2009 22:02
>
> Hello,
>
> I'm trying to figure out why some of my geometries are not valid.
>
> Take the following geo:
>
> POLYGON((-111.066666666667 56.0666666666667,-110.3
> 56.5,-107.916666666667 56.5,-106.833333333333
> 56.1166666666667,-106.833333333333 54.2833333333333,-107
> 54.2,-108.616666666667 54.2,-108.616666666664
> 54.1999999999825,-108.600299787004 54.2475512622716,-108.58790183346
> 54.29551368139,-108.579516153242 54.3437730783836,-108.575176879509
> 54.392214173427,-108.574908719816 54.4407208506564,-108.578726762226
> 54.4891764287016,-108.586636300775 54.5374639364321,-108.598632681986
> 54.5854663933806,-108.614701174154 54.6330670942644,-108.634816861126
> 54.6801498969695,-108.658944562284 54.7265995133165,-108.683333333331
> 54.766666666652,-108.683333333333 54.7666666666667,-108.433333333333
> 54.9333333333333,-108.433333333333 55.3333333333333,-108.433333333333
> 56.0666666666667,-111.066666666667 56.0666666666667))
>
> st_issimple() returns true, while st_isvalid() returns false. The
> st_isvalid() documentation states that the PGSQL Warning message will
> let me know why its invalid, but it does not:
>
> flightplan=> select st_isvalid(geometry) from airspace where id='238';
>   st_isvalid
> ------------
>   f
>
> Any way I can figure out why this geometry isn't valid? Postgis version 1.3:
>
> flightplan=> select postgis_version();
>              postgis_version
> ---------------------------------------
>   1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>_______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> Chris Hermansen        chris.hermansen at timberline.ca
> tel+1.604.714.2878 · fax+1.604.733.0631 · mob+1.778.840.4625
> Timberline Natural Resource Group · www.timberline.ca
> 401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5
>_______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
```