Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compare-geojson

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compare-geojson

Compare a features new and old versions in GeoJSON

  • 4.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
4
Weekly downloads
 
Created
Source

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
  • 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?

FAQs

Package last updated on 08 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc