ES does support GeometryCollections
but a bit of pre-processing is required.
Going with a minimum reproducible index setup:
PUT geoindex
{
"mappings": {
"properties": {
"regions": {
"type": "geo_shape"
}
}
}
}
Extract the features
to conform w/
POST geoindex/_doc
{
"id": "polygon_tests_01.ast-ORTHOMOSAIC",
"name": "tmpl_integration_test_GeoTIFF",
"regions": {
"type": "geometrycollection",
"geometries": [
{
"type": "polygon",
"coordinates": [[[-149.67474372431124,61.27942558978003],[-149.65726554157862,60.993770332779064],[-150.11544465434918,61.15680203118899],[-149.87699170822603,61.28122531469481],[-149.67474372431124,61.27942558978003]]]
}
]
}
}
Notice that regions.geometries
can include multiple geojson features, not just polygons.
After that, we can query for polygon intersections:
POST geoindex/_search
{
"query": {
"geo_shape": {
"regions": {
"relation": "intersects",
"shape": {
"type": "polygon",
"coordinates": [[[-149.68734741210938,61.34276125480617],[-149.78347778320312,61.268912537559316],[-149.53628540039062,61.18628656437939],[-149.37286376953125,61.29662618671741],[-149.4085693359375,61.3671195097931],[-149.65164184570312,61.37962043716795],[-149.68734741210938,61.34276125480617]]]
}
}
}
}
}
Note: your indexed polygon is in Anchorage, AK, while the one in the query is in eastern Nigeria. The two ain't gonna overlap :)
So my query above tests the purple polygon around Eagle River: