@hestia-earth/schema-convert 9.7.0 → 9.7.1
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/json.js +19 -5
- package/package.json +1 -1
package/json.js
CHANGED
|
@@ -336,8 +336,12 @@ var propertyTypeToValue = {
|
|
|
336
336
|
var result;
|
|
337
337
|
try {
|
|
338
338
|
result = {
|
|
339
|
-
type: '
|
|
340
|
-
|
|
339
|
+
type: 'FeatureCollection',
|
|
340
|
+
features: [{
|
|
341
|
+
type: 'Feature',
|
|
342
|
+
properties: {},
|
|
343
|
+
geometry: wkt_1.wktToGeoJSON(value)
|
|
344
|
+
}]
|
|
341
345
|
};
|
|
342
346
|
}
|
|
343
347
|
catch (e1) {
|
|
@@ -345,10 +349,20 @@ var propertyTypeToValue = {
|
|
|
345
349
|
var data = JSON.parse(value);
|
|
346
350
|
return result = ['Polygon', 'MultiPolygon'].includes(data.type)
|
|
347
351
|
? {
|
|
348
|
-
type: '
|
|
349
|
-
|
|
352
|
+
type: 'FeatureCollection',
|
|
353
|
+
features: [{
|
|
354
|
+
type: 'Feature',
|
|
355
|
+
properties: {},
|
|
356
|
+
geometry: data
|
|
357
|
+
}]
|
|
350
358
|
}
|
|
351
|
-
: data
|
|
359
|
+
: ['Feature'].includes(data.type)
|
|
360
|
+
? {
|
|
361
|
+
type: 'FeatureCollection',
|
|
362
|
+
features: [__assign(__assign({}, data), { properties: {} // make sure they are set or it is invalid
|
|
363
|
+
})]
|
|
364
|
+
}
|
|
365
|
+
: data;
|
|
352
366
|
}
|
|
353
367
|
catch (e2) { }
|
|
354
368
|
}
|