[postgis-users] Point in Poly just not working

Jason Leach jason.leach at gmail.com
Thu Dec 23 11:09:27 PST 2010


Hi:

I'm just not having any luck determining if a point is in a polygon.

1. I add my SRID for NAD_1983_UTM_Zone_10N to the spatial ref.
2. Importing the City of Vancouver's boundary (MULTILINESTRING) with -s 1 (SRID=1) and load the SQL file.
3. Pick a point within the city from google map: 49.284562,-123.097172
4. Check if the point is in the boundary:

covciv=# select ST_Contains(c.the_geom, ST_GeomFromText('POINT(49.284562 -123.097172)', 1)) from city_boundary c;
 st_contains 
-------------
 f
(1 row)

covciv=# select ST_Contains(c.the_geom, ST_GeomFromText('POINT(-123.097172 49.284562)', 1)) from city_boundary c;
 st_contains 
-------------
 f
(1 row)

I've also tried this with MULTIPOLYGON data in case MULTILINESTRING was the problem.
 
Any tips would be appreciated.


The shape file's proj:

PROJCS["NAD_1983_UTM_Zone_10N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-123],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0],UNIT["Meter",1]]

My proj with SRID = 1;

INSERT INTO  spatial_ref_sys VALUES (1,NULL,NULL,'PROJCS[''NAD_1983_UTM_Zone_10N'', GEOGCS[''GCS_North_American_1983'', DATUM[''D_North_American_1983'', SPHEROID[''GRS_1980'',6378137,298.257222101]], PRIMEM[''Greenwich'',0], UNIT[''Degree'',0.0174532925199433]], PROJECTION[''Transverse_Mercator''], PARAMETER[''False_Easting'',500000.0], PARAMETER[''False_Northing'',0.0], PARAMETER[''Central_Meridian'',-123.0], PARAMETER[''Scale_Factor'',0.9996], PARAMETER[''Latitude_of_Origin'',0.0], UNIT[''Meter'',1.0]]');
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101223/85a93c65/attachment.html>


More information about the postgis-users mailing list