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

find 'big polygon' geo objects after the 2.8 release

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Geo
    • Labels:
      None
    • Query

      It would be nice for GEO queries to find stored Big Polygon documents, after the 2.8 release that allows $geoWithin and $geoIntersect queries that reference Big Polygon GeoJson objects.

      Big Polygon means a polygon with area larger than one hemisphere.

      The following mongo shell script would work with the feature addition.

      // current CRS
      var CRS = {};
      CRS.type = 'name';
      CRS.properties = {};
      CRS.properties.name = 'urn:mongodb:strictwindingcrs:EPSG:4326';
      
      // Big Polygon covering both poles
      // this document will NOT be found in the 2.8 release
      // b/c this feature does not recognize stored big polygon objects
      var bigPoly = {};
      bigPoly.geo = {};
      bigPoly.name = 'big polygon/rectangle covering both poles';
      bigPoly.geo.type = 'Polygon';
      bigPoly.geo.crs = CRS;
      bigPoly.geo.coordinates = [
                    [ [ -130.0, 89.0 ], [ -120.0, 89.0 ], [ -120.0, -89.0 ], [ -130.0, -89.0 ], [ -130.0, 89.0 ] ]
                  ];
      db.foo.insert(bigPoly);
      
      
      
      
      // Triangle around Shenzhen, China
      var shenzhenPoly = {};
      shenzhenPoly.type = 'Polygon';
      shenzhenPoly.coordinates = [
                                   [
                                     [ 114.0834046, 22.6648202 ],
                                     [ 114.2736054, 22.4047911 ],
                                     [ 113.8293457, 22.3819359 ],
                                     [ 114.0834046, 22.6648202 ]
                                   ]
                                 ];
      shenzhenPoly.crs = CRS;
      db.foo.find({geo: {$geoWithin: {$geometry: shenzhenPoly}}});
      

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            quentin.conner Quentin Conner
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: