compare-geojson
Advanced tools
Comparing version 4.3.1 to 4.4.0-0
@@ -12,4 +12,3 @@ 'use strict'; | ||
'path_road_changed': require('./comparators/path_road_changed'), | ||
'major_lake_changed': require('./comparators/major-lake-modified'), | ||
'pokemon_footway': require('./comparators/pokemon-footway') | ||
'place_edited': require('./comparators/place-edited') | ||
}; |
{ | ||
"name": "compare-geojson", | ||
"version": "4.3.1", | ||
"version": "4.4.0-0", | ||
"description": "Compare a features new and old versions in GeoJSON", | ||
@@ -19,6 +19,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"moment": "^2.17.1", | ||
"lodash": "^4.17.3", | ||
"queue-async": "^1.2.1", | ||
"request": "^2.72.0", | ||
"sax": "^1.2.1", | ||
"sqlite3": "^3.1.3", | ||
@@ -25,0 +24,0 @@ "turf-area": "^1.1.1", |
@@ -8,3 +8,2 @@ # 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: | ||
1. Property (tags) checking compare function | ||
@@ -24,16 +23,26 @@ 2. Geometry checking compare functions | ||
```sh | ||
# 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': {} | ||
} | ||
#### Versioning | ||
The version of the compare function is returned as part of the result as `cfVersion`. Every time a compare function is modified, we increment the value of `cfVersion`. | ||
A sample compare function would look something like this: | ||
``` | ||
function place_removed(newVersion, oldVersion, callback) { | ||
var cfVersion = 2; | ||
var oldProps = oldVersion.properties; | ||
var newProps = newVersion.properties; | ||
var placeRemoved = false; | ||
if (oldProps.hasOwnProperty('place') && !newProps.hasOwnProperty('place')) { | ||
placeRemoved = true; | ||
} | ||
return callback(null, {'result:place_removed': { | ||
'cfVersion': cfVersion, | ||
'placeRemoved': placeRemoved | ||
}}); | ||
} | ||
``` | ||
### How do I create a new compare function? | ||
@@ -45,14 +54,15 @@ * Clone this repository with `git clone https://github.com/mapbox/compare-geojson` | ||
* 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) | ||
* Create a new compare function in the directory `comparators/` | ||
* Test your new compare function with `npm test` | ||
* Add your new comparator to `index.js` | ||
* 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` | ||
* Create new fixture file in `tests/fixtures/` folder (check other fixtures for format). | ||
* Update name of compare function you want to run the fixture against. | ||
* Test your fixture with `node test_compare_function.js fixtures/new_mapper.json` | ||
### How do I build an npm package? | ||
- Add your new comparator to `index.js` | ||
- We use [Semantic Versioning Specification](http://semver.org/) for versioning releases. | ||
@@ -59,0 +69,0 @@ - Create an appropriate version of the npm package with `npm version [major|minor|patch]`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
1777427
10
27141
0
69
100
2
+ Addedlodash@^4.17.3
+ Addedlodash@4.17.21(transitive)
- Removedmoment@^2.17.1
- Removedsax@^1.2.1
- Removedmoment@2.30.1(transitive)
- Removedsax@1.4.1(transitive)