<div dir="ltr">You're subdividing in a planar space and then applying a geodetic calculation. The subdivision in planar space is the same as the input, but not in the geodetic space. If you st_segmentize your original before subdividing, you can reduce the effect, but you cannot get rid of it. Or apply st_subdivide on your geometry in a local gnomonic projection, where great circles are straight lines, rather than in a plate carre.<div><br></div><div>P.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Sep 9, 2025 at 12:00 PM nikolai.berkoff via postgis-users <<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Thank you very much,<br>
<br>
I guess my toy example was too much of a toy but I still think the problem exists with the suggestion to use ST_Subdivide as it will chop up a geometries long "straight lines" into smaller "straight lines".<br>
<br>
<a href="https://postgis.net/documentation/faq/big-objects-performance/" rel="noreferrer" target="_blank">https://postgis.net/documentation/faq/big-objects-performance/</a><br>
seems to suggest to use ST_Subdivide to work with large geometries but<br>
<a href="https://postgis.net/documentation/faq/geography-inside/" rel="noreferrer" target="_blank">https://postgis.net/documentation/faq/geography-inside/</a><br>
and the responses here make it clear that it doesn't work if I want to then use any geographical calculation.<br>
<br>
A better toy example is getting the distance of the geom to a point:<br>
<br>
SELECT ST_Distance(geography('POINT(-77 48)'), geometry('POLYGON((-71.37 55.8,-63.96 54.61,-72.49 51.77,-81.32 46.47,-81.89 46.09,-81.95 46.09,-81.97 46.09,-82 46.09,-82.01 46.09,-82.02 46.1,-82.03 46.1,-82.04 46.1,-82.05 46.1,-82.07 46.11,-82.09 46.11,-82.12 46.11,-82.12 46.1,-82.13 46.1,-82.14 46.11,-82.14 46.1,-82.15 46.1,-82.15 46.11,-82.16 46.11,-82.19 46.12,-82.19 46.13,-82.2 46.13,-82.21 46.14,-82.21 46.13,-82.22 46.13,-82.22 46.14,-82.23 46.14,-82.24 46.14,-82.26 46.14,-82.28 46.14,-82.3 46.15,-82.3 46.14,-82.33 46.15,-82.34 46.15,-82.35 46.15,-82.35 46.16,-82.36 46.16,-82.36 46.17,-82.35 46.17,-82.32 46.16,-82.32 46.17,-82.32 46.18,-82.34 46.18,-82.37 46.18,-82.38 46.18,-82.39 46.18,-82.4 46.18,-82.42 46.18,-82.43 46.18,-82.44 46.17,-82.45 46.17,-82.45 46.19,-82.46 46.2,-82.47 46.19,-82.48 46.18,-82.49 46.18,-82.5 46.18,-82.52 46.17,-82.53 46.17,-82.54 46.16,-82.55 46.17,-82.56 46.17,-82.58 46.17,-82.59 46.16,-82.6 46.16,-82.62 46.16,-82.62 46.15,-82.63 46.15,-82.64 46.15,-82.67 46.15,-82.68 46.16,-82.67 46.17,-82.68 46.17,-82.68 46.18,-82.67 46.19,-82.66 46.19,-82.64 46.19,-82.62 46.2,-82.65 46.2,-82.67 46.2,-82.71 46.19,-82.74 46.19,-82.76 46.18,-82.78 46.18,-82.79 46.18,-82.8 46.17,-82.81 46.17,-82.82 46.17,-82.84 46.17,-82.86 46.17,-82.87 46.17,-82.88 46.17,-82.91 46.18,-82.92 46.18,-82.93 46.17,-82.94 46.18,-82.96 46.17,-83 46.16,-83.01 46.17,-83.03 46.16,-83.05 46.16,-83.06 46.16,-83.09 46.16,-83.1 46.16,-83.1 46.17,-83.06 46.17,-83.05 46.18,-83.07 46.18,-83.08 46.19,-83.09 46.19,-83.1 46.19,-83.12 46.18,-83.13 46.18,-83.14 46.18,-83.15 46.18,-83.15 46.19,-83.17 46.2,-83.18 46.2,-83.19 46.19,-83.2 46.19,-83.22 46.2,-83.25 46.2,-83.26 46.21,-83.27 46.21,-83.28 46.21,-83.29 46.21,-83.3 46.21,-83.31 46.21,-83.32 46.22,-83.33 46.22,-83.34 46.22,-83.35 46.23,-83.38 46.23,-83.41 46.24,-83.43 46.24,-83.45 46.24,-83.47 46.24,-84.51 46.82,-84.5 46.82,-84.49 46.84,-84.48 46.84,-84.47 46.84,-84.46 46.84,-84.44 46.84,-84.43 46.83,-84.42 46.82,-84.42 46.81,-84.4 46.81,-84.4 46.82,-84.39 46.83,-84.38 46.83,-84.38 46.84,-84.37 46.84,-84.37 46.85,-84.37 46.86,-84.36 46.87,-84.36 46.88,-84.36 46.89,-84.38 46.89,-84.39 46.9,-84.4 46.91,-84.42 46.91,-84.43 46.91,-84.43 46.92,-84.44 46.92,-84.47 46.93,-84.48 46.93,-84.49 46.93,-84.51 46.92,-84.52 46.92,-84.53 46.93,-84.54 46.93,-84.55 46.94,-84.57 46.94,-84.58 46.93,-84.59 46.93,-84.6 46.93,-84.6 46.92,-84.6 46.91,-84.6 46.9,-84.61 46.89,-84.65 46.91,-84.65 46.92,-84.66 46.95,-84.67 46.96,-84.69 46.96,-84.7 46.96,-84.72 46.95,-84.73 46.95,-84.75 46.96,-84.76 46.97,-84.78 46.97,-84.78 46.98,-84.79 46.99,-84.79 47,-84.78 47,-84.78 47.01,-84.77 47.01,-84.78 47.02,-84.78 47.03,-84.78 47.04,-84.77 47.04,-84.77 47.05,-84.76 47.05,-84.75 47.06,-84.74 47.07,-84.73 47.07,-84.72 47.09,-84.71 47.1,-84.71 47.11,-84.72 47.11,-84.73 47.12,-84.73 47.13,-84.74 47.13,-84.74 47.14,-84.73 47.14,-84.72 47.14,-84.71 47.15,-84.7 47.15,-84.69 47.17,-84.71 47.17,-84.71 47.18,-84.7 47.18,-84.69 47.19,-84.68 47.19,-84.68 47.2,-84.67 47.2,-84.67 47.21,-84.66 47.21,-84.66 47.22,-84.65 47.22,-84.65 47.23,-84.65 47.24,-84.64 47.24,-84.64 47.25,-84.63 47.25,-84.62 47.26,-84.61 47.26,-84.6 47.27,-84.6 47.28,-84.59 47.28,-84.59 47.29,-84.58 47.29,-84.58 47.3,-84.59 47.3,-84.6 47.3,-84.61 47.34,-84.62 47.34,-84.63 47.34,-84.63 47.35,-84.64 47.35,-84.64 47.36,-84.65 47.36,-84.66 47.36,-84.67 47.35,-84.68 47.36,-84.69 47.36,-84.7 47.37,-84.7 47.38,-84.7 47.39,-84.7 47.4,-84.71 47.41,-84.71 47.42,-84.72 47.42,-84.73 47.43,-84.74 47.43,-84.75 47.44,-84.76 47.44,-84.76 47.45,-84.78 47.46,-84.79 47.47,-84.82 47.48,-84.83 47.48,-84.83 47.49,-84.87 47.49,-84.87 47.5,-84.88 47.5,-84.89 47.5,-84.9 47.51,-80.86 49.7,-79.08 51.52,-79.06 51.51,-79.04 51.51,-79.03 51.49,-79 51.47,-78.99 51.47,-78.98 51.46,-78.98 51.45,-78.98 51.43,-78.98 51.42,-78.98 51.41,-78.97 51.4,-78.97 51.38,-78.96 51.35,-78.95 51.34,-78.95 51.33,-78.96 51.32,-78.96 51.31,-78.95 51.3,-78.95 51.29,-78.94 51.28,-78.94 51.27,-78.95 51.26,-78.96 51.25,-78.96 51.24,-78.96 51.23,-78.95 51.21,-78.95 51.2,-78.94 51.19,-78.93 51.18,-78.92 51.18,-78.91 51.18,-78.9 51.17,-78.88 51.17,-78.87 51.17,-78.86 51.17,-78.86 51.18,-78.87 51.18,-78.87 51.19,-78.87 51.2,-78.89 51.2,-78.89 51.21,-78.9 51.21,-78.91 51.21,-78.92 51.22,-78.92 51.23,-78.93 51.25,-78.92 51.26,-78.91 51.28,-78.91 51.3,-78.91 51.31,-78.9 51.31,-78.89 51.32,-78.88 51.32,-78.88 51.33,-78.87 51.34,-78.87 51.35,-78.86 51.35,-78.85 51.35,-78.84 51.35,-78.84 51.36,-78.85 51.36,-78.86 51.36,-78.87 51.36,-78.89 51.37,-78.9 51.37,-78.9 51.38,-78.9 51.39,-78.9 51.4,-78.89 51.4,-78.87 51.41,-78.86 51.42,-78.84 51.43,-78.83 51.44,-78.82 51.45,-78.81 51.45,-78.81 51.46,-78.8 51.46,-78.79 51.48,-78.77 51.49,-78.76 51.49,-78.73 51.49,-78.72 51.49,-78.71 51.49,-78.7 51.49,-78.69 51.48,-78.68 51.49,-78.69 51.5,-78.7 51.5,-78.71 51.51,-78.72 51.51,-78.73 51.5,-78.75 51.5,-78.76 51.5,-78.77 51.5,-78.78 51.5,-78.79 51.5,-78.81 51.5,-78.83 51.51,-78.83 51.52,-78.82 51.53,-78.82 51.54,-78.82 51.55,-78.83 51.57,-78.83 51.58,-78.82 51.59,-78.82 51.6,-78.82 51.61,-78.83 51.61,-78.84 51.61,-78.85 51.61,-78.85 51.62,-78.86 51.63,-78.87 51.64,-78.89 51.64,-78.9 51.65,-78.91 51.65,-78.93 51.65,-78.94 51.66,-77.83 52.8,-71.37 55.8))'));<br>
<br>
   st_distance  <br>
-----------------<br>
 105664.41899567<br>
(1 row)<br>
<br>
<br>
and then getting the distance after having pre-conditioning my data via ST_Subdivide gives a shorter result.  Thanks to your answers I now understand why but it feels like this is a large caveat in using ST_Subdivide.<br>
<br>
SELECT ST_Distance(geography('POINT(-77 48)'), ST_Subdivide(geometry('POLYGON((-71.37 55.8,-63.96 54.61,-72.49 51.77,-81.32 46.47,-81.89 46.09,-81.95 46.09,-81.97 46.09,-82 46.09,-82.01 46.09,-82.02 46.1,-82.03 46.1,-82.04 46.1,-82.05 46.1,-82.07 46.11,-82.09 46.11,-82.12 46.11,-82.12 46.1,-82.13 46.1,-82.14 46.11,-82.14 46.1,-82.15 46.1,-82.15 46.11,-82.16 46.11,-82.19 46.12,-82.19 46.13,-82.2 46.13,-82.21 46.14,-82.21 46.13,-82.22 46.13,-82.22 46.14,-82.23 46.14,-82.24 46.14,-82.26 46.14,-82.28 46.14,-82.3 46.15,-82.3 46.14,-82.33 46.15,-82.34 46.15,-82.35 46.15,-82.35 46.16,-82.36 46.16,-82.36 46.17,-82.35 46.17,-82.32 46.16,-82.32 46.17,-82.32 46.18,-82.34 46.18,-82.37 46.18,-82.38 46.18,-82.39 46.18,-82.4 46.18,-82.42 46.18,-82.43 46.18,-82.44 46.17,-82.45 46.17,-82.45 46.19,-82.46 46.2,-82.47 46.19,-82.48 46.18,-82.49 46.18,-82.5 46.18,-82.52 46.17,-82.53 46.17,-82.54 46.16,-82.55 46.17,-82.56 46.17,-82.58 46.17,-82.59 46.16,-82.6 46.16,-82.62 46.16,-82.62 46.15,-82.63 46.15,-82.64 46.15,-82.67 46.15,-82.68 46.16,-82.67 46.17,-82.68 46.17,-82.68 46.18,-82.67 46.19,-82.66 46.19,-82.64 46.19,-82.62 46.2,-82.65 46.2,-82.67 46.2,-82.71 46.19,-82.74 46.19,-82.76 46.18,-82.78 46.18,-82.79 46.18,-82.8 46.17,-82.81 46.17,-82.82 46.17,-82.84 46.17,-82.86 46.17,-82.87 46.17,-82.88 46.17,-82.91 46.18,-82.92 46.18,-82.93 46.17,-82.94 46.18,-82.96 46.17,-83 46.16,-83.01 46.17,-83.03 46.16,-83.05 46.16,-83.06 46.16,-83.09 46.16,-83.1 46.16,-83.1 46.17,-83.06 46.17,-83.05 46.18,-83.07 46.18,-83.08 46.19,-83.09 46.19,-83.1 46.19,-83.12 46.18,-83.13 46.18,-83.14 46.18,-83.15 46.18,-83.15 46.19,-83.17 46.2,-83.18 46.2,-83.19 46.19,-83.2 46.19,-83.22 46.2,-83.25 46.2,-83.26 46.21,-83.27 46.21,-83.28 46.21,-83.29 46.21,-83.3 46.21,-83.31 46.21,-83.32 46.22,-83.33 46.22,-83.34 46.22,-83.35 46.23,-83.38 46.23,-83.41 46.24,-83.43 46.24,-83.45 46.24,-83.47 46.24,-84.51 46.82,-84.5 46.82,-84.49 46.84,-84.48 46.84,-84.47 46.84,-84.46 46.84,-84.44 46.84,-84.43 46.83,-84.42 46.82,-84.42 46.81,-84.4 46.81,-84.4 46.82,-84.39 46.83,-84.38 46.83,-84.38 46.84,-84.37 46.84,-84.37 46.85,-84.37 46.86,-84.36 46.87,-84.36 46.88,-84.36 46.89,-84.38 46.89,-84.39 46.9,-84.4 46.91,-84.42 46.91,-84.43 46.91,-84.43 46.92,-84.44 46.92,-84.47 46.93,-84.48 46.93,-84.49 46.93,-84.51 46.92,-84.52 46.92,-84.53 46.93,-84.54 46.93,-84.55 46.94,-84.57 46.94,-84.58 46.93,-84.59 46.93,-84.6 46.93,-84.6 46.92,-84.6 46.91,-84.6 46.9,-84.61 46.89,-84.65 46.91,-84.65 46.92,-84.66 46.95,-84.67 46.96,-84.69 46.96,-84.7 46.96,-84.72 46.95,-84.73 46.95,-84.75 46.96,-84.76 46.97,-84.78 46.97,-84.78 46.98,-84.79 46.99,-84.79 47,-84.78 47,-84.78 47.01,-84.77 47.01,-84.78 47.02,-84.78 47.03,-84.78 47.04,-84.77 47.04,-84.77 47.05,-84.76 47.05,-84.75 47.06,-84.74 47.07,-84.73 47.07,-84.72 47.09,-84.71 47.1,-84.71 47.11,-84.72 47.11,-84.73 47.12,-84.73 47.13,-84.74 47.13,-84.74 47.14,-84.73 47.14,-84.72 47.14,-84.71 47.15,-84.7 47.15,-84.69 47.17,-84.71 47.17,-84.71 47.18,-84.7 47.18,-84.69 47.19,-84.68 47.19,-84.68 47.2,-84.67 47.2,-84.67 47.21,-84.66 47.21,-84.66 47.22,-84.65 47.22,-84.65 47.23,-84.65 47.24,-84.64 47.24,-84.64 47.25,-84.63 47.25,-84.62 47.26,-84.61 47.26,-84.6 47.27,-84.6 47.28,-84.59 47.28,-84.59 47.29,-84.58 47.29,-84.58 47.3,-84.59 47.3,-84.6 47.3,-84.61 47.34,-84.62 47.34,-84.63 47.34,-84.63 47.35,-84.64 47.35,-84.64 47.36,-84.65 47.36,-84.66 47.36,-84.67 47.35,-84.68 47.36,-84.69 47.36,-84.7 47.37,-84.7 47.38,-84.7 47.39,-84.7 47.4,-84.71 47.41,-84.71 47.42,-84.72 47.42,-84.73 47.43,-84.74 47.43,-84.75 47.44,-84.76 47.44,-84.76 47.45,-84.78 47.46,-84.79 47.47,-84.82 47.48,-84.83 47.48,-84.83 47.49,-84.87 47.49,-84.87 47.5,-84.88 47.5,-84.89 47.5,-84.9 47.51,-80.86 49.7,-79.08 51.52,-79.06 51.51,-79.04 51.51,-79.03 51.49,-79 51.47,-78.99 51.47,-78.98 51.46,-78.98 51.45,-78.98 51.43,-78.98 51.42,-78.98 51.41,-78.97 51.4,-78.97 51.38,-78.96 51.35,-78.95 51.34,-78.95 51.33,-78.96 51.32,-78.96 51.31,-78.95 51.3,-78.95 51.29,-78.94 51.28,-78.94 51.27,-78.95 51.26,-78.96 51.25,-78.96 51.24,-78.96 51.23,-78.95 51.21,-78.95 51.2,-78.94 51.19,-78.93 51.18,-78.92 51.18,-78.91 51.18,-78.9 51.17,-78.88 51.17,-78.87 51.17,-78.86 51.17,-78.86 51.18,-78.87 51.18,-78.87 51.19,-78.87 51.2,-78.89 51.2,-78.89 51.21,-78.9 51.21,-78.91 51.21,-78.92 51.22,-78.92 51.23,-78.93 51.25,-78.92 51.26,-78.91 51.28,-78.91 51.3,-78.91 51.31,-78.9 51.31,-78.89 51.32,-78.88 51.32,-78.88 51.33,-78.87 51.34,-78.87 51.35,-78.86 51.35,-78.85 51.35,-78.84 51.35,-78.84 51.36,-78.85 51.36,-78.86 51.36,-78.87 51.36,-78.89 51.37,-78.9 51.37,-78.9 51.38,-78.9 51.39,-78.9 51.4,-78.89 51.4,-78.87 51.41,-78.86 51.42,-78.84 51.43,-78.83 51.44,-78.82 51.45,-78.81 51.45,-78.81 51.46,-78.8 51.46,-78.79 51.48,-78.77 51.49,-78.76 51.49,-78.73 51.49,-78.72 51.49,-78.71 51.49,-78.7 51.49,-78.69 51.48,-78.68 51.49,-78.69 51.5,-78.7 51.5,-78.71 51.51,-78.72 51.51,-78.73 51.5,-78.75 51.5,-78.76 51.5,-78.77 51.5,-78.78 51.5,-78.79 51.5,-78.81 51.5,-78.83 51.51,-78.83 51.52,-78.82 51.53,-78.82 51.54,-78.82 51.55,-78.83 51.57,-78.83 51.58,-78.82 51.59,-78.82 51.6,-78.82 51.61,-78.83 51.61,-78.84 51.61,-78.85 51.61,-78.85 51.62,-78.86 51.63,-78.87 51.64,-78.89 51.64,-78.9 51.65,-78.91 51.65,-78.93 51.65,-78.94 51.66,-77.83 52.8,-71.37 55.8))'))) order by 1;<br>
   st_distance  <br>
-----------------<br>
  92373.36598847<br>
 126170.82808402<br>
 364673.04933925<br>
 407862.08030654<br>
 529769.79532574<br>
<br>
<br>
On Tuesday, 9 September 2025 at 18:05, Regina Obe <<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>> wrote:<br>
<br>
> Your smaller polygon is not within the larger one. If it was then this would return true<br>
> <br>
<br>
> SELECT ST_Intersects(ST_GeomFromText('POLYGON((-77.933927810506 48.584377886263184,-77.74471476703403 48.69534746901027,-77.69284285304693 48.71525447165988,-77.99039086603969 48.53485501013662,-77.933927810506 48.584377886263184))', 4326)::geography, ST_GeomFromText('POLYGON((-81.1755551313531 46.64525933571578,-81.50518756520556 47.21802525065504,-81.6706742747649 47.82323694299835,-81.6602226284047 48.438637358868554,-81.46784223247613 49.04081439308046,-81.09452004412593 49.60598066574395,-80.54928811996326 50.110912115887594,-79.84994871352842 50.53403375725974,-79.02318022750863 50.85659915226637,-78.10377843647761 51.06386274945413,-77.13291403765557 51.14610652092342,-76.15549659681517 51.09937193283258,-75.21696581007667 50.925776760111056,-74.42324583717638 50.655006343959805,-81.12758032107652 46.593233077736336,-81.1755551313531 46.64525933571578))',4326)::geography);<br>
> <br>
<br>
> And it returns false. Your ST_Within compare in planar space is invalid as it's treating the surfaces as planar.<br>
> <br>
<br>
> If you segmentize your geographies you will see the smaller is not within the larger.<br>
> <br>
<br>
> Here is what you get segmentizing in spheroidal space<br>
> <br>
<br>
> SELECT ST_Segmentize(ST_GeomFromText('POLYGON((-77.933927810506 48.584377886263184,-77.74471476703403 48.69534746901027,-77.69284285304693 48.71525447165988,-77.99039086603969 48.53485501013662,-77.933927810506 48.584377886263184))', 4326)::geography, 1000)<br>
> <br>
<br>
> UNION ALL<br>
> <br>
<br>
> SELECT ST_Segmentize(ST_GeomFromText('POLYGON((-81.1755551313531 46.64525933571578,-81.50518756520556 47.21802525065504,-81.6706742747649 47.82323694299835,-81.6602226284047 48.438637358868554,-81.46784223247613 49.04081439308046,-81.09452004412593 49.60598066574395,-80.54928811996326 50.110912115887594,-79.84994871352842 50.53403375725974,-79.02318022750863 50.85659915226637,-78.10377843647761 51.06386274945413,-77.13291403765557 51.14610652092342,-76.15549659681517 51.09937193283258,-75.21696581007667 50.925776760111056,-74.42324583717638 50.655006343959805,-81.12758032107652 46.593233077736336,-81.1755551313531 46.64525933571578))',4326)::geography, 1000);<br>
> <br>
<br>
> Here is your planar:<br>
> <br>
<br>
> SELECT ST_GeomFromText('POLYGON((-77.933927810506 48.584377886263184,-77.74471476703403 48.69534746901027,-77.69284285304693 48.71525447165988,-77.99039086603969 48.53485501013662,-77.933927810506 48.584377886263184))', 4326)::geography<br>
> <br>
<br>
> UNION ALL<br>
> <br>
<br>
> SELECT ST_GeomFromText('POLYGON((-81.1755551313531 46.64525933571578,-81.50518756520556 47.21802525065504,-81.6706742747649 47.82323694299835,-81.6602226284047 48.438637358868554,-81.46784223247613 49.04081439308046,-81.09452004412593 49.60598066574395,-80.54928811996326 50.110912115887594,-79.84994871352842 50.53403375725974,-79.02318022750863 50.85659915226637,-78.10377843647761 51.06386274945413,-77.13291403765557 51.14610652092342,-76.15549659681517 51.09937193283258,-75.21696581007667 50.925776760111056,-74.42324583717638 50.655006343959805,-81.12758032107652 46.593233077736336,-81.1755551313531 46.64525933571578))',4326)::geography;<br>
> <br>
<br>
> > -----Original Message-----<br>
> <br>
<br>
> > From: nikolai.berkoff via postgis-users <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br>
> <br>
<br>
> > Sent: Tuesday, September 9, 2025 7:36 AM<br>
> <br>
<br>
> > To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> <br>
<br>
> > Subject: Geometry / geography woes<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > Hi,<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > I work for a conservation NGO and we deal with lots of species ranges.<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > We have a complicated full geometry (SRID 4326)<br>
> <br>
<br>
> > <a href="https://www.iucnredlist.org/species/22733619/139214707" rel="noreferrer" target="_blank">https://www.iucnredlist.org/species/22733619/139214707</a> that we have<br>
> <br>
<br>
> > ST_Subdivided. We notice a large difference between the geographical<br>
> <br>
<br>
> > distance from a point (-77 48) to the full geometry and to nearest subdiveded<br>
> <br>
<br>
> > geometry.<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > Here is a toy example with two polygon geometries, one large and the other<br>
> <br>
<br>
> > small and a point <a href="https://wktmap.com/?771d2fc9" rel="noreferrer" target="_blank">https://wktmap.com/?771d2fc9</a> . First the geographical<br>
> <br>
<br>
> > distance from the point to the large geometry:<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > SELECT ST_Distance(ST_SetSRID(ST_MakePoint(-77, 48),4326)::geography,<br>
> <br>
<br>
> > ST_GeomFromText('POLYGON((-81.1755551313531 46.64525933571578,-<br>
> <br>
<br>
> > 81.50518756520556 47.21802525065504,-81.6706742747649<br>
> <br>
<br>
> > 47.82323694299835,-81.6602226284047 48.438637358868554,-<br>
> <br>
<br>
> > 81.46784223247613 49.04081439308046,-81.09452004412593<br>
> <br>
<br>
> > 49.60598066574395,-80.54928811996326 50.110912115887594,-<br>
> <br>
<br>
> > 79.84994871352842 50.53403375725974,-79.02318022750863<br>
> <br>
<br>
> > 50.85659915226637,-78.10377843647761 51.06386274945413,-<br>
> <br>
<br>
> > 77.13291403765557 51.14610652092342,-76.15549659681517<br>
> <br>
<br>
> > 51.09937193283258,-75.21696581007667 50.925776760111056,-<br>
> <br>
<br>
> > 74.42324583717638 50.655006343959805,-81.12758032107652<br>
> <br>
<br>
> > 46.593233077736336,-81.1755551313531<br>
> <br>
<br>
> > 46.64525933571578))',4326)::geography);<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > st_distance<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > -----------------<br>
> <br>
<br>
> > 100757.06933552<br>
> <br>
<br>
> ><br>
> <br>
<br>
> ><br>
> <br>
<br>
> > next the geographical distance from the point to the small geometry<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > SELECT ST_Distance(ST_SetSRID(ST_MakePoint(-77, 48),4326)::geography,<br>
> <br>
<br>
> > ST_GeomFromText('POLYGON((-77.933927810506 48.584377886263184,-<br>
> <br>
<br>
> > 77.74471476703403 48.69534746901027,-77.69284285304693<br>
> <br>
<br>
> > 48.71525447165988,-77.99039086603969 48.53485501013662,-<br>
> <br>
<br>
> > 77.933927810506 48.584377886263184))', 4326)::geography);<br>
> <br>
<br>
> > st_distance<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > ----------------<br>
> <br>
<br>
> > 93442.14463111<br>
> <br>
<br>
> ><br>
> <br>
<br>
> ><br>
> <br>
<br>
> > finally, showing the the small geometry is fully within the large geometry<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > SELECT ST_Within(ST_GeomFromText('POLYGON((-77.933927810506<br>
> <br>
<br>
> > 48.584377886263184,-77.74471476703403 48.69534746901027,-<br>
> <br>
<br>
> > 77.69284285304693 48.71525447165988,-77.99039086603969<br>
> <br>
<br>
> > 48.53485501013662,-77.933927810506 48.584377886263184))', 4326),<br>
> <br>
<br>
> > ST_GeomFromText('POLYGON((-81.1755551313531 46.64525933571578,-<br>
> <br>
<br>
> > 81.50518756520556 47.21802525065504,-81.6706742747649<br>
> <br>
<br>
> > 47.82323694299835,-81.6602226284047 48.438637358868554,-<br>
> <br>
<br>
> > 81.46784223247613 49.04081439308046,-81.09452004412593<br>
> <br>
<br>
> > 49.60598066574395,-80.54928811996326 50.110912115887594,-<br>
> <br>
<br>
> > 79.84994871352842 50.53403375725974,-79.02318022750863<br>
> <br>
<br>
> > 50.85659915226637,-78.10377843647761 51.06386274945413,-<br>
> <br>
<br>
> > 77.13291403765557 51.14610652092342,-76.15549659681517<br>
> <br>
<br>
> > 51.09937193283258,-75.21696581007667 50.925776760111056,-<br>
> <br>
<br>
> > 74.42324583717638 50.655006343959805,-81.12758032107652<br>
> <br>
<br>
> > 46.593233077736336,-81.1755551313531 46.64525933571578))',4326));<br>
> <br>
<br>
> > st_within<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > -----------<br>
> <br>
<br>
> > t<br>
> <br>
<br>
> ><br>
> <br>
<br>
> ><br>
> <br>
<br>
> > Why is the geographical distance to the point and the geometry increasing<br>
> <br>
<br>
> > when we are only making the geometry bigger? Surely as the geometry gets<br>
> <br>
<br>
> > bigger it should get nearer to the point?<br>
> <br>
<br>
> ><br>
> <br>
<br>
> > Thank you very much!</blockquote></div>