Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1391

2dsphere bounding polygon must be <= hemisphere

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: Server
    • Labels:
      None

      See: https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/D7ZMWdUnR5U

      If the x-axis spans more than 180° it is an invalid shape for $geoWithin or $geoIntersects.

      For example:

      // This is valid:
      db.features1.find( { loc : 
        { $geoIntersects : 
          { $geometry : 
            { type : "Polygon" , coordinates: [ [ [1, 90], [-179, 90], [-179, -90], [1, -90], [1, 90] ] ] } 
          } 
        } 
      } )
      
      // This is invalid (and will silently return no results):
      db.features1.find( { loc : 
        { $geoIntersects : 
          { $geometry : 
            { type : "Polygon" , coordinates: [ [ [2, 90], [-179, 90], [-179, -90], [2, -90], [2, 90] ] ] } 
          } 
        } 
      } )
      

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              11 years, 4 weeks, 3 days ago