New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/graph-normalizer

Package Overview
Dependencies
Maintainers
182
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/graph-normalizer - npm Package Compare versions

Comparing version 3.0.3 to 3.1.0

.npmignore

17

lib/merge-ways.js

@@ -17,2 +17,3 @@ 'use strict';

options.mergeBridges = (options.mergeBridges === undefined) ? false : options.mergeBridges;
options.mergeJunctions = (options.mergeJunctions === undefined) ? false : options.mergeJunctions;

@@ -79,2 +80,9 @@ // build node and way hashes

)
) ||
(
(!options.mergeJunctions) &&
(
owners[0].properties.junction !==
owners[1].properties.junction
)
)

@@ -156,3 +164,3 @@ ) nodes.delete(node);

// persist oneway, highway, bridge, and tunnel tags if they are present
// persist oneway, highway, bridge, tunnel, and junction tags if they are present
if (opening.properties.hasOwnProperty('oneway')) combined.properties.oneway = opening.properties.oneway;

@@ -177,4 +185,9 @@

else if (closing.properties.hasOwnProperty('tunnel')) combined.properties.tunnel = closing.properties.tunnel;
} else if (opening.properties.hasOwnProperty('tunnel')) combined.properties.bridge = opening.properties.bridge;
} else if (opening.properties.hasOwnProperty('tunnel')) combined.properties.tunnel = opening.properties.tunnel;
if (options.mergeJunctions) {
if (opening.properties.hasOwnProperty('junction')) combined.properties.junction = opening.properties.junction;
else if (closing.properties.hasOwnProperty('junction')) combined.properties.junction = closing.properties.junction;
} else if (opening.properties.hasOwnProperty('junction')) combined.properties.junction = opening.properties.junction;
// insert combined way into hash

@@ -181,0 +194,0 @@ ways[combined.properties.id] = combined;

@@ -56,2 +56,3 @@ 'use strict';

if (way.properties.hasOwnProperty('ref')) waySlice.properties.ref = way.properties.ref;
if (way.properties.hasOwnProperty('junction')) waySlice.properties.junction = way.properties.junction;

@@ -83,2 +84,3 @@ splitWays.push(waySlice);

if (way.properties.hasOwnProperty('ref')) waySlice.properties.ref = way.properties.ref;
if (way.properties.hasOwnProperty('junction')) waySlice.properties.junction = way.properties.junction;

@@ -85,0 +87,0 @@ splitWays.push(waySlice);

2

package.json
{
"name": "@mapbox/graph-normalizer",
"version": "3.0.3",
"version": "3.1.0",
"description": "Takes nodes and ways and turn them into a normalized graph of intersections and ways.",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -66,7 +66,7 @@ # Graph-normalizer

- Normalized way ids keep track of the history of transformations that led to it.
- `highway`, `oneway`, `bridge` and `tunnel` tags are conserved from the original graph by default.
- `highway`, `bridge` and `tunnel` tags can be merged using optional arguments. When merging different tags:
- `highway`, `oneway`, `bridge`, `tunnel` and `junction` tags are conserved from the original graph by default.
- `highway`, `bridge`, `tunnel` and `junction` tags can be merged using optional arguments. When merging different tags:
- `highway` tag is set as `unclassified`
- `tunnel` tag is set to `yes` i.e. we keep the info that there is a tunnel in the merged way
- `bridge` tag is set to `yes` i.e. we keep the info that there is a bridge in the merged way
- `junction` tag is set we keep the info about the junction in the merged way
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