<div dir="ltr">Yes, you've got it right. The projected point is done in sphere world for speed, and then the point-to-point distance is done on spheroid. Most people don't care. Curse you for caring :)<div>P</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 4:36 PM, Hector Gonzalez <span dir="ltr"><<a href="mailto:hagonzal@gmail.com" target="_blank">hagonzal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<br><br><div><div>I am trying to verify the distance calculation (using geographies and use_spheroid=true) between a line and a point.</div><div><br></div><div>I
 have used GeographicLib to generate a geodesic (using the wgs84 
ellipsoid) between points 0 0 and 10 50 (lng lat). I generate a point 
lies on the edge (at the mid point)  which is 3.91451185 25.11977359. 
When I use st_distance to compute the distance between the edge and the 
point I expect the answer to be close to 0. But it is not.</div><div><br></div><div>select st_distance(st_geogfromtext('S<wbr>RID=4326;point( 3.91451185 25.11977359 )'),st_geogfromtext('SRID=4326<wbr>;linestring(0.00000000 0.00000000,   10 50 )'), true);</div><div>produces: 274.54332271 meters. If I use use_spheroid=false the answer is 274.10911308.</div><div><br></div><div>Is
 this because the distance calculation between a point and a line is 
done by projecting the point to the line assuming a perfect sphere? Or 
am I doing something wrong?</div><div><br></div><div>I am using Postgresql-9.5 and PostGIS-2.2 on Ubuntu 16.04.<br></div><div><br><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_2546835929450202945gmail_signature">Hector</div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>