areas = world.features
.filter(o => o.properties.continent == "Europe"
|| o.properties.name == "Morocco"
|| o.properties.name == "Algeria"
|| o.properties.name == "Tunisia"
|| o.properties.name == "Turkey"
|| o.properties.name == "Greenland"
)
.reduce((countries2, feature) => {
if (feature.geometry.type == "Polygon") {
countries2.push(feature);
} else {
feature.geometry.coordinates.forEach(coordinates => {
countries2.push({
type: "Feature",
properties: feature.properties,
geometry: { type: "Polygon", coordinates },
});
});
}
return countries2;
}, [])