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

georender-pack

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

georender-pack - npm Package Compare versions

Comparing version 4.2.3 to 4.2.4

lib/get-loops.js

38

decode.js
var getNormals = require('polyline-normals')
var varint = require('varint')
var makeEdgeGraph = require('./lib/makeEdgeGraph.js')
var getLoops = require('./lib/get-loops.js')

@@ -29,6 +29,6 @@ module.exports = function (buffers) {

offset+=varint.decode.bytes
sizes.line.types+=plen*2+2
sizes.line.ids+=plen*2+2
sizes.line.positions+=plen*4+4
sizes.line.normals+=plen*4+4
sizes.line.types+=plen*2+3
sizes.line.ids+=plen*2+3
sizes.line.positions+=plen*4+6
sizes.line.normals+=plen*4+6
}

@@ -242,14 +242,5 @@ else if (featureType === 3) {

}
var edgeGraph = makeEdgeGraph(cells)
var start = 0
for (var j=0; j<positions.length; j++) {
var a = j
var b = (j+1)%positions.length
var ab = a + ',' + b
if ((ab !== '0,1' && edgeGraph[ab] !==1) || j === positions.length-1) {
var pos = positions.slice(start, j+1)
if (pos.length === 0) continue
start = j+1
addAreaBorderPositions(data, offsets, pos, id, type)
}
var loops = getLoops(cells, positions)
for (var i=0; i <loops.length; i++) {
addAreaBorderPositions(data, offsets, loops[i], id, type, false)
}

@@ -292,3 +283,3 @@ pindex+=plen

if (e === 0) { // edge break
addAreaBorderPositions(data, offsets, positions, id, type)
addAreaBorderPositions(data, offsets, positions, id, type, false)
positions = []

@@ -314,3 +305,3 @@ } else if (e % 2 === 0) { // edge index

}
addAreaBorderPositions(data, offsets, positions, id, type)
addAreaBorderPositions(data, offsets, positions, id, type, false)
pindex+=plen

@@ -320,2 +311,7 @@ offset = decodeLabels(buf, offset, data.area, id)

}
if (offsets.areaBorder.types !== data.areaBorder.types.length) {
data.areaBorder.types = data.areaBorder.types.subarray(0, offsets.areaBorder.types)
data.areaBorder.positions = data.areaBorder.positions.subarray(0, offsets.areaBorder.positions)
data.areaBorder.normals = data.areaBorder.normals.subarray(0, offsets.areaBorder.normals)
}
return data

@@ -337,3 +333,3 @@ }

function addAreaBorderPositions(data, offsets, positions, id, type) {
function addAreaBorderPositions(data, offsets, positions, id, type, closed) {
if (positions.length < 2) return

@@ -359,3 +355,3 @@ var positionsCount = 2+6+(4*positions.length)

}
var normals = getNormals(positions, false)
var normals = getNormals(positions, closed)
var scale = Math.sqrt(normals[0][1])

@@ -362,0 +358,0 @@ data.areaBorder.ids[offsets.areaBorder.ids++] = id

{
"name": "georender-pack",
"version": "4.2.3",
"version": "4.2.4",
"description": "pack and unpack osm data based on the peermaps buffer schema",

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

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