@loaders.gl/gis
Advanced tools
Comparing version 2.3.0-alpha.3 to 2.3.0-alpha.4
@@ -161,5 +161,5 @@ "use strict"; | ||
for (var i = 0; i < primitivePolygonIndices.length - 1; i++) { | ||
var startPolygonIndex = primitivePolygonIndices[i]; | ||
var endPolygonIndex = primitivePolygonIndices[i + 1]; | ||
var ringCoordinates = ringToGeoJson(positions, startPolygonIndex, endPolygonIndex); | ||
var startRingIndex = primitivePolygonIndices[i]; | ||
var endRingIndex = primitivePolygonIndices[i + 1]; | ||
var ringCoordinates = ringToGeoJson(positions, startRingIndex, endRingIndex); | ||
coordinates.push(ringCoordinates); | ||
@@ -174,2 +174,9 @@ } | ||
for (var _i = 0; _i < polygonIndices.length - 1; _i++) { | ||
var startPolygonIndex = polygonIndices[_i]; | ||
var endPolygonIndex = polygonIndices[_i + 1]; | ||
var polygonCoordinates = polygonToGeoJson(data, startPolygonIndex, endPolygonIndex).coordinates; | ||
coordinates.push(polygonCoordinates); | ||
} | ||
return { | ||
@@ -176,0 +183,0 @@ type: 'MultiPolygon', |
@@ -136,5 +136,5 @@ export function binaryToGeoJson(data, type, format) { | ||
for (let i = 0; i < primitivePolygonIndices.length - 1; i++) { | ||
const startPolygonIndex = primitivePolygonIndices[i]; | ||
const endPolygonIndex = primitivePolygonIndices[i + 1]; | ||
const ringCoordinates = ringToGeoJson(positions, startPolygonIndex, endPolygonIndex); | ||
const startRingIndex = primitivePolygonIndices[i]; | ||
const endRingIndex = primitivePolygonIndices[i + 1]; | ||
const ringCoordinates = ringToGeoJson(positions, startRingIndex, endRingIndex); | ||
coordinates.push(ringCoordinates); | ||
@@ -149,2 +149,9 @@ } | ||
for (let i = 0; i < polygonIndices.length - 1; i++) { | ||
const startPolygonIndex = polygonIndices[i]; | ||
const endPolygonIndex = polygonIndices[i + 1]; | ||
const polygonCoordinates = polygonToGeoJson(data, startPolygonIndex, endPolygonIndex).coordinates; | ||
coordinates.push(polygonCoordinates); | ||
} | ||
return { | ||
@@ -151,0 +158,0 @@ type: 'MultiPolygon', |
@@ -154,5 +154,5 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
for (var i = 0; i < primitivePolygonIndices.length - 1; i++) { | ||
var startPolygonIndex = primitivePolygonIndices[i]; | ||
var endPolygonIndex = primitivePolygonIndices[i + 1]; | ||
var ringCoordinates = ringToGeoJson(positions, startPolygonIndex, endPolygonIndex); | ||
var startRingIndex = primitivePolygonIndices[i]; | ||
var endRingIndex = primitivePolygonIndices[i + 1]; | ||
var ringCoordinates = ringToGeoJson(positions, startRingIndex, endRingIndex); | ||
coordinates.push(ringCoordinates); | ||
@@ -167,2 +167,9 @@ } | ||
for (var _i = 0; _i < polygonIndices.length - 1; _i++) { | ||
var startPolygonIndex = polygonIndices[_i]; | ||
var endPolygonIndex = polygonIndices[_i + 1]; | ||
var polygonCoordinates = polygonToGeoJson(data, startPolygonIndex, endPolygonIndex).coordinates; | ||
coordinates.push(polygonCoordinates); | ||
} | ||
return { | ||
@@ -169,0 +176,0 @@ type: 'MultiPolygon', |
{ | ||
"name": "@loaders.gl/gis", | ||
"description": "Helpers for GIS category data", | ||
"version": "2.3.0-alpha.3", | ||
"version": "2.3.0-alpha.4", | ||
"license": "MIT", | ||
@@ -28,7 +28,7 @@ "publishConfig": { | ||
"dependencies": { | ||
"@loaders.gl/loader-utils": "2.3.0-alpha.3", | ||
"@loaders.gl/loader-utils": "2.3.0-alpha.4", | ||
"@mapbox/vector-tile": "^1.3.1", | ||
"pbf": "^3.2.1" | ||
}, | ||
"gitHead": "158b60c49764104b4c1ba293a841488062402861" | ||
"gitHead": "f2eee920e819daba5e19c840a2270c4d0c7dda39" | ||
} |
@@ -129,7 +129,8 @@ // Top-level function to convert input of binary arrays to GeoJSON | ||
const coordinates = []; | ||
// Polygon | ||
if (!multi) { | ||
for (let i = 0; i < primitivePolygonIndices.length - 1; i++) { | ||
const startPolygonIndex = primitivePolygonIndices[i]; | ||
const endPolygonIndex = primitivePolygonIndices[i + 1]; | ||
const ringCoordinates = ringToGeoJson(positions, startPolygonIndex, endPolygonIndex); | ||
const startRingIndex = primitivePolygonIndices[i]; | ||
const endRingIndex = primitivePolygonIndices[i + 1]; | ||
const ringCoordinates = ringToGeoJson(positions, startRingIndex, endRingIndex); | ||
coordinates.push(ringCoordinates); | ||
@@ -141,3 +142,11 @@ } | ||
// TODO handle MultiPolygon | ||
// MultiPolygon | ||
for (let i = 0; i < polygonIndices.length - 1; i++) { | ||
const startPolygonIndex = polygonIndices[i]; | ||
const endPolygonIndex = polygonIndices[i + 1]; | ||
const polygonCoordinates = polygonToGeoJson(data, startPolygonIndex, endPolygonIndex) | ||
.coordinates; | ||
coordinates.push(polygonCoordinates); | ||
} | ||
return {type: 'MultiPolygon', coordinates}; | ||
@@ -144,0 +153,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
238337
2659
+ Added@loaders.gl/loader-utils@2.3.0-alpha.4(transitive)
- Removed@loaders.gl/loader-utils@2.3.0-alpha.3(transitive)