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

Can't extract geo keys from object, malformed geometry?

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.4.6, 2.5.3
    • Component/s: Geo
    • Environment:
      Linux
    • Linux
    • Hide

      Insert the following polygon into a collection without an index.

      "type": "Polygon",
      "coordinates":[ [ [ -176.5573404206603, -26.62752545076926 ], [ -176.5790581155294, -26.45810909031957 ], [ -176.6707632150535, -25.96189875199764 ], [ -176.8290859572914, -25.15712799883819 ], [ -177.0482086728448, -24.07336864167018 ], [ -177.3200795588031, -22.75044410420587 ], [ -177.6347085473391, -21.23696608612408 ], [ -177.9805343970758, -19.58854829538924 ], [ -178.3448495182208, -17.86576288734291 ], [ -178.714266920998, -16.13191470250723 ], [ -179.0752121290624, -14.45071509014138 ], [ -179.4144219822276, -12.88394079437707 ], [ -179.7194319996838, -11.4891639286443 ], [ -179.9790343952361, -10.31763645191415 ], [ -180.1836899145046, -9.412406883018601 ], [ -180.3258783608655, -8.806738455571789 ], [ -180.4003749298368, -8.522886839391754 ], [ -180.4044421978278, -8.571282341822819 ], [ -180.3379307105011, -8.950146639488732 ], [ -180.2032844745671, -9.645558123911005 ], [ -180.0054511512106, -10.63196345982628 ], [ -179.7517002511473, -11.87311655866853 ], [ -179.4513560118511, -13.32341046404096 ], [ -179.1154547725442, -14.92955320820282 ], [ -178.7563394369255, -16.63252605916341 ], [ -178.38720592536, -18.36975220135411 ], [ -178.0216182824303, -20.07739616033413 ], [ -177.6730102575311, -21.69270947771339 ], [ -177.3541916732428, -23.15633644298238 ], [ -177.0768777202904, -24.41449515667321 ], [ -176.851258475444, -25.42095378030516 ], [ -176.685624460696, -26.13872935455922 ], [ -176.5860620027822, -26.54144676153235 ], [ -176.5573404206603, -26.62752545076926 ] ] ]
      }

      Then query the polygon using $geoIntersects. Everything works as expected.

      Then create an index on the field and add the same polygon you will get the following error "Can't extract geo keys from object, malformed geometry?" when inserted the same data.

      The polygon does pass the test on http://geojsonlint.com/

      Show
      Insert the following polygon into a collection without an index. "type": "Polygon", "coordinates":[ [ [ -176.5573404206603, -26.62752545076926 ], [ -176.5790581155294, -26.45810909031957 ], [ -176.6707632150535, -25.96189875199764 ], [ -176.8290859572914, -25.15712799883819 ], [ -177.0482086728448, -24.07336864167018 ], [ -177.3200795588031, -22.75044410420587 ], [ -177.6347085473391, -21.23696608612408 ], [ -177.9805343970758, -19.58854829538924 ], [ -178.3448495182208, -17.86576288734291 ], [ -178.714266920998, -16.13191470250723 ], [ -179.0752121290624, -14.45071509014138 ], [ -179.4144219822276, -12.88394079437707 ], [ -179.7194319996838, -11.4891639286443 ], [ -179.9790343952361, -10.31763645191415 ], [ -180.1836899145046, -9.412406883018601 ], [ -180.3258783608655, -8.806738455571789 ], [ -180.4003749298368, -8.522886839391754 ], [ -180.4044421978278, -8.571282341822819 ], [ -180.3379307105011, -8.950146639488732 ], [ -180.2032844745671, -9.645558123911005 ], [ -180.0054511512106, -10.63196345982628 ], [ -179.7517002511473, -11.87311655866853 ], [ -179.4513560118511, -13.32341046404096 ], [ -179.1154547725442, -14.92955320820282 ], [ -178.7563394369255, -16.63252605916341 ], [ -178.38720592536, -18.36975220135411 ], [ -178.0216182824303, -20.07739616033413 ], [ -177.6730102575311, -21.69270947771339 ], [ -177.3541916732428, -23.15633644298238 ], [ -177.0768777202904, -24.41449515667321 ], [ -176.851258475444, -25.42095378030516 ], [ -176.685624460696, -26.13872935455922 ], [ -176.5860620027822, -26.54144676153235 ], [ -176.5573404206603, -26.62752545076926 ] ] ] } Then query the polygon using $geoIntersects. Everything works as expected. Then create an index on the field and add the same polygon you will get the following error "Can't extract geo keys from object, malformed geometry?" when inserted the same data. The polygon does pass the test on http://geojsonlint.com/

      The same GeoJson polygon throws errors depending on if a 2dsphere geo index exists or not. Either the indexing need to be fixed not to throw this error or querying needs to have the same checks to throw the error to keep behavior the same.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            vegaed Edgardo Vega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: