<div dir="ltr"><div>Dear PostGIS users,</div><div><br></div>I am running a simple point-in-polygon analysis on Orange County flood zone polygons.  I noticed that I'm getting some false positives when running ST_Intersects on geography in the where clause.  <div><br></div><div>My postgis_full_version is:</div><div>POSTGIS-"2.4.3 R16312" PGSQL=100 GEOS="3.6.2-CAPI-1.10.2 4d2925d" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.3, released 2017/11/20 GDAL_DATA not found" LIBXML="2.7.8" LIBJSON="0.12" LIBROTOBUF="1.2.1" RASTER</div><div><br></div><div>The following query should return one flood zone, but instead it's returning two:</div><div><font face="monospace">SELECT gid, fld_zone, ST_Intersects(geog_nad83, 'SRID=4269;POINT(-117.876941 33.644253)'::geography)<br>FROM nfhl.orange_county_s_fld_haz_ar<br>WHERE ST_Intersects(geog_nad83, 'SRID=4269;POINT(-117.876941 33.644253)'::geography);</font><br></div><div><br></div><div>It's selecting the polygon the point intersects with, and also the adjacent polygon.</div><div>Here's a visual of the two polygons together with the test point:</div><div><br></div><div><img src="cid:ii_ljkltz770" alt="Screen Shot 2023-07-01 at 3.58.08 PM.png" width="542" height="205"><br></div><div><br></div><div>If I remove the where clause and query ST_Intersects for the adjacent polygon, the result is correctly FALSE:</div><div><div><font face="monospace">SELECT gid, fld_zone, ST_Intersects(geog_nad83, 'SRID=4269;POINT(-117.876941 33.644253)'::geography)<br>FROM nfhl.orange_county_s_fld_haz_ar<br>WHERE gid = 224482;</font></div></div><div><font face="monospace"><br></font></div><div>To test further, I generated 1000 points on a 200 meter buffer around the test point.  The results can be seen in the following visual.  Some points return only the polygon they intersect with (grey, green) but others return an additional adjacent polygon (blue, red):</div><div><br></div><img src="cid:ii_ljkm1m111" alt="Screen Shot 2023-07-01 at 4.04.04 PM.png" width="542" height="264"><br><div> <br></div><div>Also, I should note that running the same query on geometry does not introduce any errors.  We'd like to stick with using geography if possible and were a bit surprised with these false positives.</div><div><br></div><div>Does anyone know what's going on?  Does it have to do with the earlier PostGIS version?  We are planning an upgrade to the latest version, but our API is stuck for now with the version I posted above.  </div><div><br></div><div>Any insight as to why the false positives are occurring would be appreciated!</div><div><br></div><div>Thanks,</div><div>Claire</div></div>