MCPcopy Create free account
hub / github.com/microsoft/SandDance / getGeojsonFeatures

Function getGeojsonFeatures

docs/app/js/sanddance-app.js:104707–104725  ·  view source on GitHub ↗
(geojson)

Source from the content-addressed store, hash-verified

104705parcelHelpers.export(exports, "validateGeometry", ()=>validateGeometry);
104706var _core = require("@deck.gl/core");
104707function getGeojsonFeatures(geojson) {
104708 if (Array.isArray(geojson)) return geojson;
104709 (0, _core.log).assert(geojson.type, "GeoJSON does not have type");
104710 switch(geojson.type){
104711 case "Feature":
104712 return [
104713 geojson
104714 ];
104715 case "FeatureCollection":
104716 (0, _core.log).assert(Array.isArray(geojson.features), "GeoJSON does not have features array");
104717 return geojson.features;
104718 default:
104719 return [
104720 {
104721 geometry: geojson
104722 }
104723 ];
104724 }
104725}
104726function separateGeojsonFeatures(features, wrapFeature) {
104727 var dataRange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
104728 var separated = {

Callers

nothing calls this directly

Calls 1

assertMethod · 0.45

Tested by

no test coverage detected