[postgis-users] ST_Overlaps broken ?

Brent Wood pcreso at pcreso.com
Tue Sep 10 16:37:21 PDT 2013



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.

Should you be using ST_Intersects() instead of ST_Overlaps()?

See the descriptions of the different spatial relationships here:
http://workshops.opengeo.org/postgis-intro/spatial_relationships.html

Brent Wood




________________________________
 From: Jean Marchal <jean.d.marchal at gmail.com>
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org> 
Sent: Wednesday, September 11, 2013 10:56 AM
Subject: [postgis-users] ST_Overlaps broken ?
 


Dear PostGIS users,


SELECT ST_Overlaps(ST_GeomFromText('POLYGON ((
        -308992.78000114113 515108.0599712543,
        -308991.140001066 515102.94997100905,
        -308984.80000076443 515093.52997056395,
        -308976.3200003579 515071.97996953875,
        -308965.42999984324 515056.24996879324,
        -308955.59999937564 515039.59996800125,
        -308945.3999988958 515013.9399667829,
        -308940.1299986392 515003.59996629134,
        -308938.5599985644 514997.499966003,
        -308924.9999979213 514962.6199643463,
        -308921.439997755 514956.3899640478,
        -308910.2799972221 514944.63996349275,
        -308901.2699967995 514945.0099635087,
        -308891.5399963334 514941.33996333554,
        -308873.2199954614 514932.08996289596,
        -308858.2199947536 514918.0699622296,
        -308844.9299941212 514908.16996175796,
        -308839.5499938652 514913.7899620272,
        -308834.6499936357 514912.4499619603,
        -308829.0399933681 514907.06996170804,
        -308827.3899932876 514901.95996146277,
        -308828.86999335885 514895.079961136,
        -308828.7699933499 514882.09996052086,
        -308820.27999295294 514860.54995949566,
        -308817.84999283403 514852.3899591081,
        -308806.34999229014 514816.65995741263,
        -308803.40999215096 514801.48995669186,
        -308797.2499918565 514775.1099554375,
        -308797.5999918729 514770.139955204,
        -308795.6499917805 514755.0299544856,
        -308796.6799918264 514740.12995377555,
        -308796.6499918252 514726.15995311365,
        -308791.9299916029 514707.8599522449,
        -308790.5599915385 514698.7899518125,
        -308791.0399915576 514691.82995148376,
        -308789.53999149054 514684.7399511449,
        -308790.7099915445 514667.84995034337,
        -308788.3499914333 514658.7100499086,
        -308791.01999156177 514648.9100494459,
        -308791.43999157846 514642.9500491619,
        -308795.169991754 514632.23004865274,
        -308807.05999232084 514619.0800480284,
        -308814.4999926761 514612.6100477204,
        -308818.9499928877 514605.930047404,
        -308827.3799932897 514599.53004710004,
        -308836.2899937108 514586.1700464636,
        -308845.5799941495 514581.8200462572,
        -308857.39999471605 514569.6700456813,
        -308877.12999565154 514573.0300458409,
        -308896.719996579 514578.3800460957,
        -308913.9799974039 514588.5600465797,
        -308918.66999762505 514592.8800467849,
        -308930.2199981734 514584.6900463961,
        -308937.2399985045 514584.1800463684,
        -308943.12999878824 514585.5900464356,
        -308947.759999007 514590.9000466876,
        -308950.3199991286 514597.060046982,
        -308986.2200008333 514597.5600470044,
        -308995.6100012809 514606.19004741684,
        -309028.27000282705 514653.37004965544,
        -309042.7600035146 514660.3600499891,
        -309043.7500035614 514660.4300499931,
        -309048.1700037718 514668.7199503854,
        -309049.60000383854 514705.7499521449,
        -309059.2800043002 514724.3899530284,
        -309071.1000048667 514741.17995382845,
        -309086.95000561327 514757.2499545887,
        -309096.71000608057 514774.8899554275,
        -309113.04000685364 514812.94995723665,
        -309121.7300072685 514831.51995811984,
        -309121.28000724316 514852.44995911047,
        -309122.88000731915 514872.5299600661,
        -309128.4600075856 514892.8799610324,
        -309127.0200075209 514913.73996202275,
        -309121.6700072661 514933.3299629539,
        -309109.4300066829 514951.4499638155,
        -309095.42000602186 514966.4399645254,
        -309083.1800054386 514984.559965387,
        -309081.1200053394 515014.35996680334,
        -309068.7200047523 515020.4899670929,
        -309068.30000472814 515026.4499673769,
        -309067.0300046727 515030.3599675633,
        -309054.87000409514 515047.47996837646,
        -309043.9700035751 515060.69996900484,
        -309041.57000345737 515066.5199692808,
        -309032.730003044 515078.8799698688,
        -309016.76000228524 515107.71997123584,
        -309009.46000193805 515112.20997145027,
        -309004.43000169843 515112.8599714823,
        -309000.450001508 515112.5799714662,
        -308992.78000114113 515108.0599712543
    ))'), ST_Geomfromtext('POLYGON ((
        -308992.78000114113 515108.0599712543,
        -308991.140001066 515102.94997100905,
        -308984.80000076443 515093.52997056395,
        -308976.3200003579 515071.97996953875,
        -308965.42999984324 515056.24996879324,
        -308955.59999937564 515039.59996800125,
        -308945.3999988958 515013.9399667829,
        -308940.1299986392 515003.59996629134,
        -308938.5599985644 514997.499966003,
        -308924.9999979213 514962.6199643463,
        -308921.439997755 514956.3899640478,
        -308910.2799972221 514944.63996349275,
        -308901.2699967995 514945.0099635087,
        -308891.5399963334 514941.33996333554,
        -308873.2199954614 514932.08996289596,
        -308858.2199947536 514918.0699622296,
        -308844.9299941212 514908.16996175796,
        -308839.5499938652 514913.7899620272,
        -308834.6499936357 514912.4499619603,
        -308829.0399933681 514907.06996170804,
        -308827.3899932876 514901.95996146277,
        -308828.86999335885 514895.079961136,
        -308828.7699933499 514882.09996052086,
        -308820.27999295294 514860.54995949566,
        -308817.84999283403 514852.3899591081,
        -308806.34999229014 514816.65995741263,
        -308803.40999215096 514801.48995669186,
        -308797.2499918565 514775.1099554375,
        -308797.5999918729 514770.139955204,
        -308795.6499917805 514755.0299544856,
        -308796.6799918264 514740.12995377555,
        -308796.6499918252 514726.15995311365,
        -308791.9299916029 514707.8599522449,
        -308790.5599915385 514698.7899518125,
        -308791.0399915576 514691.82995148376,
        -308789.53999149054 514684.7399511449,
        -308790.7099915445 514667.84995034337,
        -308788.3499914333 514658.7100499086,
        -308791.01999156177 514648.9100494459,
        -308791.43999157846 514642.9500491619,
        -308795.169991754 514632.23004865274,
        -308807.05999232084 514619.0800480284,
        -308814.4999926761 514612.6100477204,
        -308818.9499928877 514605.930047404,
        -308827.3799932897 514599.53004710004,
        -308836.2899937108 514586.1700464636,
        -308845.5799941495 514581.8200462572,
        -308857.39999471605 514569.6700456813,
        -308877.12999565154 514573.0300458409,
        -308896.719996579 514578.3800460957,
        -308913.9799974039 514588.5600465797,
        -308918.66999762505 514592.8800467849,
        -308930.2199981734 514584.6900463961,
        -308937.2399985045 514584.1800463684,
        -308943.12999878824 514585.5900464356,
        -308947.759999007 514590.9000466876,
        -308950.3199991286 514597.060046982,
        -308986.2200008333 514597.5600470044,
        -308995.6100012809 514606.19004741684,
        -309028.27000282705 514653.37004965544,
        -309042.7600035146 514660.3600499891,
        -309043.7500035614 514660.4300499931,
        -309048.1700037718 514668.7199503854,
        -309049.60000383854 514705.7499521449,
        -309059.2800043002 514724.3899530284,
        -309071.1000048667 514741.17995382845,
        -309086.95000561327 514757.2499545887,
        -309096.71000608057 514774.8899554275,
        -309113.04000685364 514812.94995723665,
        -309121.7200072706 514831.51995811984,
        -309121.28000724316 514852.44995911047,
        -309122.88000731915 514872.5299600661,
        -309128.4600075856 514892.8799610324,
        -309127.0200075209 514913.73996202275,
        -309121.6700072661 514933.3299629539,
        -309109.4300066829 514951.4499638155,
        -309095.42000602186 514966.4399645254,
        -309083.1800054386 514984.559965387,
        -309081.1200053394 515014.35996680334,
        -309068.7200047523 515020.4899670929,
        -309068.30000472814 515026.4499673769,
        -309067.0300046727 515030.3599675633,
        -309054.87000409514 515047.47996837646,
        -309043.9700035751 515060.69996900484,
        -309041.57000345737 515066.5199692808,
        -309032.730003044 515078.8799698688,
        -309016.76000228524 515107.71997123584,
        -309009.46000193805 515112.20997145027,
        -309004.43000169843 515112.8599714823,
        -309000.450001508 515112.5799714662,
        -308992.78000114113 515108.0599712543
    ))'))

Returns FALSE instead of TRUE, same thing for hundreds of polygons. Is it just me or everyone get same result ?


I tried with postgis 2.1 and 2.1.1dev


My guess is it's not only ST_Overlaps() but some underlying function called by ST_Overlaps()


Thanks,


Jean

_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130910/85e510ea/attachment.html>


More information about the postgis-users mailing list