Cannot index a polygon crossing the 180th meridian

XMLWordPrintableJSON

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

      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
            Reporter:
            Frédéric De Jaeger
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: