geocodejson-stream
Stream-based utility for consuming and generating GEOJSON files specifically for geocoding needs. see proposed geocodejson spec
install
npm install geocodejson-stream
usage
stringify(geocoding)
geojson feature objects --> geocodejson-stream.stringify(geocoding) --> text
var fs = ;var geocodejson = ; // provide geocoding properties as the first parameter to stringifyvar geoStream = GeocodeJsonStream; geoStream
will result in...
"type": "FeatureCollection" "geocoding": "version": "0.0.3" "license": "ODbL" "features": "type": "Feature" "properties": "name": "USA" "geometry": ... "type": "Feature" "properties": "name": "Canada" "geometry": ...
parse
text --> geocodejson-stream.parse --> geojson feature objects
var fs = ;var through = ;var geocodejson = ; fs // file contents described in stringify documentation ;
will result in...
"type": "Feature" "properties": "name": "USA" "geometry": ... "type": "Feature" "properties": "name": "Canada" "geometry": ...
parseGeocoding
text --> geocodejson-stream.parseGeocoding --> geocoding object
var fs = ;var through = ;var geocodejson = ; fs // file contents described in stringify documentation ;
will result in...
"version": "0.0.3" "license": "ODbL"
test
$ npm test
contribute
- yes please
license
MIT (see LICENSE.md)