[postgis-devel] [postgis-users] Problems with ST_Within in an island of a multipolygon

Sandro Santilli strk at keybit.net
Fri Mar 25 10:42:23 PDT 2011


On Fri, Mar 25, 2011 at 10:11:11AM -0600, Larry Reeder wrote:
> Thanks for the response, Sandro.    I've posted a test case on Dropbox
> at http://dl.dropbox.com/u/14591732/foo_reload.sql.   This SQL script
> will create a table called "foo_reload" with three features.   Here's

I can reproduce, and it's actually pretty puzzling.

strk=# select gid, ST_Within(ST_GeomFromText('POINT (-115.04252 36.05137)',
-1), the_geom) from foo_reload where gid = 3;
 gid | st_within
-----+-----------
   3 | t
(1 row)

strk=# select gid, ST_Within(ST_GeomFromText('POINT (-115.04252 36.05137)',
-1), the_geom) from foo_reload; 
 gid | st_within
-----+-----------
   1 | f
   2 | f
   3 | f
(1 row)

The distance from point to the boundaries is not even that small:

 gid |     st_distance
-----+---------------------
   1 |   0.149589748004329
   2 | 0.00350800000001072
   3 | 0.00350800000001072
(3 rows)

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list