@mapbox/osm-compare
v9.4.1
Published
Compare a features new and old versions in GeoJSON
Downloads
86
Maintainers
Keywords
Readme
osm-compare
Compare functions are small atomic functions that are designed identify what changed during a feature edit on OpenStreetMap. Compare functions can be broadly split up into two categories:
- Property (tags) checking compare function
- Geometry checking compare functions
Compare functions take as inputs the following:
oldVersion
- GeoJSON of the feature's old versionnewVersion
- GeoJSON of the feature's new version
Compare functions output the following:
result
- Object containing key value pairs representing findings of the compare function or an empty object.
# Format of compare function result where value can be primary data types or objects
{
'result:comparator_name': value,
'message': Any custom message which corresponds to the catch
}
# Format of compare function if no result, (default)
false
Install
# Install osm-compare from the Mapbox namespace.
npm install @mapbox/osm-compare
Docs
How do I build an npm package?
- We use Semantic Versioning Specification for versioning releases.
- Create an appropriate version of the npm package with
npm version [major|minor|patch]
. - Push the package tag commit with
git push --tags
- Publish the NPM package with
npm publish