-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.0.0
-
Environment:Spring Boot version: 2.1.3.RELEASE
MongoDB version: 4.0.0
Java version: 11.0.2
-
ALL
I try to identify that the next two polygons are intersects or not.
I use Spring Data MongoDB(MongoTemplate) and always got the incorrect result that Polygon A and Polygon B do not intersects.
https://jira.spring.io/browse/DATAMONGO-2232
@GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
private GeoJsonPolygon polygon;
Query query = new Query();
query.addCriteria(Criteria.where("polygon").intersects(geoJson));
return mongoTemplate.find(query, Test.class);
Polygon A - geojson:
{"type": "Polygon","coordinates": [[[-77.343750,39.909736],[-75.937500,39.909736],[-75.937500,38.822591],[-77.343750,38.822591],[-77.343750,39.909736]]]}Polygon B - geojson:
{"type":"Polygon","coordinates":[[[-77.00177021452367,38.82077235346139],[-77.00348330700899,38.819438900784746],[-77.0040669508291,38.818982682804744],[-77.00457638439258,38.81959904396081],[-77.00521666571649,38.81904066569433],[-77.00539436635688,38.81890203430157],[-77.00541048580516,38.817944614252724],[-77.00566376726903,38.817745937824895],[-77.00610793253503,38.817399170935175],[-77.00621102361976,38.81732371331884],[-77.00642395340265,38.81715517946799],[-77.00668049760685,38.81695488875721],[-77.00693704091168,38.81675459804643],[-77.00719358241781,38.816554306436274],[-77.00745012302474,38.81635401482595],[-77.00770666183286,38.81615372231647],[-77.00796319974182,38.81595342890773],[-77.00821973585204,38.81575313549888],[-77.00847627016373,38.81555284119082],[-77.00873280357598,38.81535254598339],[-77.00898933518965,38.815152250775725],[-77.00924586590389,38.814951954669084],[-77.00950239392017,38.81475165766295],[-77.00975395947762,38.81500271330464],[-77.01000552683354,38.81525376894632],[-77.0108504003257,38.81582960665111],[-77.01080472016167,38.81616608349805],[-77.01075903909833,38.81650256124436],[-77.01071335803493,38.81683903899062],[-77.01066775791065,38.81717491598971],[-77.01067186511443,38.81717498883472],[-77.01058445910536,38.81803001477351],[-77.01071688967266,38.818976903761154],[-77.00949070363305,38.81915769087482],[-77.00948635990756,38.819158052402315],[-77.00913347852719,38.81921007818261],[-77.00878059804614,38.81926210216437],[-77.0084277157664,38.81931412614614],[-77.00807483348666,38.81936614832915],[-77.00772195120697,38.81941816961296],[-77.00736906802803,38.81947018999739],[-77.00701618394964,38.81952220948244],[-77.00666329987132,38.81957422806835],[-77.00631041489368,38.8196262448555],[-77.00595752901671,38.819678260743274],[-77.00560464403907,38.81973027573167],[-77.00525175726267,38.819782289820864],[-77.00520825255876,38.820481753730064],[-77.00520394390679,38.82079798234099],[-77.00519963615426,38.821114210952146],[-77.00519532840161,38.821430439563244],[-77.0051910197497,38.82174666817417],[-77.00518671199706,38.82206289588612],[-77.0052343751662,38.82235088758347],[-77.0052820392346,38.82263887928099],[-77.00538889398223,38.82290541045643],[-77.00549575052844,38.82317193983329],[-77.00560260707454,38.82343847010935],[-77.00523248299265,38.82325291838765],[-77.00486236160862,38.82306736576635],[-77.0045052210391,38.82288831704227],[-77.00449224202333,38.82288181044737],[-77.00297361983667,38.82220653290523],[-77.00317436200714,38.82192953811773],[-77.00177021452367,38.82077235346139]]]}