<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Trebuchet MS">
<DIV>Greetings!</DIV>
<DIV> </DIV>
<DIV>The PostGIS azimuth function seems to use a simple arctan function to determine azimuth. If you convert your coordinates to a projected coordinate system and then run the query, your results will be much closer to the FCC site's results.</DIV>
<DIV> </DIV>
<DIV>Here is a quick conversion to UTM Zone 31:</DIV>
<DIV> </DIV>
<DIV>select degrees(azimuth(<BR>'POINT(634714.442133176 5802006.052402816)',<BR>'POINT(634731.2410598891 5801981.648284801)'<BR>));</DIV>
<DIV> </DIV>
<DIV>which yields an azimuth of 145.457858825445.  Points in the center of the UTM zone, or a more suitable projection would give better results.</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Tom</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>
<DIV><FONT face=Arial size=2>---------------------------------------<BR>Tom Glancy<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Minnesota Department of Natural Resources<BR>St. Paul, MN 55155-4025<BR>---------------------------------------</FONT></DIV><BR><BR>>>> Shane Wegner <shane-postgis@csy.ca> 7/23/2008 10:50 AM >>><BR>Hello all,<BR><BR>We have encountered a bit of a puzzle and are trying to<BR>figure out why Postgis's azimuth function differs from<BR>those on the web including the geocalc php class.<BR><BR>I checked with the official FCC site:<BR><A href="http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html">http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html</A><BR><A href="http://www.fcc.gov/mb/audio/bickel/distance.html">http://www.fcc.gov/mb/audio/bickel/distance.html</A><BR><BR>Using the following coordinates:<BR>Lat A:<BR>52.3517733<BR>52? 21' 6.3828"<BR>Lon A:<BR>4.9779616<BR>4? 58' 40.6626"<BR>Lat B:<BR>52.3515499<BR>52? 21' 5.58"<BR>Lon B:<BR>4.9781983<BR>4? 58' 41.5122"<BR><BR>FCC site results:<BR>    Distance between<BR>N Latitude 52 21 6.38, E Longitude 4 58 40.66 (Point 1)<BR>and<BR>N Latitude 52 21 5.58, E Longitude 4 58 41.51 (Point 2)<BR>is:<BR>0.030 kilometers; 0.018 miles<BR>Azimuth from point 1 to point 2 = 147.36?<BR>Azimuth from point 2 to point 1 = 327.36?<BR><BR>GeoCalc.class results (no rounding):<BR>The distance between:<BR>Point A (Latitude 52.3517733 and longitude 4.9779616)<BR>and<BR>Point B (Latitude 52.3515499 and longitude 4.9781983)<BR>is:<BR>0.0295893693401 km, 0.018 miles, Great Circle formula, and<BR>0.0296323390621 km, 0.018 miles, Accurate Ellipsoid<BR>formula.<BR>Point B is at 147.089942074 degrees, or to the southeast by<BR>south, from<BR>point A.<BR><BR>And PostGis:<BR>gps=> select<BR>degrees(azimuth(<BR>'POINT(4.9779616 52.3517733)',<BR>'POINT(4.9781983 52.3515499)'<BR>)),<BR>Distance_sphere(<BR>'POINT(4.9779616 52.3517733)',<BR>'POINT(4.9781983 52.3515499)'<BR>);<BR>     degrees      | distance_sphere<BR>------------------+-----------------<BR>133.344225772517 | 29.589241096272<BR>(1 row)<BR><BR>So one function reports 147 degrees angle and PostGis is<BR>reporting 133 degrees.  Just wondering which is correct and<BR>why the reported difference?<BR><BR>Shane<BR>_______________________________________________<BR>postgis-users mailing list<BR>postgis-users@postgis.refractions.net<BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR></DIV></BODY></HTML>