Typically, you'll add
simple-features as a dependency of another package.
npm install simple-features --save
--save option if you are installing locally just to try it out.)
Create a new feature with one string property and one geometry.
var assert = ;var simple = ;var feature =name: 'Bozeman'loc: -11104 4568;
Features can have arbitrary properties. To access a property value, use the
var value = feature;assert;
Features typically have a single geometry, but they can have more. In cases where a feature has more than one geometry, the first one is considered the "default" geometry. The default geometry can be accessed by using the
get method with the property name or with the
var loc = feature;var geom = feature;assert;
Geometries have multi-dimensional coordinate arrays of the same form as GeoJSON.
var coords = featurecoordinates;assert;
Until there are more docs here, see the tests for more detail.
Run tests with the
You can also set up a watcher to run tests continuously during development.
npm run watch