![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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-normalizer
node_modules/graph-normalizer/bin/normalize-ways \
--waysFile <geojson line-delimited ways file> \
--outputPath <output path> \
--zoomLevel <output zoom level - default 14> \
--mergeHighways <optional - merge ways with different highway tags - default false> \
--mergeTunnels <optional - merge ways with different tunnel tags - default false> \
--mergeBridges <optional - merge ways with different bridge tags - default false>
The output is a number of files, named <quadkey>.json
, of line-delimited geojson way features.
It satisfies the following constraints:
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
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 waybridge
tag is set to yes
i.e. we keep the info that there is a bridge in the merged wayEdges 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>
.
npm test
npm run bench
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 55 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.