SDO_GEOM.RELATE结果不正确

时间:2017-08-15 12:01:47

标签: oracle oracle-spatial

我想确定两个多边形之间的关系。他们几乎是平等的,但是oracle将这种关系确定为" TOUCH"

select SDO_GEOM.RELATE (
MDSYS.SDO_GEOMETRY(2003,25832,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,197,2003,1),MDSYS.SDO_ORDINATE_ARRAY(374119.43424706,5691944.80315028,374122.56159561,5691942.35776406,374125.07036344,5691939.84899623,374125.6278674,5691939.57024425,374136.1929,5691929.95,374126.74287533,5691918.94259766,374123.7908,5691919.3093,374120.83482781,5691914.30907697,374137.39360515,5691894.33055213,374144.35862375,5691897.41123343,374184.73010996,5691918.44877131,374178.5571,5691928.4882,374193.0645,5691937.4126,374203.6583,5691943.778,374207.76840888,5691947.06665824,374207.8497,5691953.1253,374206.20370687,5691961.70609861,374201.4204,5691986.3921,374197.2671265,5692000.33817609,374196.52293214,5692003.61939276,374190.5211,5692028.0781,374186.8797,5692037.6394,374182.61070422,5692050.1790179,374181.89211667,5692052.69407434,374175.69429903,5692070.47911627,374171.47259715,5692080.89863579,374162.49025274,5692095.98897439,374152.1525154,5692109.0546975,374127.197,5692126.3677,374120.27636327,5692131.38310293,374108.8928,5692139.6328,374097.09878544,5692131.02011759,374090.76457677,5692127.60988405,374086.32383809,5692125.21906354,374074.95934331,5692117.35133638,374068.20495934,5692112.67522439,374059.81117092,5692106.94549012,374054.0060377,5692102.681321,374049.24982463,5692099.01637733,374036.28831379,5692081.88669367,374029.91084926,5692072.3654086,374018.47857381,5692057.2113746,374005.212338585,5692038.71428125,373996.87175187,5692045.21896561,373996.30696508,5692049.163621,373988.90696508,5692054.163621,373972.30696508,5692032.963621,373964.50696508,5692021.763621,373956.30696508,5692010.163621,373944.90696508,5691998.763621,373932.50696508,5691987.163621,373921.30696508,5691975.963621,373900.086080328,5691954.83317774,373892.43,5691960.33,373876.72,5691933.43,373845.50696508,5691919.563621,373828.50696508,5691901.763621,373800.30696508,5691873.563621,373789.10696508,5691861.163621,373801.992436666,5691849.15142511,373756.70696508,5691803.963621,373735.10696508,5691781.163621,373718.70696508,5691764.163621,373704.90696508,5691748.963621,373713.30696508,5691739.563621,373725.61877479,5691729.9487546,373744.1508009,5691750.4148284,373774.01302383,5691782.0868812,373807.60210366,5691813.6839065,373831.81451845,5691837.682647,373853.7996963,5691858.39944878,373902.67941274,5691904.45918063,373922.98478297,5691923.5930868,373961.28732974,5691965.43010412,373986.1373196,5691992.57319366,374027.89090222,5692038.17970046,374043.46520697,5692055.19116608,374064.30270376,5692043.73054285,374068.64153567,5692041.3441853,374111.8750999,5692084.5659021,374118.00007278,5692080.6143047,374123.72989196,5692076.2675461,374130.44761047,5692071.1304726,374133.58868439,5692068.63372068,374138.15322833,5692065.0054922,374140.03229695,5692062.93010266,374144.77215088,5692057.6950393,374152.35208147,5692047.24340754,374155.98479933,5692042.2344132,374158.18891274,5692036.20983738,374161.91219536,5692026.0328663,374152.64292952,5692013.41663374,374138.05718211,5691993.56423284,374126.85729247,5691978.32026263,374119.54566412,5691965.47551012,374118.81594799,5691964.33851056,374111.04836631,5691952.23553446,374119.43424706,5691944.80315028,374145.1616,5691963.034,374157.9885,5691964.1404,374153.0214,5691949.1144,374140.9722,5691953.6877,374145.1616,5691963.034))
, 'determine', 
MDSYS.SDO_GEOMETRY(2003,25832,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,203,2003,1),MDSYS.SDO_ORDINATE_ARRAY(374043.465206972,5692055.19116608,374068.641535671,5692041.3441853,374111.8750999,5692084.5659021,374118.00007278,5692080.6143047,374123.72989196,5692076.2675461,374130.44761047,5692071.1304726,374133.588684394,5692068.63372068,374138.15322833,5692065.0054922,374144.77215088,5692057.6950393,374152.352081467,5692047.24340754,374155.98479933,5692042.2344132,374158.188912742,5692036.20983738,374161.91219536,5692026.0328663,374126.857292471,5691978.32026263,374119.545664122,5691965.47551012,374111.04836631,5691952.23553446,374110.6621255,5691951.55287628,374111.475518872,5691951.02636587,374122.561595614,5691942.35776406,374125.070363442,5691939.84899623,374125.627867404,5691939.57024425,374136.1929,5691929.95,374126.742875328,5691918.94259766,374123.7908,5691919.3093,374120.834827807,5691914.30907697,374137.393605153,5691894.33055213,374146.752914089,5691898.47024646,374184.73010996,5691918.44877131,374178.5571,5691928.4882,374193.0645,5691937.4126,374203.6583,5691943.778,374207.768408877,5691947.06665824,374207.8497,5691953.1253,374203.5906,5691975.3286,374202.7846,5691980.152,374201.4204,5691986.3921,374197.2671265,5692000.33817609,374194.449392315,5692012.7618075,374190.5211,5692028.0781,374186.8797,5692037.6394,374182.610704222,5692050.1790179,374181.892116669,5692052.69407434,374175.694299027,5692070.47911627,374171.472597154,5692080.89863579,374165.4544264,5692091.22833186,374162.490252744,5692095.98897439,374152.152515397,5692109.0546975,374127.197,5692126.3677,374108.8928,5692139.6328,374097.098785442,5692131.02011759,374086.323838095,5692125.21906354,374068.204959335,5692112.67522439,374057.4343,5692105.323,374049.249824632,5692099.01637733,374036.288313788,5692081.88669367,374029.910849257,5692072.3654086,374022.2691,5692062.4965,374004.871025728,5692038.81214604,374003.683827056,5692039.8297449,373996.899834639,5692045.34173874,373996.136635492,5692049.24253438,373988.928643549,5692054.24572879,373972.318502371,5692033.04574923,373965.288134667,5692022.85754718,373956.026280328,5692009.98017827,373944.541676103,5691998.51343684,373937.016587809,5691991.34811373,373931.350286264,5691986.07155779,373924.754591345,5691979.50584331,373918.848446349,5691973.53973745,373900.050715829,5691954.83194822,373890.666840785,5691964.06592111,373849.937585098,5691924.40126746,373831.349004547,5691904.97320263,373805.564844428,5691878.82926353,373789.134937747,5691861.32001991,373801.487349339,5691848.96760832,373759.633061517,5691806.87346785,373733.009417114,5691779.53026549,373704.815450301,5691748.92374358,373713.083282479,5691739.59593292,373725.618774786,5691729.9487546,373748.954436917,5691755.50959358,373774.01302383,5691782.0868812,373798.149147215,5691804.49899316,373802.51787652,5691808.5556699,373807.60210366,5691813.6839065,373831.81451845,5691837.682647,373842.458795054,5691847.71283052,373865.216245828,5691869.157351,373888.862942235,5691891.43981446,373922.98478297,5691923.5930868,373935.147043721,5691936.87765288,373966.632992237,5691971.26905201,373979.962420575,5691985.82848921,373990.042422418,5691996.83865034,373998.422113111,5692005.99159954,374007.658279099,5692016.0800576,374016.018029933,5692025.21122693,374031.723718158,5692042.3661998,374043.465206972,5692055.19116608,374145.1616,5691963.034,374157.9885,5691964.1404,374153.0214,5691949.1144,374140.9722,5691953.6877,374145.1616,5691963.034))
, 0.0000005) from dual;

3 个答案:

答案 0 :(得分:0)

我建议使用JTS Topology Suite,这是一个基于开源java的几何工具。使用SDO_UTIL.TO_WKTGEOMETRY,您可以复制/粘贴到JTS的结果:

enter image description here

POLYGON ((374119.43424706 5691944.80315028, 374122.56159561 5691942.35776406, 374125.07036344 5691939.84899623, 374125.6278674 5691939.57024425, 374136.1929 5691929.95, 374126.74287533 5691918.94259766, 374123.7908 5691919.3093, 374120.83482781 5691914.30907697, 374137.39360515 5691894.33055213, 374144.35862375 5691897.41123343, 374184.73010996 5691918.44877131, 374178.5571 5691928.4882, 374193.0645 5691937.4126, 374203.6583 5691943.778, 374207.76840888 5691947.06665824, 374207.8497 5691953.1253, 374206.20370687 5691961.70609861, 374201.4204 5691986.3921, 374197.2671265 5692000.33817609, 374196.52293214 5692003.61939276, 374190.5211 5692028.0781, 374186.8797 5692037.6394, 374182.61070422 5692050.1790179, 374181.89211667 5692052.69407434, 374175.69429903 5692070.47911627, 374171.47259715 5692080.89863579, 374162.49025274 5692095.98897439, 374152.1525154 5692109.0546975, 374127.197 5692126.3677, 374120.27636327 5692131.38310293, 374108.8928 5692139.6328, 374097.09878544 5692131.02011759, 374090.76457677 5692127.60988405, 374086.32383809 5692125.21906354, 374074.95934331 5692117.35133638, 374068.20495934 5692112.67522439, 374059.81117092 5692106.94549012, 374054.0060377 5692102.681321, 374049.24982463 5692099.01637733, 374036.28831379 5692081.88669367, 374029.91084926 5692072.3654086, 374018.47857381 5692057.2113746, 374005.212338585 5692038.71428125, 373996.87175187 5692045.21896561, 373996.30696508 5692049.163621, 373988.90696508 5692054.163621, 373972.30696508 5692032.963621, 373964.50696508 5692021.763621, 373956.30696508 5692010.163621, 373944.90696508 5691998.763621, 373932.50696508 5691987.163621, 373921.30696508 5691975.963621, 373900.086080328 5691954.83317774, 373892.43 5691960.33, 373876.72 5691933.43, 373845.50696508 5691919.563621, 373828.50696508 5691901.763621, 373800.30696508 5691873.563621, 373789.10696508 5691861.163621, 373801.992436666 5691849.15142511, 373756.70696508 5691803.963621, 373735.10696508 5691781.163621, 373718.70696508 5691764.163621, 373704.90696508 5691748.963621, 373713.30696508 5691739.563621, 373725.61877479 5691729.9487546, 373744.1508009 5691750.4148284, 373774.01302383 5691782.0868812, 373807.60210366 5691813.6839065, 373831.81451845 5691837.682647, 373853.7996963 5691858.39944878, 373902.67941274 5691904.45918063, 373922.98478297 5691923.5930868, 373961.28732974 5691965.43010412, 373986.1373196 5691992.57319366, 374027.89090222 5692038.17970046, 374043.46520697 5692055.19116608, 374064.30270376 5692043.73054285, 374068.64153567 5692041.3441853, 374111.8750999 5692084.5659021, 374118.00007278 5692080.6143047, 374123.72989196 5692076.2675461, 374130.44761047 5692071.1304726, 374133.58868439 5692068.63372068, 374138.15322833 5692065.0054922, 374140.03229695 5692062.93010266, 374144.77215088 5692057.6950393, 374152.35208147 5692047.24340754, 374155.98479933 5692042.2344132, 374158.18891274 5692036.20983738, 374161.91219536 5692026.0328663, 374152.64292952 5692013.41663374, 374138.05718211 5691993.56423284, 374126.85729247 5691978.32026263, 374119.54566412 5691965.47551012, 374118.81594799 5691964.33851056, 374111.04836631 5691952.23553446, 374119.43424706 5691944.80315028), (374145.1616 5691963.034, 374157.9885 5691964.1404, 374153.0214 5691949.1144, 374140.9722 5691953.6877, 374145.1616 5691963.034)) 
POLYGON ((374043.465206972 5692055.19116608, 374068.641535671 5692041.3441853, 374111.8750999 5692084.5659021, 374118.00007278 5692080.6143047, 374123.72989196 5692076.2675461, 374130.44761047 5692071.1304726, 374133.588684394 5692068.63372068, 374138.15322833 5692065.0054922, 374144.77215088 5692057.6950393, 374152.352081467 5692047.24340754, 374155.98479933 5692042.2344132, 374158.188912742 5692036.20983738, 374161.91219536 5692026.0328663, 374126.857292471 5691978.32026263, 374119.545664122 5691965.47551012, 374111.04836631 5691952.23553446, 374110.6621255 5691951.55287628, 374111.475518872 5691951.02636587, 374122.561595614 5691942.35776406, 374125.070363442 5691939.84899623, 374125.627867404 5691939.57024425, 374136.1929 5691929.95, 374126.742875328 5691918.94259766, 374123.7908 5691919.3093, 374120.834827807 5691914.30907697, 374137.393605153 5691894.33055213, 374146.752914089 5691898.47024646, 374184.73010996 5691918.44877131, 374178.5571 5691928.4882, 374193.0645 5691937.4126, 374203.6583 5691943.778, 374207.768408877 5691947.06665824, 374207.8497 5691953.1253, 374203.5906 5691975.3286, 374202.7846 5691980.152, 374201.4204 5691986.3921, 374197.2671265 5692000.33817609, 374194.449392315 5692012.7618075, 374190.5211 5692028.0781, 374186.8797 5692037.6394, 374182.610704222 5692050.1790179, 374181.892116669 5692052.69407434, 374175.694299027 5692070.47911627, 374171.472597154 5692080.89863579, 374165.4544264 5692091.22833186, 374162.490252744 5692095.98897439, 374152.152515397 5692109.0546975, 374127.197 5692126.3677, 374108.8928 5692139.6328, 374097.098785442 5692131.02011759, 374086.323838095 5692125.21906354, 374068.204959335 5692112.67522439, 374057.4343 5692105.323, 374049.249824632 5692099.01637733, 374036.288313788 5692081.88669367, 374029.910849257 5692072.3654086, 374022.2691 5692062.4965, 374004.871025728 5692038.81214604, 374003.683827056 5692039.8297449, 373996.899834639 5692045.34173874, 373996.136635492 5692049.24253438, 373988.928643549 5692054.24572879, 373972.318502371 5692033.04574923, 373965.288134667 5692022.85754718, 373956.026280328 5692009.98017827, 373944.541676103 5691998.51343684, 373937.016587809 5691991.34811373, 373931.350286264 5691986.07155779, 373924.754591345 5691979.50584331, 373918.848446349 5691973.53973745, 373900.050715829 5691954.83194822, 373890.666840785 5691964.06592111, 373849.937585098 5691924.40126746, 373831.349004547 5691904.97320263, 373805.564844428 5691878.82926353, 373789.134937747 5691861.32001991, 373801.487349339 5691848.96760832, 373759.633061517 5691806.87346785, 373733.009417114 5691779.53026549, 373704.815450301 5691748.92374358, 373713.083282479 5691739.59593292, 373725.618774786 5691729.9487546, 373748.954436917 5691755.50959358, 373774.01302383 5691782.0868812, 373798.149147215 5691804.49899316, 373802.51787652 5691808.5556699, 373807.60210366 5691813.6839065, 373831.81451845 5691837.682647, 373842.458795054 5691847.71283052, 373865.216245828 5691869.157351, 373888.862942235 5691891.43981446, 373922.98478297 5691923.5930868, 373935.147043721 5691936.87765288, 373966.632992237 5691971.26905201, 373979.962420575 5691985.82848921, 373990.042422418 5691996.83865034, 373998.422113111 5692005.99159954, 374007.658279099 5692016.0800576, 374016.018029933 5692025.21122693, 374031.723718158 5692042.3661998, 374043.465206972 5692055.19116608), (374145.1616 5691963.034, 374157.9885 5691964.1404, 374153.0214 5691949.1144, 374140.9722 5691953.6877, 374145.1616 5691963.034))

我不是专家,TOUCHES意味着"两种几何形状共有的点都不会与两种几何形状的内部相交。"检查图片时,您会看到一个点内部是另一个多边形(用红色圆圈标记)

答案 1 :(得分:0)

什么版本的Oracle?

我尝试使用Oracle 12.2进行测试用例。我得到所有公差的OVERLAPBDYINTERSECT,除了0.5,我得到COVEREDBY。

我没有接受任何宽容。肯定TOUCH是不正确的。如果你确实得到了TOUCH,那么这将是一个需要查看的错误 - 除非你在旧的不再支持的版本上进行...

答案 2 :(得分:0)

我认为这是Oracle 12.1.0.2.0的一个错误,但我找到了一个解决方法:

*warn-on-reflection*