@mapbox/graph-normalizer
Advanced tools
Comparing version 2.3.2 to 2.3.3
@@ -11,6 +11,11 @@ 'use strict'; | ||
ways.forEach(function (way) { | ||
way.properties.refs.forEach(function (ref) { | ||
way.properties.refs.forEach(function (ref, i) { | ||
if (!nodeHash[ref]) nodeHash[ref] = {}; | ||
nodeHash[ref][way.properties.id] = true; | ||
if (way.properties.oneway === 0) { | ||
nodeHash[ref][way.properties.id + '!' + i] = true; | ||
} else { | ||
nodeHash[ref][way.properties.id] = true; | ||
} | ||
}); | ||
@@ -45,3 +50,3 @@ }); | ||
// persist oneway, highway, bridge, tunnel tags if they are present | ||
// persist oneway, highway, bridge, tunnel, name, and ref tags if they are present | ||
if (way.properties.hasOwnProperty('oneway')) waySlice.properties.oneway = way.properties.oneway; | ||
@@ -51,2 +56,4 @@ if (way.properties.hasOwnProperty('highway')) waySlice.properties.highway = way.properties.highway; | ||
if (way.properties.hasOwnProperty('tunnel')) waySlice.properties.tunnel = way.properties.tunnel; | ||
if (way.properties.hasOwnProperty('name')) waySlice.properties.name = way.properties.name; | ||
if (way.properties.hasOwnProperty('ref')) waySlice.properties.ref = way.properties.ref; | ||
@@ -71,3 +78,3 @@ splitWays.push(waySlice); | ||
// persist oneway, highway, bridge, and tunnel tags if they are present | ||
// persist oneway, highway, bridge, tunnel, name, and ref tags if they are present | ||
if (way.properties.hasOwnProperty('oneway')) waySlice.properties.oneway = way.properties.oneway; | ||
@@ -77,2 +84,4 @@ if (way.properties.hasOwnProperty('highway')) waySlice.properties.highway = way.properties.highway; | ||
if (way.properties.hasOwnProperty('tunnel')) waySlice.properties.tunnel = way.properties.tunnel; | ||
if (way.properties.hasOwnProperty('name')) waySlice.properties.name = way.properties.name; | ||
if (way.properties.hasOwnProperty('ref')) waySlice.properties.ref = way.properties.ref; | ||
@@ -79,0 +88,0 @@ splitWays.push(waySlice); |
{ | ||
"name": "@mapbox/graph-normalizer", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "Takes nodes and ways and turn them into a normalized graph of intersections and ways.", | ||
@@ -5,0 +5,0 @@ "bin": "./bin/normalize-ways", |
@@ -12,3 +12,3 @@ # Graph-normalizer | ||
`npm install @mapbox/graph-normlizer` | ||
`npm install @mapbox/graph-normalizer` | ||
@@ -15,0 +15,0 @@ ### Usage |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2381564
107
847
3