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

osmtogeojson

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osmtogeojson - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

parse_osmxml.js

5

CHANGELOG.md

@@ -0,1 +1,6 @@

1.4.0
-----
* fix various speed bottlenecks (xml parsing, geojson construction, …)
* better performance when handling large xml files with the cli tool: ![](https://f.cloud.github.com/assets/1927298/1461813/4a1ce53e-44ce-11e3-9a96-d600eb3aba9b.png)
1.3.1

@@ -2,0 +7,0 @@ -----

17

osmtogeojson.js

@@ -116,4 +116,2 @@ if (typeof require !== "undefined") {

function _overpassJSON2geoJSON(json) {
// create copy of json to make sure the original object doesn't get altered
json = JSON.parse(JSON.stringify(json));
// sort elements

@@ -123,12 +121,21 @@ var nodes = new Array();

var rels = new Array();
// create copies of individual json objects to make sure the original data doesn't get altered
// todo: cloning is slow: see if this can be done differently!
for (var i=0;i<json.elements.length;i++) {
switch (json.elements[i].type) {
case "node":
nodes.push(json.elements[i]);
var node = _.clone(json.elements[i]);
// todo: this clone could be avoided if we didn't store relations directly within the raw data
// see https://github.com/tyrasd/osmtogeojson/blob/gh-pages/osmtogeojson.js#L298-L302
nodes.push(node);
break;
case "way":
ways.push(json.elements[i]);
var way = _.clone(json.elements[i]);
way.nodes = _.clone(way.nodes);
ways.push(way);
break;
case "relation":
rels.push(json.elements[i]);
var rel = _.clone(json.elements[i]);
rel.members = _.clone(rel.members);
rels.push(rel);
break;

@@ -135,0 +142,0 @@ default:

{
"name": "osmtogeojson",
"version": "1.3.1",
"version": "1.4.0",
"description": "convert OSM to geojson",

@@ -29,3 +29,4 @@ "main": "osmtogeojson.js",

"optimist": "~0.3.5",
"concat-stream": "~1.0.1"
"concat-stream": "~1.0.1",
"htmlparser2": "~3.0.5"
},

@@ -32,0 +33,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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