<div dir="ltr"><div>Thanks for your reply Paul.<br></div><div>Yes, that's what I thought. That would explain why (0,-82) is inside the polygon.<br></div><div>Nevertheless, if my first segment runs through the south pole, then I would expect both of the queries mentioned in my initial post to return 0 which is not the case.<br><br></div><div>Sebastien<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 4:56 PM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</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">I don't the polygon you've draw means what you think it does. <span class=""><div><br></div><div><span style="font-size:12.8px">POLYGON((-90 -80, 90 -80, 90 10, -90 10, -90 -80))</span><br></div><div><br></div></span><div>For example, you probably figure the first segment, <span style="font-size:12.8px">-90 -80, 90 -80 runs east-west between two points close to the south pole. In fact, it runs directly over the south pole, so actually to the south of your point of interest. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">P</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Feb 19, 2017 at 7:36 PM, Sebastien Delaux <span dir="ltr"><<a href="mailto:s.delaux@metocean.co.nz" target="_blank">s.delaux@metocean.co.nz</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi all,<br><br></div><div>I am new to postgis and I am interested in finding all the points that are located at x metres or less of a polygon that are stored in my postgres database.<br></div><div>As I am working with data located all over the world and want to work with distances in metres I decided to use the geography type.<br><br></div><div>I am trying to understand why the following query returns 0 when the point is clearly not included in the polygon:<br><span class="m_8506640383391558807m_-9184197235572961617gmail-message_body">SELECT 
ST_Distance(ST_GeographyFromTe<wbr>xt('SRID=4326;POINT(0. 
-82.)'),ST_GeographyFromText('<wbr>SRID=4326;POLYGON((-90 -80, 90 -80, 90 10,
 -90 10, -90 -80))'));<br><br></span></div><div><span class="m_8506640383391558807m_-9184197235572961617gmail-message_body">I suspect this has something to do with the polygon crossing the equator as <br></span><span class="m_8506640383391558807m_-9184197235572961617gmail-message_body"><span class="m_8506640383391558807m_-9184197235572961617gmail-message_body">SELECT 
ST_Distance(ST_GeographyFromTe<wbr>xt('SRID=4326;POINT(0. 
-82.)'),ST_GeographyFromText('<wbr>SRID=4326;POLYGON((-90 -80, 90 -80, 90 
-10, -90 -10, -90 -80))'));</span></span></div><div>returns a plausible distance.<br><br></div><div>Would anybody know whether my polygon is violating some assumption or whether there is any other reason that I am getting those results?<br><br></div><div>Thanks<span class="m_8506640383391558807HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_8506640383391558807HOEnZb"><font color="#888888"><div>Sebastien<br></div><div><br></div><div><br></div><div><br></div><div><div><br><br clear="all"><br></div></div></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">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/mailma<wbr>n/listinfo/postgis-users</a><br></blockquote></div><br></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><br></div></div>