<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">As I understand it, ST_Overlaps() will return true for features of the same type which partially overlap. Where one contains another entirely (ie: ST_Contains() = true) ST_Overlaps() will return false.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Should you be using ST_Intersects() instead of ST_Overlaps()?</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times
 new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">See the descriptions of the different spatial relationships here:</div><div class="yui_3_7_2_169_1378812973096_89" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><a href="http://workshops.opengeo.org/postgis-intro/spatial_relationships.html">http://workshops.opengeo.org/postgis-intro/spatial_relationships.html</a></div><div class="yui_3_7_2_169_1378812973096_89" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new
 york,times,serif; background-color: transparent; font-style: normal;">Brent Wood<br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span></span></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Jean Marchal <jean.d.marchal@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> PostGIS Users Discussion <postgis-users@lists.osgeo.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, September 11, 2013 10:56 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [postgis-users] ST_Overlaps broken ?<br> </font> </div> <div
 class="y_msg_container"><br><div id="yiv7491968247"><div dir="ltr"><div>Dear PostGIS users,<br></div><div><br>SELECT ST_Overlaps(ST_GeomFromText('POLYGON ((<br>        -308992.78000114113 515108.0599712543,<br>        -308991.140001066 515102.94997100905,<br>        -308984.80000076443 515093.52997056395,<br>


        -308976.3200003579 515071.97996953875,<br>        -308965.42999984324 515056.24996879324,<br>        -308955.59999937564 515039.59996800125,<br>        -308945.3999988958 515013.9399667829,<br>        -308940.1299986392 515003.59996629134,<br>


        -308938.5599985644 514997.499966003,<br>        -308924.9999979213 514962.6199643463,<br>        -308921.439997755 514956.3899640478,<br>        -308910.2799972221 514944.63996349275,<br>        -308901.2699967995 514945.0099635087,<br>


        -308891.5399963334 514941.33996333554,<br>        -308873.2199954614 514932.08996289596,<br>        -308858.2199947536 514918.0699622296,<br>        -308844.9299941212 514908.16996175796,<br>        -308839.5499938652 514913.7899620272,<br>


        -308834.6499936357 514912.4499619603,<br>        -308829.0399933681 514907.06996170804,<br>        -308827.3899932876 514901.95996146277,<br>        -308828.86999335885 514895.079961136,<br>        -308828.7699933499 514882.09996052086,<br>


        -308820.27999295294 514860.54995949566,<br>        -308817.84999283403 514852.3899591081,<br>        -308806.34999229014 514816.65995741263,<br>        -308803.40999215096 514801.48995669186,<br>        -308797.2499918565 514775.1099554375,<br>


        -308797.5999918729 514770.139955204,<br>        -308795.6499917805 514755.0299544856,<br>        -308796.6799918264 514740.12995377555,<br>        -308796.6499918252 514726.15995311365,<br>        -308791.9299916029 514707.8599522449,<br>


        -308790.5599915385 514698.7899518125,<br>        -308791.0399915576 514691.82995148376,<br>        -308789.53999149054 514684.7399511449,<br>        -308790.7099915445 514667.84995034337,<br>        -308788.3499914333 514658.7100499086,<br>


        -308791.01999156177 514648.9100494459,<br>        -308791.43999157846 514642.9500491619,<br>        -308795.169991754 514632.23004865274,<br>        -308807.05999232084 514619.0800480284,<br>        -308814.4999926761 514612.6100477204,<br>


        -308818.9499928877 514605.930047404,<br>        -308827.3799932897 514599.53004710004,<br>        -308836.2899937108 514586.1700464636,<br>        -308845.5799941495 514581.8200462572,<br>        -308857.39999471605 514569.6700456813,<br>


        -308877.12999565154 514573.0300458409,<br>        -308896.719996579 514578.3800460957,<br>        -308913.9799974039 514588.5600465797,<br>        -308918.66999762505 514592.8800467849,<br>        -308930.2199981734 514584.6900463961,<br>


        -308937.2399985045 514584.1800463684,<br>        -308943.12999878824 514585.5900464356,<br>        -308947.759999007 514590.9000466876,<br>        -308950.3199991286 514597.060046982,<br>        -308986.2200008333 514597.5600470044,<br>


        -308995.6100012809 514606.19004741684,<br>        -309028.27000282705 514653.37004965544,<br>        -309042.7600035146 514660.3600499891,<br>        -309043.7500035614 514660.4300499931,<br>        -309048.1700037718 514668.7199503854,<br>


        -309049.60000383854 514705.7499521449,<br>        -309059.2800043002 514724.3899530284,<br>        -309071.1000048667 514741.17995382845,<br>        -309086.95000561327 514757.2499545887,<br>        -309096.71000608057 514774.8899554275,<br>


        -309113.04000685364 514812.94995723665,<br>        -309121.7300072685 514831.51995811984,<br>        -309121.28000724316 514852.44995911047,<br>        -309122.88000731915 514872.5299600661,<br>        -309128.4600075856 514892.8799610324,<br>


        -309127.0200075209 514913.73996202275,<br>        -309121.6700072661 514933.3299629539,<br>        -309109.4300066829 514951.4499638155,<br>        -309095.42000602186 514966.4399645254,<br>        -309083.1800054386 514984.559965387,<br>


        -309081.1200053394 515014.35996680334,<br>        -309068.7200047523 515020.4899670929,<br>        -309068.30000472814 515026.4499673769,<br>        -309067.0300046727 515030.3599675633,<br>        -309054.87000409514 515047.47996837646,<br>


        -309043.9700035751 515060.69996900484,<br>        -309041.57000345737 515066.5199692808,<br>        -309032.730003044 515078.8799698688,<br>        -309016.76000228524 515107.71997123584,<br>        -309009.46000193805 515112.20997145027,<br>


        -309004.43000169843 515112.8599714823,<br>        -309000.450001508 515112.5799714662,<br>        -308992.78000114113 515108.0599712543<br>    ))'), ST_Geomfromtext('POLYGON ((<br>        -308992.78000114113 515108.0599712543,<br>


        -308991.140001066 515102.94997100905,<br>        -308984.80000076443 515093.52997056395,<br>        -308976.3200003579 515071.97996953875,<br>        -308965.42999984324 515056.24996879324,<br>        -308955.59999937564 515039.59996800125,<br>


        -308945.3999988958 515013.9399667829,<br>        -308940.1299986392 515003.59996629134,<br>        -308938.5599985644 514997.499966003,<br>        -308924.9999979213 514962.6199643463,<br>        -308921.439997755 514956.3899640478,<br>


        -308910.2799972221 514944.63996349275,<br>        -308901.2699967995 514945.0099635087,<br>        -308891.5399963334 514941.33996333554,<br>        -308873.2199954614 514932.08996289596,<br>        -308858.2199947536 514918.0699622296,<br>


        -308844.9299941212 514908.16996175796,<br>        -308839.5499938652 514913.7899620272,<br>        -308834.6499936357 514912.4499619603,<br>        -308829.0399933681 514907.06996170804,<br>        -308827.3899932876 514901.95996146277,<br>


        -308828.86999335885 514895.079961136,<br>        -308828.7699933499 514882.09996052086,<br>        -308820.27999295294 514860.54995949566,<br>        -308817.84999283403 514852.3899591081,<br>        -308806.34999229014 514816.65995741263,<br>


        -308803.40999215096 514801.48995669186,<br>        -308797.2499918565 514775.1099554375,<br>        -308797.5999918729 514770.139955204,<br>        -308795.6499917805 514755.0299544856,<br>        -308796.6799918264 514740.12995377555,<br>


        -308796.6499918252 514726.15995311365,<br>        -308791.9299916029 514707.8599522449,<br>        -308790.5599915385 514698.7899518125,<br>        -308791.0399915576 514691.82995148376,<br>        -308789.53999149054 514684.7399511449,<br>


        -308790.7099915445 514667.84995034337,<br>        -308788.3499914333 514658.7100499086,<br>        -308791.01999156177 514648.9100494459,<br>        -308791.43999157846 514642.9500491619,<br>        -308795.169991754 514632.23004865274,<br>


        -308807.05999232084 514619.0800480284,<br>        -308814.4999926761 514612.6100477204,<br>        -308818.9499928877 514605.930047404,<br>        -308827.3799932897 514599.53004710004,<br>        -308836.2899937108 514586.1700464636,<br>


        -308845.5799941495 514581.8200462572,<br>        -308857.39999471605 514569.6700456813,<br>        -308877.12999565154 514573.0300458409,<br>        -308896.719996579 514578.3800460957,<br>        -308913.9799974039 514588.5600465797,<br>


        -308918.66999762505 514592.8800467849,<br>        -308930.2199981734 514584.6900463961,<br>        -308937.2399985045 514584.1800463684,<br>        -308943.12999878824 514585.5900464356,<br>        -308947.759999007 514590.9000466876,<br>


        -308950.3199991286 514597.060046982,<br>        -308986.2200008333 514597.5600470044,<br>        -308995.6100012809 514606.19004741684,<br>        -309028.27000282705 514653.37004965544,<br>        -309042.7600035146 514660.3600499891,<br>


        -309043.7500035614 514660.4300499931,<br>        -309048.1700037718 514668.7199503854,<br>        -309049.60000383854 514705.7499521449,<br>        -309059.2800043002 514724.3899530284,<br>        -309071.1000048667 514741.17995382845,<br>


        -309086.95000561327 514757.2499545887,<br>        -309096.71000608057 514774.8899554275,<br>        -309113.04000685364 514812.94995723665,<br>        -309121.7200072706 514831.51995811984,<br>        -309121.28000724316 514852.44995911047,<br>


        -309122.88000731915 514872.5299600661,<br>        -309128.4600075856 514892.8799610324,<br>        -309127.0200075209 514913.73996202275,<br>        -309121.6700072661 514933.3299629539,<br>        -309109.4300066829 514951.4499638155,<br>


        -309095.42000602186 514966.4399645254,<br>        -309083.1800054386 514984.559965387,<br>        -309081.1200053394 515014.35996680334,<br>        -309068.7200047523 515020.4899670929,<br>        -309068.30000472814 515026.4499673769,<br>


        -309067.0300046727 515030.3599675633,<br>        -309054.87000409514 515047.47996837646,<br>        -309043.9700035751 515060.69996900484,<br>        -309041.57000345737 515066.5199692808,<br>        -309032.730003044 515078.8799698688,<br>


        -309016.76000228524 515107.71997123584,<br>        -309009.46000193805 515112.20997145027,<br>        -309004.43000169843 515112.8599714823,<br>        -309000.450001508 515112.5799714662,<br>        -308992.78000114113 515108.0599712543<br>


    ))'))<br><br>Returns FALSE instead of TRUE, same thing for hundreds of polygons. Is it just me or everyone get same result ?<br><br></div><div>I tried with postgis 2.1 and 2.1.1dev<br><br></div><div>My guess is it's not only ST_Overlaps() but some underlying function called by ST_Overlaps()<br>

<br></div><div>Thanks,<br><br></div><div>Jean<br></div></div></div><br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@lists.osgeo.org" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br><br></div> </div> </div>  </div></body></html>