Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using the MassGIS House District data layer with srid 26986. I then query for the geom containing the lat/lon 42.21, -71.5 which should give me Boston but I got nothing. So I used OpenJump to visualize this and the point is rendering a few hundred miles south of the House District geoms:

I am guessing there is something wrong with the projection but according to multiple sources this is the correct srid: http://www.mass.gov/anf/research-and-tech/it-serv-and-support/application-serv/office-of-geographic-information-massgis/datalayers/overview.html.

Any pointers?

share|improve this question
    
This is not an issue of having the lat/lon backwards. I am correctly declaring the points as: select st_point(-71.5, 42.21); –  bcardarella Aug 14 '13 at 21:42
1  
You're working in the wrong coord system. By that I mean, you just put a point at 71.5 meters west of the origin, 42.21 meters north of the origin of the Mass State Plane coordinate origin. So you need to translate either your data from srid 26986 to a lat lon projection (like 4326), or translate your st_point() query to reflect that you're using Mass State Plane Coordinates, not degrees. –  mtn.biker Aug 14 '13 at 22:39

1 Answer 1

up vote 4 down vote accepted

There is nothing wrong with the projection, it probably just needs to be transformed correctly:

SELECT ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(-71.5, 42.21), 4326), 26986));

                st_astext
------------------------------------------
 POINT(200000.000000001 884394.318987381)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.