val polygonParams = hashMapOf<String, String>()
polygonParams[ShapefileDataStoreFactory.URLP.key] = "file:ne_110m_admin_0_countries.shp"
val polygonDataStore = ShapefileDataStoreFactory().createDataStore(polygonParams)
val polygonCollection = polygonDataStore.getFeatureSource(polygonDataStore.names[0]).features
// [Oceania, Africa, North America, Asia, South America, Europe, Seven seas (open ocean), Antarctica]
// val polygonSpatialDataset = polygonCollection.subCollection(CQL.toFilter("CONTINENT NOT LIKE 'Africa'")).toSpatialDataset(10)
val polygonSpatialDataset = polygonCollection.toSpatialDataset(10)
plotsContainer.children.add(
createPlotSpecsNode(Dimension(1360, 768)) {
val p = letsPlot() + geomMap(
data = polygonSpatialDataset,
color = "white",
fill = "#0868ac",
alpha = 0.2
) {
fill = "CONTINENT"
}
p.toSpec()
}
)
The latest countries data on Natural Earth 1:110m Cultural Vectors Admin 0 – Countries for
Africa
does not meet the validation criteria ofLinesHelper
By debugging you can find two pieces of data when the condition is not met
Here is the relevant code
versions