compare-geojson

Compare a features new and old versions in GeoJSON

Package renamed to @mapbox/osm-compare
Last updated 3 years ago by bkowshik .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install compare-geojson 
SYNC missed versions from official npm registry.

osm-compare

DEPRECATED! Go to @mapbox/osm-compare


Circle CI

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:

  1. Property (tags) checking compare function
  2. Geometry checking compare functions

Compare functions take as inputs the following:

  1. oldVersion - GeoJSON of the feature's old version
  2. newVersion - GeoJSON of the feature's new version
  3. callback - A function to call after processing.

Compare functions output the following:

  1. error - Error if any during processing or null.
  2. 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
}

# Format of compare function if no result, (default)
{
    'result:comparator_name': {}
}

How do I create a new compare function?

  • Clone this repository with git clone https://github.com/mapbox/osm-compare
  • cd osm-compare
  • npm install
  • Check if all tests pass before making your changes with npm test
  • Create a new test fixture in the directory tests/fixtures/
  • Create a new compare function in the directory comparators/ (check comparators/example.js for format)
  • Test your new compare function with npm test
  • Add your new comparator to index.js
  • Along with a brief description of the comparator, add it to comparators/README.md
  • Push to a new branch on Github and create a Pull Request

How do I test a single compare function against a new fixture?

  • cd compare-geojson/tests/
  • Create new fixture file in tests/fixtures/ folder (check tests/fixtures/example.json for format)
  • Test your fixture with node tests/test_compare_function.js tests/fixtures/example.json

How do I build an npm package?


DEPRECATED! Go to @mapbox/osm-compare

Current Tags

  • 4.18.0                                ...           latest (3 years ago)

62 Versions

  • 4.18.0 [deprecated]           ...           3 years ago
  • 4.17.0 [deprecated]           ...           3 years ago
  • 4.16.1 [deprecated]           ...           3 years ago
  • 4.16.0 [deprecated]           ...           3 years ago
  • 4.15.1 [deprecated]           ...           3 years ago
  • 4.15.0 [deprecated]           ...           3 years ago
  • 4.13.2 [deprecated]           ...           3 years ago
  • 4.13.1 [deprecated]           ...           3 years ago
  • 4.14.0 [deprecated]           ...           3 years ago
  • 4.13.0 [deprecated]           ...           3 years ago
  • 4.12.1 [deprecated]           ...           3 years ago
  • 4.12.0 [deprecated]           ...           3 years ago
  • 4.11.0 [deprecated]           ...           3 years ago
  • 4.10.1 [deprecated]           ...           3 years ago
  • 4.10.0 [deprecated]           ...           3 years ago
  • 4.9.2 [deprecated]           ...           3 years ago
  • 4.9.1 [deprecated]           ...           3 years ago
  • 4.9.0 [deprecated]           ...           3 years ago
  • 4.8.0 [deprecated]           ...           3 years ago
  • 4.7.1 [deprecated]           ...           3 years ago
  • 4.6.3 [deprecated]           ...           3 years ago
  • 4.6.2 [deprecated]           ...           3 years ago
  • 4.6.1 [deprecated]           ...           3 years ago
  • 4.7.0 [deprecated]           ...           3 years ago
  • 4.6.0 [deprecated]           ...           3 years ago
  • 4.5.3 [deprecated]           ...           3 years ago
  • 4.5.2 [deprecated]           ...           3 years ago
  • 4.5.1 [deprecated]           ...           3 years ago
  • 4.5.0 [deprecated]           ...           3 years ago
  • 4.4.1 [deprecated]           ...           3 years ago
  • 4.4.0-0                                ...           3 years ago
  • 4.3.1 [deprecated]           ...           3 years ago
  • 4.3.0 [deprecated]           ...           3 years ago
  • 4.2.1 [deprecated]           ...           3 years ago
  • 4.2.0 [deprecated]           ...           3 years ago
  • 4.1.3-0                                ...           3 years ago
  • 4.1.2 [deprecated]           ...           3 years ago
  • 3.4.1-0                                ...           3 years ago
  • 4.1.1-0                                ...           3 years ago
  • 4.1.1 [deprecated]           ...           3 years ago
  • 4.1.0 [deprecated]           ...           3 years ago
  • 3.5.0 [deprecated]           ...           3 years ago
  • 4.0.3 [deprecated]           ...           3 years ago
  • 4.0.2 [deprecated]           ...           3 years ago
  • 4.0.1 [deprecated]           ...           3 years ago
  • 4.0.0 [deprecated]           ...           3 years ago
  • 3.4.0 [deprecated]           ...           3 years ago
  • 3.3.0 [deprecated]           ...           4 years ago
  • 3.2.1 [deprecated]           ...           4 years ago
  • 3.2.0 [deprecated]           ...           4 years ago
  • 3.1.0 [deprecated]           ...           4 years ago
  • 3.0.0 [deprecated]           ...           4 years ago
  • 2.3.1 [deprecated]           ...           4 years ago
  • 2.3.0 [deprecated]           ...           4 years ago
  • 2.2.0 [deprecated]           ...           4 years ago
  • 2.1.0 [deprecated]           ...           4 years ago
  • 2.0.0 [deprecated]           ...           4 years ago
  • 1.1.0 [deprecated]           ...           4 years ago
  • 1.0.0 [deprecated]           ...           4 years ago
  • 0.1.1 [deprecated]           ...           4 years ago
  • 0.1.0 [deprecated]           ...           4 years ago
  • 0.0.1 [deprecated]           ...           4 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (19)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |