Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9948

Cannot index a polygon crossing the 180th meridian

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.0
    • Component/s: Geo
    • None
    • Environment:
      linux
    • Linux

      I could not find a way to index a polygon (rectangle) crossing the 180th meridian.
      Common sense suggest to let some longitudes overflow +- 180 like in this example:

      {"type"=>"Polygon", "coordinates"=>[[[-185.0, 30], [-165.0, 30], [-165.0, 50], [-185.0, 50], [-185.0, 30]]]}

      but it fails with the infamous error "Can't extract geo keys from object, malformed geometry?".

      If I normalize the coordinates to not overflow +-180, then I don't see how mongodb could distinguish that small polygon from a large band going from meridian -165 to meridian +175.

      I could try to split my polygon into two across the 180 meridian but then I fall onto https://jira.mongodb.org/browse/SERVER-8907

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            thoran Frédéric De Jaeger
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: