Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geo: geo_shape MultiPolygon parsing problem #7126

Closed
spinscale opened this Issue Aug 1, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@spinscale
Copy link
Member

spinscale commented Aug 1, 2014

Trying to index this shape results in an IndexOutOfBoundsException

DELETE /countries
PUT /countries
PUT /countries/location/_mapping
{
  "location" : {
    "properties" : {
      "location" : {
        "type" : "geo_shape"
      }
    }
  }
}


PUT countries/location/somewhere-in-sweden
{ "location" : { 
  "type": "MultiPolygon",
  "coordinates": [
    [
      [
        [22.183173, 65.723741],
        [21.213517, 65.026005],
        [21.369631, 64.413588],        
        [22.183173, 65.723741]
      ],
      [
        [17.061767, 57.385783],
        [17.210083, 57.326521],
        [16.430053, 56.179196],        
        [17.061767, 57.385783]
      ]
    ]
  ]
} } 

The shape looks valid here https://gist.github.com/spinscale/0c014b3a0f15f90b5c4c

@colings86 colings86 self-assigned this Aug 1, 2014

@colings86 colings86 removed the adoptme label Aug 1, 2014

@colings86

This comment has been minimized.

Copy link
Member

colings86 commented Aug 6, 2014

The GeoJSON in the index request appears to be invalid as it is specifying a single polygon with a hole outside its bounds. The correct request, following the geoJSON spec should be:

PUT countries/location/somewhere-in-sweden
{ "location" : { 
  "type": "MultiPolygon",
  "coordinates": [
    [
      [
        [22.183173, 65.723741],
        [21.213517, 65.026005],
        [21.369631, 64.413588],        
        [22.183173, 65.723741]
      ]
    ],
    [
      [
        [17.061767, 57.385783],
        [17.210083, 57.326521],
        [16.430053, 56.179196],        
        [17.061767, 57.385783]
      ]
    ]
  ]
} } 
@clintongormley

This comment has been minimized.

Copy link
Member

clintongormley commented Aug 7, 2014

Could we at least throw a nicer error?

colings86 added a commit to colings86/elasticsearch that referenced this issue Aug 12, 2014

colings86 added a commit that referenced this issue Aug 12, 2014

@colings86 colings86 changed the title Geo shape MultiPolygon parsing problem Geo: geo_shape MultiPolygon parsing problem Aug 12, 2014

colings86 added a commit that referenced this issue Sep 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.