geojson-summary
npm i geojson-summary

geojson-summary

Generate a plain-english summary of what is in a GeoJSON file.

by mapbox

0.5.0 (see all)License:BSDTypeScript:Not Found
npm i geojson-summary
Readme

Build Status

geojson-summary

Generate a plain-english summary of what is in a GeoJSON file.

install

npm install geojson-summary

api

summary(geojson, options)

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']
}

example

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']
}
*/

Downloads/wk

3

GitHub Stars

31

LAST COMMIT

5yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.5.0
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial