I trying to draw a Polygon inside a Polygon hole using a single Feature MultiPolygon, like this:
However, when I add this GeoJson file on Android the background is not being fulfilled, only the lines are being drawn:
When I remove the most inner Polygon, it works fine:
Does the Google Maps SDK somehow supports intersection on MultiPolygons?
Follows the GeoJson file:
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[-119.443359, 18.646245],
[-70.751953, 18.646245],
[-70.751953, 46.619261],
[-119.443359, 46.619261],
[-119.443359, 18.646245]
],
[
[-105.732422, 25.324167],
[-105.732422, 39.164141],
[-80.332031, 39.164141],
[-80.332031, 25.324167],
[-105.732422, 25.324167]
],
[
[-96.152344, 29.305561],
[-96.152344, 35.029996],
[-86.132813, 35.029996],
[-86.132813, 29.305561],
[-96.152344, 29.305561]
]
]
]
}
}]
}
GeoJSON "MultiPolygon"
with holes should have structure like that:
{
"type": "MultiPolygon",
"coordinates": [
[
[<coordinates of first polygone>],
[<coordinates of first hole in first polygone>],
[<coordinates of second hole in first polygone>],
...
[<coordinates of last hole in first polygone>]
],
...
[
[<coordinates of last polygone>],
[<coordinates of first hole in last polygone>],
[<coordinates of second hole in last polygone>],
...
[<coordinates of last hole in last polygone>]
]
]
}
So, exactly for yours case "most inner Polygon" should be moved one level up and GeoJSON should be like that:
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[-119.443359, 18.646245],
[-70.751953, 18.646245],
[-70.751953, 46.619261],
[-119.443359, 46.619261],
[-119.443359, 18.646245]
],
[
[-105.732422, 25.324167],
[-105.732422, 39.164141],
[-80.332031, 39.164141],
[-80.332031, 25.324167],
[-105.732422, 25.324167]
]
],
[
[
[-96.152344, 29.305561],
[-96.152344, 35.029996],
[-86.132813, 35.029996],
[-86.132813, 29.305561],
[-96.152344, 29.305561]
]
]
]
}
}]
}
The result in that case is: