geojson-summary
return a text summary of what is in a geojson object
Last updated 5 years ago by tmcw .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install geojson-summary 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.5.0                                ...           latest (5 years ago)

6 Versions

  • 0.5.0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (3)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |