<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Could you suggest to me how I can the get the result in meters and not degrees? Thanks very much for your help<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: "Burgholzer,Robert" <rwburgholzer@deq.virginia.gov><br>To: PostGIS Users Discussion <postgis-users@postgis.refractions.net><br>Sent: Thursday, 19 July, 2007 7:55:07 PM<br>Subject: RE: [postgis-users] Distance query not working after transfrom?<br><br>
<style>
<!--
_filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;color:navy;}
_filtered {margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I think that this is an entirely correct
result, as you are now getting it in the new units, which are degrees, rather
than meters.</span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">r.b.</span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal" style="margin-left: 0.5in;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">-----Original Message-----<br>
<b><span style="font-weight: bold;">From:</span></b> postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <b><span style="font-weight: bold;">On Behalf Of </span></b>Alan Cunnane<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 19, 2007 2:51
PM<br>
<b><span style="font-weight: bold;">To:</span></b>
postgis-users@postgis.refractions.net<br>
<b><span style="font-weight: bold;">Subject:</span></b> [postgis-users] Distance
query not working after transfrom?</span></font></p>
<p class="MsoNormal" style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<div>
<p class="MsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Im
having a problem with a distance query after I transformed a set of points to
another SRID. I transformed from easting northing (SRID 27700) to longitude
lattitude (SRID 4326). The problem that I am having is that when I do the
same distance queries using both geom columns I get a completely different
result? I know that the distance query using the first easting northing column
is correct. Here is an example of the different returns I am getting:<br>
<br>
SRID (27700):<br>
<br>
SELECT a.stop_reference, b.stop_reference, distance(a.east_north, b.east_north)
FROM bus_stops1 a, bus_stops1 b WHERE a.stop_reference = 6200206290 AND
b.stop_reference = 6200244450;<br>
<br>
stop_reference | stop_reference | distance<br>
----------------+----------------+------------------<br>
6200206290 | 6200244450 |
4320.88972319359<br>
<br>
SRID (4326):<br>
<br>
SELECT a.stop_reference, b.stop_reference, distance(a.googlemap, b.googlemap)
FROM bus_stops1 a, bus_stops1 b WHERE a.stop_reference = 6200206290 AND
b.stop_reference = 6200244450;<br>
<br>
stop_reference | stop_reference | distance<br>
----------------+----------------+-------------------<br>
6200206290 | 6200244450 |
0.041147965100606<br>
<br>
Here is the table I am selecting from:<br>
<br>
<br>
Table
"s0679212.bus_stops1"<br>
Column
| Type
| Modifiers<br>
----------------+-----------------------+-----------<br>
stop_reference | character varying(12) | not null<br>
easting |
integer
| not null<br>
northing |
integer
| not null<br>
full_location | character varying(50) |<br>
gazetteer_code | character varying(1) |<br>
point_type | character varying(1) |<br>
nat_gazetteer | character varying(7) |<br>
district_name | character varying(24) |<br>
town_name | character varying(24) |<br>
east_north |
geometry
| not null<br>
lat |
double precision |<br>
lon |
double precision |<br>
googlemap |
geometry
|<br>
Indexes:<br>
"bus_stops1_pkey" PRIMARY KEY, btree
(stop_reference)<br>
"stops_distance1" gist (east_north)<br>
Check constraints:<br>
"enforce_dims_east_north" CHECK (ndims(east_north)
= 2)<br>
"enforce_dims_googlemap" CHECK (ndims(googlemap) =
2)<br>
"enforce_geotype_east_north" CHECK
(geometrytype(east_north) = 'POINT'::text OR east_north IS NULL)<br>
"enforce_geotype_googlemap" CHECK
(geometrytype(googlemap) = 'POINT'::text OR googlemap IS NULL)<br>
"enforce_srid_east_north" CHECK (srid(east_north)
= 27700)<br>
"enforce_srid_googlemap" CHECK (srid(googlemap) =
4326)<br>
<br>
I created the googlemap column using these commands:<br>
<br>
SELECT AddGeometryColumn( 'bus_stops1', 'googlemap', 4326, 'POINT', 2 );<br>
UPDATE bus_stops1 SET googlemap = transform(setsrid(makepoint(easting,
northing),27700), 4326);<br>
<br>
<br>
Can anyone suggest what on earth could be wrong?<br>
<br>
<br>
<br>
<br>
</span></font></p>
</div>
<p class="MsoNormal" style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<div class="MsoNormal" style="margin-left: 0.5in; text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<hr align="center" size="1" width="100%">
</span></font></div>
<p class="MsoNormal" style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Yahoo! Mail is the world's favourite email. Don't
settle for less, <a rel="nofollow" target="_blank" href="http://uk.rd.yahoo.com/evt=44106/*http:/uk.docs.yahoo.com/mail/winter07.html">sign
up for your free account today</a>.</span></font></p>
</div>
<div>_______________________________________________<br>postgis-users mailing list<br>postgis-users@postgis.refractions.net<br><a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></div><br></div></div><br>
<hr size=1>
Yahoo! Mail is the world's favourite email. Don't settle for less, <a
href="http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html">sign up for your free
account today</a>.</body></html>