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

$geointersects does not work when polygon bigger than semi-sphere

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 4.3.6
    • Fix Version/s: None
    • Component/s: Geo
    • Labels:
      None

      Description

      i enter a single entry to mongo, with Polygon which contains most of the earth:

      db.test.insert(
      { loc : { 
          type : "Polygon" ,
          coordinates : [ [[-179, -90],[180, -90],[180, 90],[-179, 90],[-179, -90]]]
          }
      })
      

       

      then, when i query for a Point to get the Polygon(s) who contains it:

      db.getCollection('test').find({
      loc: {
      $geoIntersects: {
      $geometry: {
      type: "Point" ,
      coordinates: [0,0]
      }}}})
      

      i do not get any result. this is because mongo searches in the small part and not in the big one. if i query for a Point which is in the small section, i do get the result:

      db.getCollection('test').find({
      loc: {
      $geoIntersects: {
      $geometry: {
      type: "Point" ,
      coordinates: [-179.5,0]
      }}}})
      

       

      CRS can help me ONLY if i query for a Polygon. but in my case, I query for a Point.

       

      I suggest to support CRS upon insertions of Polygons.

        Attachments

        1. insert polygon.png
          insert polygon.png
          11 kB
        2. query statement.png
          query statement.png
          15 kB

          Issue Links

            Activity

              People

              Assignee:
              carl.champain Carl Champain (Inactive)
              Reporter:
              ohadr.developer@gmail.com Ohad R
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: