Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: PyEve supporting $centerSphere operator #1181

Irene-GM opened this issue Aug 24, 2018 · 2 comments

Request: PyEve supporting $centerSphere operator #1181

Irene-GM opened this issue Aug 24, 2018 · 2 comments


Copy link

@Irene-GM Irene-GM commented Aug 24, 2018


I wonder whether it is possible for the Py-Eve developer community to include support for the $centerSphere operator via HTTP, so we can build spatial queries with a search radius and fetch the associated data from a Mongo database. This question was originally asked in SO, and following the suggestion of a user, I decided to make this request.

Expected Behavior

The following query is possible in a Mongo console environment:


So its equivalent in HTTP should pull the same set of values from the Mongo database:{"geometry": {"$geoWithin": {"$centerSphere": [ [4.92592, 51.969035],0.02]}}}

Actual Behavior

However, the Eve server replies as follows:

   "_status": "ERR",
   "_error": {
       "code": 400,
       "message": "Query contains unknown or unsupported operators: $centerSphere"

Because it seems that the $centerSphere is not yet supported in PyEve 0.8.
Are there any plans to include this operator in a new release of PyEve?
Thanks for your support!

Copy link

@nicolaiarocci nicolaiarocci commented Aug 27, 2018

Hello, this feature should be relatively easy to add. Thanks for reporting and of course, feel free to submit a PR

Copy link

@Irene-GM Irene-GM commented Aug 28, 2018


Thanks a lot for the quick response to solve this problem! Much appreciated!

We tried the 0.8.1dev version of PyEve with this particular case that we were posing above and it works. However, we think it is worth to mention that then we tried to add a search radius based in a division, and it seems that PyEve is not able to understand the division, perhaps due to parsing. We understand that we can do the division by ourselves, but maybe this functionality is interesting to mimic the behavior of MongoDB.

Thus, this query works via Postman:{"geometry": {"$geoWithin": {"$centerSphere": [ [4.92592, 51.969035],0.0001]}}}

But this one does not:{"geometry": {"$geoWithin": {"$centerSphere": [ [4.92592, 51.969035],1/6378.1]}}}

We are not sure whether this is that we are making a mistake, or that PyEve does not understand the operation. Can you let us know about this?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.