Whats the right way to translate a geojson FeatureCollection to a es geo_shape?
I have a FeatureCollection looking like this:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[1.96, 42.455],[1.985,42.445]]]
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
}
]
}
How can I translate this into the es geo_shape
.
Currently I just index it like that (dropping type: Feature
and type: FeatureCollection
fields) and add a mapping saying:
"features": {
"geometry": {
"type": "geo_shape"
}
}
This seems to work fine, but feels wrong, as I give an array of geometry
s.
Is this okay or would the right way be to translate the FeatureCollection
to type geometrycollection
? Which clearly wants multiple geometry
elements.
One Followup question, can I do a query a la: Give me all elements geometrically inside Element X
in one query, without fetching X and than doing multiple follow up queries for each polygon?