/**Load shape from the given file.
* Contents of the file are assumed to be GeoJSON.**/
public static Shape loadShapeJSON(File source) {
try (FileInputStream fs = new FileInputStream(source)){
FeatureCollection fc = new ObjectMapper().readValue(fs, FeatureCollection.class);
Feature feature = fc.getFeatures().get(0);
@SuppressWarnings("rawtypes")
Geometry geometry = (Geometry) feature.getGeometry();
if (geometry instanceof MultiPolygon) {
return toArea((MultiPolygon) geometry);
} else {
return toArea((Polygon) geometry);
}