Generate a plain-english summary of what is in a GeoJSON file.
npm install geojson-summary
Given a GeoJSON object, return an object with sentence
(string) and
parts
(array of strings) members describing the object.
Options:
types
: an object of type to name mappings like the default:
{
Point: [' point', ' points'],
Polygon: [' polygon', ' polygons'],
LineString: [' line', ' lines']
}
summary([{
type: 'Feature',
properties: {},
geometry: { "type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
]
}
}])
// Returns:
/*
{
sentence: '1 polygon',
parts: ['1 polygon']
}
*/