[postgis-users] Error "pt_in_ring_2d: V[n] != V[0]"

Daniel Griscom griscom at suitable.com
Wed Jun 27 13:36:44 PDT 2007


At 10:04 AM -0400 6/24/07, Daniel Griscom wrote:
>I have a set of regions (countries and states) that was built in 
>ArcView, simplified using the MapShaper website at 
><http://www.mapshaper.org/test/demo.html>, processed using 
>shp2pgsql, and then imported into PostgreSQL.
>
>Queries on the regions work IF the query is for latitudes south of 
>40N. For 40N and northward, I get an internal PostGIS error:
>
>pg_query(): Query failed: ERROR: pt_in_ring_2d: V[n] != V[0] 
>(2.79994e+006 2.08225e+007 != 2.79994e+006 2.08225e+007)

The answer: the original countries (from an ESRI data DVD) included a 
region defining Russia which was flawed: it was actually an open 
ring. I don't know why PostGIS accepted this original region, but 
processing with mapshaper.org ended up with a broken region, with a 
bounding box of 40N-70N latitude, and all longitudes. So, when 
querying a location within this bounding box, PostGIS would look at 
the region, and die with the above error.


FYI,
Dan

-- 
Daniel T. Griscom             griscom at suitable.com
Suitable Systems              http://www.suitable.com/
1 Centre Street, Suite 204    (781) 665-0053
Wakefield, MA  01880-2400



More information about the postgis-users mailing list