Error Message Reference (DOCS-335)

[DOCS-2029] Document error 16535 Created: 03/Oct/13  Updated: 11/Jan/17  Resolved: 07/Feb/15

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: mongodb-2.6
Fix Version/s: 01112017-cleanup

Type: Sub-task Priority: Trivial - P5
Reporter: Stephen Rhyne Assignee: Unassigned
Resolution: Done Votes: 0
Labels: query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB 2.4.4 on OSX


Participants:
Days since reply: 9 years, 1 week, 5 days ago

 Description   
  1. Topic

Error code 16535 - can't parse query (2dsphere)

The cause of this error was due to my $geoWithin query not having a completely closed set of coordinates. However, elsewhere in the documentation it's stated that the very last point of a polygon's coordinates is implicitly connected the first, closing the polygon automatically.

This query below throws the 16535 error, but if you uncomment the last coordinate pair that is the same as the first, it works.

2. Suggestion - Clarify whether or not all polygons should be explicitly closed or create an exception warning in the documents for GeoJSON Queries. Could it be the difference between 2d & 2dsphere?.

geowithin.js

var query = {};
query.geometry = {
	$geoIntersects: { 
		$geometry: { 
			type: "Polygon",
			coordinates: [
				[ 
					[ -122.3252105712, 47.74798087303008 ], 
					[ -122.2153472900, 47.74798087303008 ], 
					[ -122.2153472900, 47.67151416424682 ], 
					[ -122.3252105712, 47.67151416424682 ],
					// [ -122.3252105712, 47.74798087303008 ]
				] 
			]
		} 
	} 
};
 
db.zips.find(query).forEach(printjson);



 Comments   
Comment by Michael Paik [ 07/Feb/15 ]

Example at http://docs.mongodb.org/manual/reference/operator/query/geoWithin/ closes the polygon; this should be enough to illustrate polygon closer without further comment.

Generated at Thu Feb 08 07:42:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.