[SERVER-15894] 5000 edge polygon query fails Created: 31/Oct/14  Updated: 10/Dec/14  Resolved: 05/Nov/14

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 2.7.8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Quentin Conner Assignee: Siyuan Zhou
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File big_geodata.js     File big_geoquery2.js    
Issue Links:
Depends
Operating System: ALL
Steps To Reproduce:

cd jstests/core
start mongo shell >= 2.7.8
load('big_geodata.js')
load('big_geoquery2.js')

adjust call to nGon() as needed to vary polygon edge count.

Participants:

 Description   

Can we describe a 25000-edge polygon in a $geoWithin or $geoIntersects query? This is one of the criteria in our test plan.

I seem to have hit a limit at just under 5000 edges (vertices) using the big_geodata.js + big_geoquery2.js test script located at
https://github.com/qconner/mongo/tree/CAP-1099/jstests/core



 Comments   
Comment by Quentin Conner [ 05/Nov/14 ]

Confirmed new error message in 2.7.8 provides detail of the points that make the polygon complex.

Comment by Siyuan Zhou [ 31/Oct/14 ]

2.7.8 already includes the better error message SERVER-14508, which will return the following message. Those two edges seem share one same vertex, but they are not adjacent.

Edges 2498 and 2500 cross. Edge locations in degrees: [3.4613312, 49.8800480]-[-0.0000158, 50.0000000] and [-1.9992003, 49.9600160]-[0.0000158, 50.0000000]

Comment by Greg Studer [ 31/Oct/14 ]

Is this using v2.6 - I don't think this exception exists in v2.7.8? The newer code should have better error messages to make these cases less confusing.

I'd guess its something to do with very close edges and points as opposed to some sort of hardcoded limit - there's nothing (that I know of) that limits the number of edges aside from the 16MB query/document limit.

Comment by Quentin Conner [ 31/Oct/14 ]

The error:

generating a 101 -sided polygon
generating a 1001 -sided polygon
generating a 5000 -sided polygon
2014-10-31T05:45:45.359-0500 I QUERY    warning: log line attempted (209k) over max size (10k), printing beginning and end ... Error: count failed: {
	"errmsg" : "exception: bad geo query: { $geoWithin: { $geometry: { type: \"Polygon\", coordinates: [ [ [ 0.0, -50.0 ], [ 1.999200319872027, -49.96001599360256 ], [ 2.826730690465173, -49.92003198720512 ], [ 3.461331164786668, -49.88004798080768 ], [ 3.996000879215929, -49.84006397441024 ], [ 4.466770105963588, -49.8000799680128 ], [ 4.892121205656123, -49.76009596161536 ], [ 5.283035790205812, -49.72011195521792 ], [ 5.646670433877442, -49.68012794882048 ], [ 5.987997108843711, -49.64014394242304 ], [ 6.310636601855673, -49.60015993602561 ], [ 6.617322859306836, -49.56017592962817 ], [ 6.910180307806334, -49.52019192323073 ], [ 7.19089872734615, -49.48020791683329 ], [ 7.46084845617222, -49.44022391043585 ], [ 7.721159072538994, -49.40023990403841 ], [ 7.972774781680459, -49.36025589764097 ], [ 8.216494421212337, -49.32027189124353 ], [ 8.453001004772915, -49.28028788484609 ], [ 8.682883965482596, -49.24030387844865 ], [ 8.906656190054884, -49.20031987205121 ], [ 9.124767261476624, -49.16033586565377 ], [ 9.337613893434076, -49.12035185925633 ], [ 9.545548251832132, -49.08036785285889 ], [ 9.748884663987093, -49.04038384646145 ], [ 9.947905081666937, -49.00039984006401 ], [ 10.14286356974456, -48.96041583366657 ], [ 10.333990024841, -48.92043182726913 ], [ 10.52149327952262, -48.88044782087169 ], [ 10.70556371178234, -48.84046381447425 ], [ 10.88637545289923, -48.80047980807682 ], [ 11.06408826674877, -48.76049580167938 ], [ 11.23884915842337, -48.72051179528194 ], [ 11.41079375835197, -48.6805277888845 ], [ 11.58004751907174, -48.64054378248706 ], [ 11.74672675474917, -48.60055977608962 ], [ 11.91093954799473, -48.56057576969218 ], [ 12.07278654411212, -48.52059176329474 ], [ 12.23236164940644, -48.4806077568973 ], [ 12.3897526473497, -48.44062375049986 ], [ 12.54504174411601, -48.40063974410242 ], [ 12.69830605313882, -48.36065573770498 ], [ 12.84961802682151, -48.32067173130754 ], [ 12.99904584228069, -48.2806877249101 ], [ 13.14665374696842, -48.24070371851266 ], [ 13.29250236915936, -48.20071971211522 ], [ 13.43664899757377, -48.16073570571778 ], [ 13.57914783380601, -48.12075169932034 ], [ 13.72005022072372, -48.0807676929229 ], [ 13.85940484957665, -48.04078368652547 ], [ 13.99725794819189, -48.00079968012803 ], [ 14.13365345232572, -47.96081567373059 ], [ 14.26863316197879, -47.92083166733315 ], [ 14.40223688425752, -47.88084766093571 ], [ 14.53450256417052, -47.84086365453827 ], [ 14.66546640458312, -47.80087964814083 ], [ 14.79516297640878, -47.76089564174339 ], [ 14.92362531999191, -47.72091163534595 ], [ 15.05088503852762, -47.68092762894851 ], [ 15.17697238427054, -47.64094362255107 ], [ 15.30191633820128, -47.60095961615363 ], [ 15.42574468374791, -47.56097560975619 ], [ 15.54848407509578, -47.52099160335875 ], [ 15.67016010056381, -47.48100759696131 ], [ 15.79079734147589, -47.44102359056387 ], [ 15.91041942691289, -47.40103958416643 ], [ 16.02904908469235, -47.36105557776899 ], [ 16.14670818888887, -47.32107157137155 ], [ 16.26341780417788, -47.28108756497411 ], [ 16.37919822725868, -47.24110355857668 ], [ 16.49406902558865, -47.20111955217924 ], [ 16.60804907363887, -47.1611355457818 ], [ 16.7211565868625, -47.12115153938436 ], [ 16.83340915354993, -47.08116753298692 ], [ 16.94482376472906, -47.04118352658948 ], [ 17.0554168422557, -47.00119952019204 ], [ 17.16520426522613, -46.9612155137946 ], [ 17.27420139483 .......... 804907363887, -47.1611355457818 ], [ -16.49406902558865, -47.20111955217924 ], [ -16.37919822725868, -47.24110355857668 ], [ -16.26341780417788, -47.28108756497411 ], [ -16.14670818888887, -47.32107157137155 ], [ -16.02904908469235, -47.36105557776899 ], [ -15.91041942691289, -47.40103958416643 ], [ -15.79079734147589, -47.44102359056387 ], [ -15.67016010056381, -47.48100759696131 ], [ -15.54848407509578, -47.52099160335875 ], [ -15.42574468374791, -47.56097560975619 ], [ -15.30191633820128, -47.60095961615363 ], [ -15.17697238427054, -47.64094362255107 ], [ -15.05088503852762, -47.68092762894851 ], [ -14.92362531999191, -47.72091163534595 ], [ -14.79516297640878, -47.76089564174339 ], [ -14.66546640458312, -47.80087964814083 ], [ -14.53450256417052, -47.84086365453827 ], [ -14.40223688425752, -47.88084766093571 ], [ -14.26863316197879, -47.92083166733315 ], [ -14.13365345232572, -47.96081567373059 ], [ -13.99725794819189, -48.00079968012803 ], [ -13.85940484957665, -48.04078368652547 ], [ -13.72005022072372, -48.0807676929229 ], [ -13.57914783380601, -48.12075169932034 ], [ -13.43664899757377, -48.16073570571778 ], [ -13.29250236915936, -48.20071971211522 ], [ -13.14665374696842, -48.24070371851266 ], [ -12.99904584228069, -48.2806877249101 ], [ -12.84961802682151, -48.32067173130754 ], [ -12.69830605313882, -48.36065573770498 ], [ -12.54504174411601, -48.40063974410242 ], [ -12.3897526473497, -48.44062375049986 ], [ -12.23236164940644, -48.4806077568973 ], [ -12.07278654411212, -48.52059176329474 ], [ -11.91093954799473, -48.56057576969218 ], [ -11.74672675474917, -48.60055977608962 ], [ -11.58004751907174, -48.64054378248706 ], [ -11.41079375835197, -48.6805277888845 ], [ -11.23884915842337, -48.72051179528194 ], [ -11.06408826674877, -48.76049580167938 ], [ -10.88637545289923, -48.80047980807682 ], [ -10.70556371178234, -48.84046381447425 ], [ -10.52149327952262, -48.88044782087169 ], [ -10.333990024841, -48.92043182726913 ], [ -10.14286356974456, -48.96041583366657 ], [ -9.947905081666937, -49.00039984006401 ], [ -9.748884663987093, -49.04038384646145 ], [ -9.545548251832132, -49.08036785285889 ], [ -9.337613893434076, -49.12035185925633 ], [ -9.124767261476624, -49.16033586565377 ], [ -8.906656190054884, -49.20031987205121 ], [ -8.682883965482596, -49.24030387844865 ], [ -8.453001004772915, -49.28028788484609 ], [ -8.216494421212337, -49.32027189124353 ], [ -7.972774781680459, -49.36025589764097 ], [ -7.721159072538994, -49.40023990403841 ], [ -7.46084845617222, -49.44022391043585 ], [ -7.19089872734615, -49.48020791683329 ], [ -6.910180307806334, -49.52019192323073 ], [ -6.617322859306836, -49.56017592962817 ], [ -6.310636601855673, -49.60015993602561 ], [ -5.987997108843711, -49.64014394242304 ], [ -5.646670433877442, -49.68012794882048 ], [ -5.283035790205812, -49.72011195521792 ], [ -4.892121205656123, -49.76009596161536 ], [ -4.466770105963588, -49.8000799680128 ], [ -3.996000879215929, -49.84006397441024 ], [ -3.461331164786668, -49.88004798080768 ], [ -2.826730690465173, -49.92003198720512 ], [ -1.999200319872027, -49.96001599360256 ], [ -0.0, -50.0 ] ] ], crs: { type: \"name\", properties: { name: \"urn:mongodb:strictwindingcrs:EPSG:4326\" } } } } }",
	"code" : 2,
	"ok" : 0
}
    at Error (<anonymous>)
    at DBQuery.count (src/mongo/shell/query.js:193:11)
    at big_geoquery2.js:290:16
    at (shell):1:1 at src/mongo/shell/query.js:193
2014-10-31T05:45:45.363-0500 I QUERY    Error: error loading js file: big_geoquery2.js
    at (shell):1:1
> 
 

Generated at Thu Feb 08 03:39:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.