osmtogeojson
Advanced tools
Comparing version 3.0.0-beta.2 to 3.0.0-beta.3
@@ -0,1 +1,6 @@ | ||
3.0.0-beta.3 | ||
------------ | ||
* add typescript definitions #81 thanks @enko! | ||
* fix a bug (https://github.com/tyrasd/overpass-turbo/issues/353) where duplicate multipolygon members in input produced wrong and broken geojson output | ||
3.0.0-beta.2 | ||
@@ -2,0 +7,0 @@ ------------ |
13
index.js
@@ -1020,2 +1020,5 @@ var _ = require("./lodash.custom.js"); | ||
var _last = function(arr) {return arr[arr.length-1]}; | ||
var _fitTogether = function(n1, n2) { | ||
return n1 !== undefined && n2 !== undefined && n1.id === n2.id; | ||
} | ||
// stolen from iD/relation.js | ||
@@ -1026,3 +1029,3 @@ var joined = [], current, first, last, i, how, what; | ||
joined.push(current); | ||
while (ways.length && _first(current) !== _last(current)) { | ||
while (ways.length && !_fitTogether(_first(current), _last(current))) { | ||
first = _first(current); | ||
@@ -1032,15 +1035,15 @@ last = _last(current); | ||
what = ways[i].nodes; | ||
if (last === _first(what)) { | ||
if (_fitTogether(last, _first(what))) { | ||
how = current.push; | ||
what = what.slice(1); | ||
break; | ||
} else if (last === _last(what)) { | ||
} else if (_fitTogether(last, _last(what))) { | ||
how = current.push; | ||
what = what.slice(0, -1).reverse(); | ||
break; | ||
} else if (first == _last(what)) { | ||
} else if (_fitTogether(first, _last(what))) { | ||
how = current.unshift; | ||
what = what.slice(0, -1); | ||
break; | ||
} else if (first == _first(what)) { | ||
} else if (_fitTogether(first, _first(what))) { | ||
how = current.unshift; | ||
@@ -1047,0 +1050,0 @@ what = what.slice(1).reverse(); |
{ | ||
"name": "osmtogeojson", | ||
"version": "3.0.0-beta.2", | ||
"version": "3.0.0-beta.3", | ||
"description": "convert OSM to geojson", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
@@ -39,2 +40,5 @@ "pretest": "npm ls --depth=Infinity > /dev/null", | ||
}, | ||
"optionalDependencies": { | ||
"@types/geojson": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
@@ -41,0 +45,0 @@ "expect.js": "~0.2.0", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
419339
27
11198
10