<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div><span><br></span></div><br><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div class="y_msg_container"><br><div id="yiv4947487198"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div>Hi,</div><div><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">I have been looking at using ST_Project() to solve a problem I have (& in theory it is perfect!).</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times,
 serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">It seems to introduce some inaccuarcies, which can be quite significant in some use cases. The SQL below projects a new point 2km E, then back 2km W. The result should be in the same place we started, but is not, by a larger value than
 I'm comfortable with. The source point location comes from a real dataset.<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">select Postgis_full_version();<br><br>POSTGIS="2.0.1 r9979" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.8" TOPOLOGY RASTER<br></span><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york,
 times, serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">select ST_AsText(point) as point,<br>       ST_AsText(ST_Project(point, 2000,radians(90))) as proj2k,</span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">       ST_AsText(ST_Project(ST_Project(point, 2000,radians(90)), 2000,radians(270))) as proj2k0<br>from (select ST_AsText(ST_SetSRID(ST_MakePoint(171.0259489718, -45.2961933568),4326))::geography as point) as foo;</span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;"><span style="font-family:Courier New, courier, monaco, monospace,
 sans-serif;"><br></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">point   | POINT(171.0259489718   -45.2961933568)<br>proj2k  | POINT(171.051446314948 -45.2961905108324)<br>proj2k0 | POINT(171.025948973075 -45.296187664865)<br><br></span></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;">The final lat & lon should be the same as the original, but both have changed, the latitude substantially more than the longitude - even though the point latitude should be unchanged (it only moved E & W, not N or S) </div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0,
 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;">It gets worse with larger distances, eg, at 2000km:</div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">select ST_AsText(point) as point,<br>       ST_AsText(ST_Project(point, 2000000,radians(90))) as proj2000k,<br>       ST_AsText(ST_Project(ST_Project(point, 2000000,radians(90)), 2000000,radians(270))) as proj2000k0<br>from (select ST_AsText(ST_SetSRID(ST_MakePoint(171.0259489718,
 -45.2961933568),4326))::geography as point) as foo;<br><br>point      | POINT(171.0259489718 -45.2961933568)<br>proj2000k  | POINT(-164.264848338683 -42.5385273590618)<br>proj2000k0 | POINT(172.015779821441 -40.0225960863261)</span></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:Courier New, courier, monaco, monospace, sans-serif;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:times new roman, new york, times, serif;">it causes over 5 degree change in the latitude.</span></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;
background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;">Is this a bug I should be submitting or have I missed something?</div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;">Thanks</div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;">  Brent
 Wood<br></div><div style="color:rgb(0, 0, 0);font-size:16px;background-color:transparent;font-style:normal;font-family:times new roman, new york, times, serif;"><br></div></div></div></div><br><br></div> </div> </div>  </div></body></html>