@kepler.gl/processors 3.3.0-alpha.2 → 3.3.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/data-processor.js +674 -0
- package/dist/cjs/data-processor.js.map +1 -0
- package/dist/cjs/export/dataset-to-geojson.js +138 -0
- package/dist/cjs/export/dataset-to-geojson.js.map +1 -0
- package/dist/cjs/export/geopackage-writer.js +385 -0
- package/dist/cjs/export/geopackage-writer.js.map +1 -0
- package/dist/cjs/export/geoparquet-writer.js +351 -0
- package/dist/cjs/export/geoparquet-writer.js.map +1 -0
- package/dist/cjs/export/kml-writer.js +347 -0
- package/dist/cjs/export/kml-writer.js.map +1 -0
- package/dist/cjs/export/shapefile-writer.js +708 -0
- package/dist/cjs/export/shapefile-writer.js.map +1 -0
- package/dist/cjs/export/sql-js.js +95 -0
- package/dist/cjs/export/sql-js.js.map +1 -0
- package/dist/cjs/export/vector-export.js +187 -0
- package/dist/cjs/export/vector-export.js.map +1 -0
- package/dist/cjs/file-handler.js +997 -0
- package/dist/cjs/file-handler.js.map +1 -0
- package/dist/cjs/index.js +114 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/kepler-csv-loader.js +163 -0
- package/dist/cjs/kepler-csv-loader.js.map +1 -0
- package/dist/cjs/loader-registry.js +542 -0
- package/dist/cjs/loader-registry.js.map +1 -0
- package/dist/cjs/remote-file.js +675 -0
- package/dist/cjs/remote-file.js.map +1 -0
- package/dist/cjs/shapefile-files.js +281 -0
- package/dist/cjs/shapefile-files.js.map +1 -0
- package/dist/cjs/types.js +6 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/data-processor.d.ts +30 -16
- package/dist/esm/data-processor.js +655 -0
- package/dist/esm/data-processor.js.map +1 -0
- package/dist/esm/export/dataset-to-geojson.js +132 -0
- package/dist/esm/export/dataset-to-geojson.js.map +1 -0
- package/dist/esm/export/geopackage-writer.js +381 -0
- package/dist/esm/export/geopackage-writer.js.map +1 -0
- package/dist/esm/export/geoparquet-writer.js +336 -0
- package/dist/esm/export/geoparquet-writer.js.map +1 -0
- package/dist/esm/export/kml-writer.js +341 -0
- package/dist/esm/export/kml-writer.js.map +1 -0
- package/dist/esm/export/shapefile-writer.js +701 -0
- package/dist/esm/export/shapefile-writer.js.map +1 -0
- package/dist/esm/export/sql-js.js +80 -0
- package/dist/esm/export/sql-js.js.map +1 -0
- package/dist/esm/export/vector-export.js +176 -0
- package/dist/esm/export/vector-export.js.map +1 -0
- package/dist/esm/file-handler.js +972 -0
- package/dist/esm/file-handler.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/kepler-csv-loader.js +152 -0
- package/dist/esm/kepler-csv-loader.js.map +1 -0
- package/dist/esm/loader-registry.js +510 -0
- package/dist/esm/loader-registry.js.map +1 -0
- package/dist/esm/remote-file.js +664 -0
- package/dist/esm/remote-file.js.map +1 -0
- package/dist/esm/shapefile-files.js +264 -0
- package/dist/esm/shapefile-files.js.map +1 -0
- package/dist/esm/types.js +3 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/export/dataset-to-geojson.d.ts +12 -0
- package/dist/export/geopackage-writer.d.ts +28 -0
- package/dist/export/geoparquet-writer.d.ts +7 -0
- package/dist/export/kml-writer.d.ts +13 -0
- package/dist/export/shapefile-writer.d.ts +28 -0
- package/dist/export/sql-js.d.ts +8 -0
- package/dist/export/vector-export.d.ts +22 -0
- package/dist/file-handler.d.ts +55 -8
- package/dist/index.d.ts +6 -0
- package/dist/kepler-csv-loader.d.ts +12 -0
- package/dist/loader-registry.d.ts +29 -0
- package/dist/remote-file.d.ts +79 -0
- package/dist/shapefile-files.d.ts +39 -0
- package/dist/types.d.ts +13 -0
- package/package.json +44 -26
- package/dist/data-processor.js +0 -637
- package/dist/file-handler.js +0 -409
- package/dist/index.js +0 -39
- package/dist/types.js +0 -6
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.KmlCoordinateError = void 0;
|
|
8
|
+
exports.writeKml = writeKml;
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
+
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
|
+
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
19
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
// SPDX-License-Identifier: MIT
|
|
25
|
+
// Copyright contributors to the kepler.gl project
|
|
26
|
+
// Adapted from GeoLibre (https://github.com/opengeos/GeoLibre), MIT License.
|
|
27
|
+
var KmlCoordinateError = exports.KmlCoordinateError = /*#__PURE__*/function (_Error) {
|
|
28
|
+
function KmlCoordinateError(featureIndex, featureId) {
|
|
29
|
+
var _this;
|
|
30
|
+
(0, _classCallCheck2["default"])(this, KmlCoordinateError);
|
|
31
|
+
_this = _callSuper(this, KmlCoordinateError, ["Feature ".concat(featureId !== null && featureId !== void 0 ? featureId : featureIndex, " has a coordinate that KML cannot represent.")]);
|
|
32
|
+
_this.name = 'KmlCoordinateError';
|
|
33
|
+
return _this;
|
|
34
|
+
}
|
|
35
|
+
(0, _inherits2["default"])(KmlCoordinateError, _Error);
|
|
36
|
+
return (0, _createClass2["default"])(KmlCoordinateError);
|
|
37
|
+
}(/*#__PURE__*/(0, _wrapNativeSuper2["default"])(Error));
|
|
38
|
+
var KML_NAMESPACE = 'http://www.opengis.net/kml/2.2';
|
|
39
|
+
var InvalidCoordinateError = /*#__PURE__*/function (_Error2) {
|
|
40
|
+
function InvalidCoordinateError() {
|
|
41
|
+
(0, _classCallCheck2["default"])(this, InvalidCoordinateError);
|
|
42
|
+
return _callSuper(this, InvalidCoordinateError, arguments);
|
|
43
|
+
}
|
|
44
|
+
(0, _inherits2["default"])(InvalidCoordinateError, _Error2);
|
|
45
|
+
return (0, _createClass2["default"])(InvalidCoordinateError);
|
|
46
|
+
}(/*#__PURE__*/(0, _wrapNativeSuper2["default"])(Error));
|
|
47
|
+
function xmlSafeText(value) {
|
|
48
|
+
return stripDisallowedControls(String(value)).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** XML 1.0 disallows these controls. Tab, newline, and carriage return stay. */
|
|
52
|
+
function stripDisallowedControls(value) {
|
|
53
|
+
var result = '';
|
|
54
|
+
var _iterator = _createForOfIteratorHelper(value),
|
|
55
|
+
_step;
|
|
56
|
+
try {
|
|
57
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
58
|
+
var _char = _step.value;
|
|
59
|
+
var code = _char.charCodeAt(0);
|
|
60
|
+
var disallowed = code <= 0x08 || code === 0x0b || code === 0x0c || code >= 0x0e && code <= 0x1f;
|
|
61
|
+
result += disallowed ? "\uFFFD" : _char;
|
|
62
|
+
}
|
|
63
|
+
} catch (err) {
|
|
64
|
+
_iterator.e(err);
|
|
65
|
+
} finally {
|
|
66
|
+
_iterator.f();
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
function indentXml(xml, spaces) {
|
|
71
|
+
var indentation = ' '.repeat(spaces);
|
|
72
|
+
return xml.split('\n').map(function (line) {
|
|
73
|
+
return "".concat(indentation).concat(line);
|
|
74
|
+
}).join('\n');
|
|
75
|
+
}
|
|
76
|
+
function decimalText(value) {
|
|
77
|
+
var text = String(value);
|
|
78
|
+
var match = /^(-?)(\d+)(?:\.(\d+))?e([+-]?\d+)$/i.exec(text);
|
|
79
|
+
if (!match) return text;
|
|
80
|
+
var _match = (0, _slicedToArray2["default"])(match, 5),
|
|
81
|
+
sign = _match[1],
|
|
82
|
+
integer = _match[2],
|
|
83
|
+
_match$ = _match[3],
|
|
84
|
+
fraction = _match$ === void 0 ? '' : _match$,
|
|
85
|
+
rawExponent = _match[4];
|
|
86
|
+
var digits = "".concat(integer).concat(fraction);
|
|
87
|
+
var decimalIndex = integer.length + Number(rawExponent);
|
|
88
|
+
if (decimalIndex <= 0) {
|
|
89
|
+
return "".concat(sign, "0.").concat('0'.repeat(-decimalIndex)).concat(digits);
|
|
90
|
+
}
|
|
91
|
+
if (decimalIndex >= digits.length) {
|
|
92
|
+
return "".concat(sign).concat(digits).concat('0'.repeat(decimalIndex - digits.length));
|
|
93
|
+
}
|
|
94
|
+
return "".concat(sign).concat(digits.slice(0, decimalIndex), ".").concat(digits.slice(decimalIndex));
|
|
95
|
+
}
|
|
96
|
+
function positionText(position) {
|
|
97
|
+
if (position.length < 2 || position.slice(0, 3).some(function (value) {
|
|
98
|
+
return !Number.isFinite(value);
|
|
99
|
+
})) {
|
|
100
|
+
throw new InvalidCoordinateError();
|
|
101
|
+
}
|
|
102
|
+
return position.slice(0, 3).map(function (value) {
|
|
103
|
+
return decimalText(value);
|
|
104
|
+
}).join(',');
|
|
105
|
+
}
|
|
106
|
+
function coordinatesText(positions) {
|
|
107
|
+
return positions.map(positionText).join(' ');
|
|
108
|
+
}
|
|
109
|
+
function hasAltitude(position) {
|
|
110
|
+
// KML applies altitude mode to the entire geometry. For mixed-dimensional
|
|
111
|
+
// GeoJSON, preserve supplied altitudes and let KML interpret 2D vertices as
|
|
112
|
+
// having its implicit zero altitude.
|
|
113
|
+
return position.length >= 3;
|
|
114
|
+
}
|
|
115
|
+
function closedRing(ring) {
|
|
116
|
+
if (ring.length === 0) return ring;
|
|
117
|
+
var first = ring[0];
|
|
118
|
+
var last = ring[ring.length - 1];
|
|
119
|
+
if (first.length === last.length && first.every(function (coordinate, index) {
|
|
120
|
+
return coordinate === last[index];
|
|
121
|
+
})) {
|
|
122
|
+
return ring;
|
|
123
|
+
}
|
|
124
|
+
return [].concat((0, _toConsumableArray2["default"])(ring), [first]);
|
|
125
|
+
}
|
|
126
|
+
function polygonKml(coordinates) {
|
|
127
|
+
var _coordinates = (0, _toArray2["default"])(coordinates),
|
|
128
|
+
outer = _coordinates[0],
|
|
129
|
+
inner = _coordinates.slice(1);
|
|
130
|
+
var boundaries = [];
|
|
131
|
+
if (outer) {
|
|
132
|
+
boundaries.push('<outerBoundaryIs>', ' <LinearRing>', " <coordinates>".concat(coordinatesText(closedRing(outer)), "</coordinates>"), ' </LinearRing>', '</outerBoundaryIs>');
|
|
133
|
+
}
|
|
134
|
+
var _iterator2 = _createForOfIteratorHelper(inner),
|
|
135
|
+
_step2;
|
|
136
|
+
try {
|
|
137
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
138
|
+
var ring = _step2.value;
|
|
139
|
+
boundaries.push('<innerBoundaryIs>', ' <LinearRing>', " <coordinates>".concat(coordinatesText(closedRing(ring)), "</coordinates>"), ' </LinearRing>', '</innerBoundaryIs>');
|
|
140
|
+
}
|
|
141
|
+
} catch (err) {
|
|
142
|
+
_iterator2.e(err);
|
|
143
|
+
} finally {
|
|
144
|
+
_iterator2.f();
|
|
145
|
+
}
|
|
146
|
+
if (boundaries.length === 0) return '<Polygon />';
|
|
147
|
+
var contents = coordinates.some(function (ring) {
|
|
148
|
+
return ring.some(hasAltitude);
|
|
149
|
+
}) ? ['<altitudeMode>absolute</altitudeMode>'].concat(boundaries) : boundaries;
|
|
150
|
+
return "<Polygon>\n".concat(indentXml(contents.join('\n'), 2), "\n</Polygon>");
|
|
151
|
+
}
|
|
152
|
+
function multiGeometryKml(geometries) {
|
|
153
|
+
if (geometries.length === 0) return '<MultiGeometry />';
|
|
154
|
+
return "<MultiGeometry>\n".concat(geometries.map(function (geometry) {
|
|
155
|
+
return indentXml(geometryKml(geometry), 2);
|
|
156
|
+
}).join('\n'), "\n</MultiGeometry>");
|
|
157
|
+
}
|
|
158
|
+
function geometryKml(geometry) {
|
|
159
|
+
switch (geometry.type) {
|
|
160
|
+
case 'Point':
|
|
161
|
+
return "<Point>".concat(hasAltitude(geometry.coordinates) ? '<altitudeMode>absolute</altitudeMode>' : '', "<coordinates>").concat(positionText(geometry.coordinates), "</coordinates></Point>");
|
|
162
|
+
case 'MultiPoint':
|
|
163
|
+
return multiGeometryKml(geometry.coordinates.map(function (coordinates) {
|
|
164
|
+
return {
|
|
165
|
+
type: 'Point',
|
|
166
|
+
coordinates: coordinates
|
|
167
|
+
};
|
|
168
|
+
}));
|
|
169
|
+
case 'LineString':
|
|
170
|
+
return "<LineString>".concat(geometry.coordinates.some(hasAltitude) ? '<altitudeMode>absolute</altitudeMode>' : '', "<coordinates>").concat(coordinatesText(geometry.coordinates), "</coordinates></LineString>");
|
|
171
|
+
case 'MultiLineString':
|
|
172
|
+
return multiGeometryKml(geometry.coordinates.map(function (coordinates) {
|
|
173
|
+
return {
|
|
174
|
+
type: 'LineString',
|
|
175
|
+
coordinates: coordinates
|
|
176
|
+
};
|
|
177
|
+
}));
|
|
178
|
+
case 'Polygon':
|
|
179
|
+
return polygonKml(geometry.coordinates);
|
|
180
|
+
case 'MultiPolygon':
|
|
181
|
+
return multiGeometryKml(geometry.coordinates.map(function (coordinates) {
|
|
182
|
+
return {
|
|
183
|
+
type: 'Polygon',
|
|
184
|
+
coordinates: coordinates
|
|
185
|
+
};
|
|
186
|
+
}));
|
|
187
|
+
case 'GeometryCollection':
|
|
188
|
+
return multiGeometryKml(geometry.geometries);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function propertyText(value) {
|
|
192
|
+
if (value == null) return '';
|
|
193
|
+
if ((0, _typeof2["default"])(value) !== 'object') return String(value);
|
|
194
|
+
return JSON.stringify(value);
|
|
195
|
+
}
|
|
196
|
+
function propertyElement(properties, key) {
|
|
197
|
+
var value = properties === null || properties === void 0 ? void 0 : properties[key];
|
|
198
|
+
return value == null || (0, _typeof2["default"])(value) === 'object' ? null : "<".concat(key, ">").concat(xmlSafeText(value), "</").concat(key, ">");
|
|
199
|
+
}
|
|
200
|
+
function extendedDataKml(feature) {
|
|
201
|
+
var _feature$properties;
|
|
202
|
+
var properties = (_feature$properties = feature.properties) !== null && _feature$properties !== void 0 ? _feature$properties : {};
|
|
203
|
+
var entries = Object.entries(properties).filter(function (_ref) {
|
|
204
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
205
|
+
key = _ref2[0],
|
|
206
|
+
value = _ref2[1];
|
|
207
|
+
return !((key === 'name' || key === 'description') && value != null && (0, _typeof2["default"])(value) !== 'object');
|
|
208
|
+
});
|
|
209
|
+
if (feature.id != null) {
|
|
210
|
+
var idKey = 'feature_id';
|
|
211
|
+
if (Object.prototype.hasOwnProperty.call(properties, idKey)) {
|
|
212
|
+
idKey = 'geojson_feature_id';
|
|
213
|
+
var suffix = 2;
|
|
214
|
+
while (Object.prototype.hasOwnProperty.call(properties, idKey)) {
|
|
215
|
+
idKey = "geojson_feature_id_".concat(suffix);
|
|
216
|
+
suffix += 1;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
entries.unshift([idKey, feature.id]);
|
|
220
|
+
}
|
|
221
|
+
if (entries.length === 0) return null;
|
|
222
|
+
var data = entries.map(function (_ref3) {
|
|
223
|
+
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
224
|
+
key = _ref4[0],
|
|
225
|
+
value = _ref4[1];
|
|
226
|
+
return "<Data name=\"".concat(xmlSafeText(key), "\"><value>").concat(xmlSafeText(propertyText(value)), "</value></Data>");
|
|
227
|
+
});
|
|
228
|
+
return "<ExtendedData>\n".concat(data.map(function (entry) {
|
|
229
|
+
return indentXml(entry, 2);
|
|
230
|
+
}).join('\n'), "\n</ExtendedData>");
|
|
231
|
+
}
|
|
232
|
+
function opacityByte(value) {
|
|
233
|
+
var defaultOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
234
|
+
var opacity = typeof value === 'number' ? value : Number(value !== null && value !== void 0 ? value : defaultOpacity);
|
|
235
|
+
var normalized = Number.isFinite(opacity) ? Math.min(1, Math.max(0, opacity)) : defaultOpacity;
|
|
236
|
+
return Math.round(normalized * 255).toString(16).padStart(2, '0');
|
|
237
|
+
}
|
|
238
|
+
function kmlColor(color, opacity) {
|
|
239
|
+
var defaultOpacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
240
|
+
if (typeof color !== 'string') return null;
|
|
241
|
+
var match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color.trim());
|
|
242
|
+
if (!match) return null;
|
|
243
|
+
var hex = match[1].length === 3 ? match[1].split('').map(function (digit) {
|
|
244
|
+
return "".concat(digit).concat(digit);
|
|
245
|
+
}).join('') : match[1];
|
|
246
|
+
var red = hex.slice(0, 2);
|
|
247
|
+
var green = hex.slice(2, 4);
|
|
248
|
+
var blue = hex.slice(4, 6);
|
|
249
|
+
return "".concat(opacityByte(opacity, defaultOpacity)).concat(blue).concat(green).concat(red).toLowerCase();
|
|
250
|
+
}
|
|
251
|
+
function styleKml(properties) {
|
|
252
|
+
if (!properties) return null;
|
|
253
|
+
var sections = [];
|
|
254
|
+
var markerColor = kmlColor(properties['marker-color'], properties['marker-opacity']);
|
|
255
|
+
if (markerColor) {
|
|
256
|
+
sections.push("<IconStyle><color>".concat(markerColor, "</color></IconStyle>"));
|
|
257
|
+
}
|
|
258
|
+
var strokeColor = kmlColor(properties.stroke, properties['stroke-opacity']);
|
|
259
|
+
var strokeWidth = Number(properties['stroke-width']);
|
|
260
|
+
if (strokeColor || Number.isFinite(strokeWidth)) {
|
|
261
|
+
var values = [strokeColor ? "<color>".concat(strokeColor, "</color>") : null, Number.isFinite(strokeWidth) ? "<width>".concat(strokeWidth, "</width>") : null].filter(function (value) {
|
|
262
|
+
return value !== null;
|
|
263
|
+
});
|
|
264
|
+
sections.push("<LineStyle>".concat(values.join(''), "</LineStyle>"));
|
|
265
|
+
}
|
|
266
|
+
var fillColor = kmlColor(properties.fill, properties['fill-opacity'], 0.6);
|
|
267
|
+
if (fillColor) {
|
|
268
|
+
sections.push("<PolyStyle><color>".concat(fillColor, "</color></PolyStyle>"));
|
|
269
|
+
}
|
|
270
|
+
if (sections.length === 0) return null;
|
|
271
|
+
return "<Style>".concat(sections.join(''), "</Style>");
|
|
272
|
+
}
|
|
273
|
+
function featureKml(feature, style) {
|
|
274
|
+
var _feature$properties2;
|
|
275
|
+
var properties = (_feature$properties2 = feature.properties) !== null && _feature$properties2 !== void 0 ? _feature$properties2 : {};
|
|
276
|
+
var contents = [propertyElement(properties, 'name'), propertyElement(properties, 'description'), style, extendedDataKml(feature), feature.geometry ? geometryKml(feature.geometry) : null].filter(function (value) {
|
|
277
|
+
return value !== null;
|
|
278
|
+
});
|
|
279
|
+
if (contents.length === 0) return '<Placemark />';
|
|
280
|
+
return "<Placemark>\n".concat(contents.map(function (value) {
|
|
281
|
+
return indentXml(value, 2);
|
|
282
|
+
}).join('\n'), "\n</Placemark>");
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Convert a GeoJSON FeatureCollection to a KML 2.2 document.
|
|
287
|
+
*
|
|
288
|
+
* Feature properties are retained in ExtendedData, except primitive `name` and
|
|
289
|
+
* `description` values that are represented by their native KML elements.
|
|
290
|
+
* Simplestyle properties are also promoted to native KML styles for display in
|
|
291
|
+
* Google Earth and other KML clients.
|
|
292
|
+
*/
|
|
293
|
+
function writeKml(geojson, documentName) {
|
|
294
|
+
var featureStyles = geojson.features.map(function (feature) {
|
|
295
|
+
return styleKml(feature.properties);
|
|
296
|
+
});
|
|
297
|
+
var styleCounts = new Map();
|
|
298
|
+
var _iterator3 = _createForOfIteratorHelper(featureStyles),
|
|
299
|
+
_step3;
|
|
300
|
+
try {
|
|
301
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
302
|
+
var _styleCounts$get;
|
|
303
|
+
var style = _step3.value;
|
|
304
|
+
if (style) styleCounts.set(style, ((_styleCounts$get = styleCounts.get(style)) !== null && _styleCounts$get !== void 0 ? _styleCounts$get : 0) + 1);
|
|
305
|
+
}
|
|
306
|
+
} catch (err) {
|
|
307
|
+
_iterator3.e(err);
|
|
308
|
+
} finally {
|
|
309
|
+
_iterator3.f();
|
|
310
|
+
}
|
|
311
|
+
var sharedStyles = new Map();
|
|
312
|
+
var _iterator4 = _createForOfIteratorHelper(styleCounts),
|
|
313
|
+
_step4;
|
|
314
|
+
try {
|
|
315
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
316
|
+
var _step4$value = (0, _slicedToArray2["default"])(_step4.value, 2),
|
|
317
|
+
_style = _step4$value[0],
|
|
318
|
+
count = _step4$value[1];
|
|
319
|
+
if (count > 1) sharedStyles.set(_style, "style-".concat(sharedStyles.size + 1));
|
|
320
|
+
}
|
|
321
|
+
} catch (err) {
|
|
322
|
+
_iterator4.e(err);
|
|
323
|
+
} finally {
|
|
324
|
+
_iterator4.f();
|
|
325
|
+
}
|
|
326
|
+
var styleDefinitions = Array.from(sharedStyles, function (_ref5) {
|
|
327
|
+
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
|
328
|
+
style = _ref6[0],
|
|
329
|
+
id = _ref6[1];
|
|
330
|
+
return indentXml(style.replace('<Style>', "<Style id=\"".concat(id, "\">")), 4);
|
|
331
|
+
});
|
|
332
|
+
var placemarks = geojson.features.map(function (feature, index) {
|
|
333
|
+
try {
|
|
334
|
+
var style = featureStyles[index];
|
|
335
|
+
var sharedStyleId = style ? sharedStyles.get(style) : undefined;
|
|
336
|
+
return indentXml(featureKml(feature, sharedStyleId ? "<styleUrl>#".concat(sharedStyleId, "</styleUrl>") : style), 4);
|
|
337
|
+
} catch (error) {
|
|
338
|
+
if (error instanceof InvalidCoordinateError) {
|
|
339
|
+
throw new KmlCoordinateError(index, feature.id);
|
|
340
|
+
}
|
|
341
|
+
throw error;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
var documentContents = [" <name>".concat(xmlSafeText(documentName), "</name>")].concat(styleDefinitions, (0, _toConsumableArray2["default"])(placemarks)).join('\n');
|
|
345
|
+
return ['<?xml version="1.0" encoding="UTF-8"?>', "<kml xmlns=\"".concat(KML_NAMESPACE, "\">"), ' <Document>', documentContents, ' </Document>', '</kml>'].join('\n');
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=kml-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kml-writer.js","names":["KmlCoordinateError","exports","_Error","featureIndex","featureId","_this","_classCallCheck2","_callSuper","concat","name","_inherits2","_createClass2","_wrapNativeSuper2","Error","KML_NAMESPACE","InvalidCoordinateError","_Error2","arguments","xmlSafeText","value","stripDisallowedControls","String","replace","result","_iterator","_createForOfIteratorHelper","_step","s","n","done","char","code","charCodeAt","disallowed","err","e","f","indentXml","xml","spaces","indentation","repeat","split","map","line","join","decimalText","text","match","exec","_match","_slicedToArray2","sign","integer","_match$","fraction","rawExponent","digits","decimalIndex","length","Number","slice","positionText","position","some","isFinite","coordinatesText","positions","hasAltitude","closedRing","ring","first","last","every","coordinate","index","_toConsumableArray2","polygonKml","coordinates","_coordinates","_toArray2","outer","inner","boundaries","push","_iterator2","_step2","contents","multiGeometryKml","geometries","geometry","geometryKml","type","propertyText","_typeof2","JSON","stringify","propertyElement","properties","key","extendedDataKml","feature","_feature$properties","entries","Object","filter","_ref","_ref2","id","idKey","prototype","hasOwnProperty","call","suffix","unshift","data","_ref3","_ref4","entry","opacityByte","defaultOpacity","undefined","opacity","normalized","Math","min","max","round","toString","padStart","kmlColor","color","trim","hex","digit","red","green","blue","toLowerCase","styleKml","sections","markerColor","strokeColor","stroke","strokeWidth","values","fillColor","fill","featureKml","style","_feature$properties2","writeKml","geojson","documentName","featureStyles","features","styleCounts","Map","_iterator3","_step3","_styleCounts$get","set","get","sharedStyles","_iterator4","_step4","_step4$value","count","size","styleDefinitions","Array","from","_ref5","_ref6","placemarks","sharedStyleId","error","documentContents"],"sources":["../../../src/export/kml-writer.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\n// Adapted from GeoLibre (https://github.com/opengeos/GeoLibre), MIT License.\n\nimport type {Feature, FeatureCollection, GeoJsonProperties, Geometry, Position} from 'geojson';\nexport class KmlCoordinateError extends Error {\n constructor(featureIndex: number, featureId?: string | number) {\n super(`Feature ${featureId ?? featureIndex} has a coordinate that KML cannot represent.`);\n this.name = 'KmlCoordinateError';\n }\n}\n\nconst KML_NAMESPACE = 'http://www.opengis.net/kml/2.2';\n\nclass InvalidCoordinateError extends Error {}\n\nfunction xmlSafeText(value: unknown): string {\n return stripDisallowedControls(String(value))\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\n/** XML 1.0 disallows these controls. Tab, newline, and carriage return stay. */\nfunction stripDisallowedControls(value: string): string {\n let result = '';\n for (const char of value) {\n const code = char.charCodeAt(0);\n const disallowed =\n code <= 0x08 || code === 0x0b || code === 0x0c || (code >= 0x0e && code <= 0x1f);\n result += disallowed ? '\\uFFFD' : char;\n }\n return result;\n}\n\nfunction indentXml(xml: string, spaces: number): string {\n const indentation = ' '.repeat(spaces);\n return xml\n .split('\\n')\n .map(line => `${indentation}${line}`)\n .join('\\n');\n}\n\nfunction decimalText(value: number): string {\n const text = String(value);\n const match = /^(-?)(\\d+)(?:\\.(\\d+))?e([+-]?\\d+)$/i.exec(text);\n if (!match) return text;\n\n const [, sign, integer, fraction = '', rawExponent] = match;\n const digits = `${integer}${fraction}`;\n const decimalIndex = integer.length + Number(rawExponent);\n if (decimalIndex <= 0) {\n return `${sign}0.${'0'.repeat(-decimalIndex)}${digits}`;\n }\n if (decimalIndex >= digits.length) {\n return `${sign}${digits}${'0'.repeat(decimalIndex - digits.length)}`;\n }\n return `${sign}${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;\n}\n\nfunction positionText(position: Position): string {\n if (position.length < 2 || position.slice(0, 3).some(value => !Number.isFinite(value))) {\n throw new InvalidCoordinateError();\n }\n return position\n .slice(0, 3)\n .map(value => decimalText(value))\n .join(',');\n}\n\nfunction coordinatesText(positions: Position[]): string {\n return positions.map(positionText).join(' ');\n}\n\nfunction hasAltitude(position: Position): boolean {\n // KML applies altitude mode to the entire geometry. For mixed-dimensional\n // GeoJSON, preserve supplied altitudes and let KML interpret 2D vertices as\n // having its implicit zero altitude.\n return position.length >= 3;\n}\n\nfunction closedRing(ring: Position[]): Position[] {\n if (ring.length === 0) return ring;\n const first = ring[0];\n const last = ring[ring.length - 1];\n if (\n first.length === last.length &&\n first.every((coordinate, index) => coordinate === last[index])\n ) {\n return ring;\n }\n return [...ring, first];\n}\n\nfunction polygonKml(coordinates: Position[][]): string {\n const [outer, ...inner] = coordinates;\n const boundaries: string[] = [];\n if (outer) {\n boundaries.push(\n '<outerBoundaryIs>',\n ' <LinearRing>',\n ` <coordinates>${coordinatesText(closedRing(outer))}</coordinates>`,\n ' </LinearRing>',\n '</outerBoundaryIs>'\n );\n }\n for (const ring of inner) {\n boundaries.push(\n '<innerBoundaryIs>',\n ' <LinearRing>',\n ` <coordinates>${coordinatesText(closedRing(ring))}</coordinates>`,\n ' </LinearRing>',\n '</innerBoundaryIs>'\n );\n }\n if (boundaries.length === 0) return '<Polygon />';\n const contents = coordinates.some(ring => ring.some(hasAltitude))\n ? ['<altitudeMode>absolute</altitudeMode>', ...boundaries]\n : boundaries;\n return `<Polygon>\\n${indentXml(contents.join('\\n'), 2)}\\n</Polygon>`;\n}\n\nfunction multiGeometryKml(geometries: Geometry[]): string {\n if (geometries.length === 0) return '<MultiGeometry />';\n return `<MultiGeometry>\\n${geometries\n .map(geometry => indentXml(geometryKml(geometry), 2))\n .join('\\n')}\\n</MultiGeometry>`;\n}\n\nfunction geometryKml(geometry: Geometry): string {\n switch (geometry.type) {\n case 'Point':\n return `<Point>${\n hasAltitude(geometry.coordinates) ? '<altitudeMode>absolute</altitudeMode>' : ''\n }<coordinates>${positionText(geometry.coordinates)}</coordinates></Point>`;\n case 'MultiPoint':\n return multiGeometryKml(\n geometry.coordinates.map(coordinates => ({type: 'Point', coordinates}))\n );\n case 'LineString':\n return `<LineString>${\n geometry.coordinates.some(hasAltitude) ? '<altitudeMode>absolute</altitudeMode>' : ''\n }<coordinates>${coordinatesText(geometry.coordinates)}</coordinates></LineString>`;\n case 'MultiLineString':\n return multiGeometryKml(\n geometry.coordinates.map(coordinates => ({type: 'LineString', coordinates}))\n );\n case 'Polygon':\n return polygonKml(geometry.coordinates);\n case 'MultiPolygon':\n return multiGeometryKml(\n geometry.coordinates.map(coordinates => ({type: 'Polygon', coordinates}))\n );\n case 'GeometryCollection':\n return multiGeometryKml(geometry.geometries);\n }\n}\n\nfunction propertyText(value: unknown): string {\n if (value == null) return '';\n if (typeof value !== 'object') return String(value);\n return JSON.stringify(value);\n}\n\nfunction propertyElement(properties: GeoJsonProperties, key: string): string | null {\n const value = properties?.[key];\n return value == null || typeof value === 'object'\n ? null\n : `<${key}>${xmlSafeText(value)}</${key}>`;\n}\n\nfunction extendedDataKml(feature: Feature): string | null {\n const properties = feature.properties ?? {};\n const entries = Object.entries(properties).filter(\n ([key, value]) =>\n !((key === 'name' || key === 'description') && value != null && typeof value !== 'object')\n );\n if (feature.id != null) {\n let idKey = 'feature_id';\n if (Object.prototype.hasOwnProperty.call(properties, idKey)) {\n idKey = 'geojson_feature_id';\n let suffix = 2;\n while (Object.prototype.hasOwnProperty.call(properties, idKey)) {\n idKey = `geojson_feature_id_${suffix}`;\n suffix += 1;\n }\n }\n entries.unshift([idKey, feature.id]);\n }\n if (entries.length === 0) return null;\n const data = entries.map(\n ([key, value]) =>\n `<Data name=\"${xmlSafeText(key)}\"><value>${xmlSafeText(propertyText(value))}</value></Data>`\n );\n return `<ExtendedData>\\n${data.map(entry => indentXml(entry, 2)).join('\\n')}\\n</ExtendedData>`;\n}\n\nfunction opacityByte(value: unknown, defaultOpacity = 1): string {\n const opacity = typeof value === 'number' ? value : Number(value ?? defaultOpacity);\n const normalized = Number.isFinite(opacity) ? Math.min(1, Math.max(0, opacity)) : defaultOpacity;\n return Math.round(normalized * 255)\n .toString(16)\n .padStart(2, '0');\n}\n\nfunction kmlColor(color: unknown, opacity: unknown, defaultOpacity = 1): string | null {\n if (typeof color !== 'string') return null;\n const match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color.trim());\n if (!match) return null;\n const hex =\n match[1].length === 3\n ? match[1]\n .split('')\n .map(digit => `${digit}${digit}`)\n .join('')\n : match[1];\n const red = hex.slice(0, 2);\n const green = hex.slice(2, 4);\n const blue = hex.slice(4, 6);\n return `${opacityByte(opacity, defaultOpacity)}${blue}${green}${red}`.toLowerCase();\n}\n\nfunction styleKml(properties: GeoJsonProperties): string | null {\n if (!properties) return null;\n const sections: string[] = [];\n\n const markerColor = kmlColor(properties['marker-color'], properties['marker-opacity']);\n if (markerColor) {\n sections.push(`<IconStyle><color>${markerColor}</color></IconStyle>`);\n }\n\n const strokeColor = kmlColor(properties.stroke, properties['stroke-opacity']);\n const strokeWidth = Number(properties['stroke-width']);\n if (strokeColor || Number.isFinite(strokeWidth)) {\n const values = [\n strokeColor ? `<color>${strokeColor}</color>` : null,\n Number.isFinite(strokeWidth) ? `<width>${strokeWidth}</width>` : null\n ].filter((value): value is string => value !== null);\n sections.push(`<LineStyle>${values.join('')}</LineStyle>`);\n }\n\n const fillColor = kmlColor(properties.fill, properties['fill-opacity'], 0.6);\n if (fillColor) {\n sections.push(`<PolyStyle><color>${fillColor}</color></PolyStyle>`);\n }\n\n if (sections.length === 0) return null;\n return `<Style>${sections.join('')}</Style>`;\n}\n\nfunction featureKml(feature: Feature, style: string | null): string {\n const properties = feature.properties ?? {};\n const contents = [\n propertyElement(properties, 'name'),\n propertyElement(properties, 'description'),\n style,\n extendedDataKml(feature),\n feature.geometry ? geometryKml(feature.geometry) : null\n ].filter((value): value is string => value !== null);\n\n if (contents.length === 0) return '<Placemark />';\n return `<Placemark>\\n${contents.map(value => indentXml(value, 2)).join('\\n')}\\n</Placemark>`;\n}\n\n/**\n * Convert a GeoJSON FeatureCollection to a KML 2.2 document.\n *\n * Feature properties are retained in ExtendedData, except primitive `name` and\n * `description` values that are represented by their native KML elements.\n * Simplestyle properties are also promoted to native KML styles for display in\n * Google Earth and other KML clients.\n */\nexport function writeKml(geojson: FeatureCollection, documentName: string): string {\n const featureStyles = geojson.features.map(feature => styleKml(feature.properties));\n const styleCounts = new Map<string, number>();\n for (const style of featureStyles) {\n if (style) styleCounts.set(style, (styleCounts.get(style) ?? 0) + 1);\n }\n\n const sharedStyles = new Map<string, string>();\n for (const [style, count] of styleCounts) {\n if (count > 1) sharedStyles.set(style, `style-${sharedStyles.size + 1}`);\n }\n const styleDefinitions = Array.from(sharedStyles, ([style, id]) =>\n indentXml(style.replace('<Style>', `<Style id=\"${id}\">`), 4)\n );\n\n const placemarks = geojson.features.map((feature, index) => {\n try {\n const style = featureStyles[index];\n const sharedStyleId = style ? sharedStyles.get(style) : undefined;\n return indentXml(\n featureKml(feature, sharedStyleId ? `<styleUrl>#${sharedStyleId}</styleUrl>` : style),\n 4\n );\n } catch (error) {\n if (error instanceof InvalidCoordinateError) {\n throw new KmlCoordinateError(index, feature.id);\n }\n throw error;\n }\n });\n const documentContents = [\n ` <name>${xmlSafeText(documentName)}</name>`,\n ...styleDefinitions,\n ...placemarks\n ].join('\\n');\n return [\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>',\n `<kml xmlns=\"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