
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
@mapbox/graph-normalizer
Advanced tools
Takes nodes and ways and turn them into a normalized graph of intersections and ways.
graph-normalizer
is a Command Line Interface that pipes in a geojson file of ways (usually at the z7 level), and outputs normalized pieces of graph at a given zoom level.
This package is intended as a utility for graph-tiler, but can be used on its own.
npm install @mapbox/graph-normlizer
node_modules/graph-normalizer/bin/normalize-ways \
--waysFile <geojson line-delimited ways file> \
--outputPath <output path> \
--zoomLevel <output zoom level - default 14>
The output is a number of files, named <quadkey>.json
, of line-delimited geojson way features.
It satisfies the following constraints:
highway
and oneway
tags are conserved from the original graph.Edges that are shared by multiple tiles are conserved in all of them.
It is recommended to keep the output zoom level high, as performance might drop when trying to normalize at a larger scale.
graph-normalizer
expects geojson LineString features that have a refs
property, each ref corresponding to the node id of the matching coordinates in the geometry.coordinates
array.
Any way that does not respect this constraint will be dropped.
The algorithm follows this workflow:
Indexing - It loads the ways into memory and indexes their segments into the quadkey(s) of the target zoom level in which they land.
Tiling - For each quadkey, it reconstructs each way from its segments. The segments of the original way that do not intersect with the tile are effectively dropped from this tile. Conversely, any segment that overlaps multiple tiles will be duplicated in all tiles.
Splitting - Having the ways from each quadkey, graph-normalizer
then splits the ways that traverse an intersection into two. !<i>
is appended to the way id where i
is the index of the split way in the original geometry.
Merging - Ways that share a node which is not an intersection (only 2 way owners) are merged together. The resulting id is <wayOne>,<wayTwo>
.
One car work at lower zoom level by stitching neighbors normalized graphs at zoom level 14. The output is merging cutted ways on the boundaries and duplicate ways. This is especially useful for turn-analysis.
One can first concatenate normalized ways geojson file into one
node_modules/graph-normalizer/util/concatenate-files \
--waysDir <directory of unzipped normalized ways geojson files> > <desired output path>
Then use this output to generate the graph
node_modules/graph-normalizer/bin/stitch-normalized-ways \
--waysFile <geojson line-delimited concatenaed normalized ways file>
The output is a stream of line-delimited geojson way features.
FAQs
Takes nodes and ways and turn them into a normalized graph of intersections and ways.
The npm package @mapbox/graph-normalizer receives a total of 120 weekly downloads. As such, @mapbox/graph-normalizer popularity was classified as not popular.
We found that @mapbox/graph-normalizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
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.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.