Announcement Announcement Module
No announcement yet.
Geo Query with "Point" object on Spring Data Mongodb Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Geo Query with "Point" object on Spring Data Mongodb

    Hi all,

    i use Spring Data Mongodb 1.0.1 RELEASE.
    When i use geoQuery with maxDistance, i get incorrect result.
    Example of the query :
    Query.query(Criteria.where(("location").nearSphere(city.location).maxDistance(new Distance(50, Metrics.KILOMETERS).getNormalizedValue()))
    where "city.location" is object.

    I guess the problem comes from Point object. With Point object the mongo query is written with the (latitude, longitude) order, though with mongoDB, you need to write the query with the (longitude, latitude) order.

    Is there something to do with the Point coord order ? ATM, i need to create another object "mongoPoint" with switched values of "Point" to make query works. Am i wrong ?

    Thx to all of Springsource team !