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

Geo polygon searches with a line leaves off the greatest point

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.0.0-rc2
    • Affects Version/s: 2.0.0-rc0
    • Component/s: Geo
    • None
    • ALL

      > t = db.geo_polygon5;
      test.geo_polygon5
      > t.drop();
      true
      >
      > t.insert(

      {loc:[0,0]}

      )
      > t.insert(

      {loc:[1,0]}

      )
      > t.insert(

      {loc:[2,0]}

      )
      > t.insert(

      {loc:[3,0]}

      )
      > t.insert(

      {loc:[4,0]}

      )
      >
      > t.ensureIndex(

      { loc : "2d" }

      );
      >
      > t.find( { loc: { "$within":

      { "$polygon" : [[0,0], [2,0], [4,0]] }

      }} )

      { "_id" : ObjectId("4e5d35916c2fa14a9f1ae299"), "loc" : [ 1, 0 ] } { "_id" : ObjectId("4e5d35916c2fa14a9f1ae298"), "loc" : [ 0, 0 ] } { "_id" : ObjectId("4e5d35916c2fa14a9f1ae29b"), "loc" : [ 3, 0 ] } { "_id" : ObjectId("4e5d35916c2fa14a9f1ae29a"), "loc" : [ 2, 0 ] }

      The point [4,0] is left out of the results.

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: