[postgis-users] Distance function Trouble

Obe, Regina robe.dnd at cityofboston.gov
Tue Apr 24 13:12:56 PDT 2007


Where did you get these points from? 

You are right that m does mean meters, but your data doesn't really look
like meters - it looks more like degrees where the setsrid was run to
force it into 26986

 If I do 

 select
asewkt(geometry('01010000206A690000E0724A404C42F6BF64E597C118B14A40'))
as the_junc,
asewkt(geometry('01010000206A690000A0EA573A1F5EF6BFC70F9546CCB04A40'))
as the_poi

I get

"SRID=26986;POINT(-1.391186 53.383568)";"SRID=26986;POINT(-1.397979
53.381234)"

Which looks nothing like any 26986 data I have ever seen.

Hope that helps,
Regina

 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of I B
Adams
Sent: Tuesday, April 24, 2007 12:24 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Distance function Trouble


I appear to be having some trouble with the distance function. I can get
all
the distances of pois from my junction point using the SQL:
 
select poi.the_geom, distance(poi.the_geom, (SELECT the_geom FROM
junctions
WHERE old_id = 228260200050018 )) from poi order by distance

this gives me the closest junction with distance 0.00718278491319708.

The junctions.the_geom for old_id returns
01010000206A690000E0724A404C42F6BF64E597C118B14A40

and the the_geom for the nearest poi is
01010000206A690000A0EA573A1F5EF6BFC70F9546CCB04A40


My SRID for these tables is 26986
When I query my spatial_ref table with SQL

select * from spatial_ref_sys where srid=(select srid(the_geom) from poi
limit
1

which then says

"+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41
+lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m
+no_defs "

I get the same for my junctions table.

units=m I think I read somewhere means meters. Thus if I understand
correctly
the poi is supposed to be 0.007 meters away. However when I add both
points to
a map and view them they are quite a long way apart. Have i read the
units
wrong or is the distance function not working correctly with my data
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.



More information about the postgis-users mailing list