-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.5.0, 1.8.1
-
Component/s: None
-
None
-
Linux
im using /mongodb-linux-i686-1.6.0 and pymongo to do some geo-queries like bounding box on points and as it is said here:
http://api.mongodb.org/python/1.8%2B/examples/geo.html I have first search coordinate as lower-left and the second search coordinate as upper-right. but it doesn't work quite fine.
for instance this query :
geodb.point_collection.find({"addr:housenumber": "420","addr:street": "S Nevada St", "loc": {"$within":
}}):
returns:
{u'addr:housenumber': u'420', u'loc': [-117.372889, 33.192777],u'addr:city': u'Oceanside', u'is_in:country': u'United States ofAmerica', u'addr:postcode': u'92054', u'is_in:city': u'Oceanside',u'is_in:country_code': u'US', u'addr:country': u'US', 'is_in:state':u'California', u'source': u'SanGIS Addresses Public Domain (http://www.sangis.org/)', u'id': u'596715001', u'_id':ObjectId('4c62eb6634e1c779b800017c'), u'type': u'Point',u'is_in:state_code': u'CA', u'addr:street': u'S Nevada St'}but this query
geodb.point_collection.find({"addr:housenumber": "420","addr:street": "S Nevada St", "loc": {"$within":
}}):
returns this error:
for doc in geodb.point_collection.find({"addr:housenumber": "420","addr:street": "S Nevada St", "loc": {"$within":
}}):
File "/usr/local/lib/python2.6/dist-packages/pymongo/cursor.py",
line 565, in next if len(self.__data) or self._refresh():
File "/usr/local/lib/python2.6/dist-packages/pymongo/cursor.py",
line 528, in refresh self.query_spec(), self._fields))
File "/usr/local/lib/python2.6/dist-packages/pymongo/cursor.py",
line 496, in _send_message self.as_class, self._tz_aware)
File "/usr/local/lib/python2.6/dist-packages/pymongo/helpers.py",
line 99, in _unpack_response error_object["$err"])
pymongo.errors.OperationFailure: database error: point not in range
so the bbox coordinates are not lower-left and upper-right. not sure
wat they are....
thanks,
sima