<div dir="ltr"><div><div>Thanks Paul, I get it now.<br></div><div>So I guess, it all comes from the fact that an arc is defined as the shortest path between 2 points which in the geometry case is a straight line and in the geography case is a great circle.<br></div><div>This also mean that "the polygon I had in mind" cannot be defined as a geography polygon.<br><br></div><div>S.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 21, 2017 at 6:03 AM, 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">:) :) :)<br><br><div>Your second polygon has the same problem as the first, except in reverse... Your second polygon basically covers no area at all, since it consists of two arcs that both do a direct southerly run to the south pole.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>P.</div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 19, 2017 at 8:09 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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.<span class="m_-7152273238028045780HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-7152273238028045780HOEnZb"><font color="#888888"><div>Sebastien<br></div></font></span><div><div class="m_-7152273238028045780h5"><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><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="m_-7152273238028045780m_1743238795838669035h5">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="m_-7152273238028045780m_1743238795838669035h5"><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_-7152273238028045780m_1743238795838669035m_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_-7152273238028045780m_1743238795838669035m_8506640383391558807m_-9184197235572961617gmail-message_body">I suspect this has something to do with the polygon crossing the equator as <br></span><span class="m_-7152273238028045780m_1743238795838669035m_8506640383391558807m_-9184197235572961617gmail-message_body"><span class="m_-7152273238028045780m_1743238795838669035m_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_-7152273238028045780m_1743238795838669035m_8506640383391558807HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-7152273238028045780m_1743238795838669035m_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" 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><br></div></div></div></div>
<br>______________________________<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>
</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><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table style="border-collapse:separate!important;table-layout:fixed" cellspacing="0" cellpadding="0" border="0" width="400"><tbody><tr><td width="127" valign="middle" align="left"><br></td><td width="300" valign="middle" nowrap height="1px" align="left"><br></td></tr></tbody></table><br></div></div></div></div>
</div></div>