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

Function collectGeoJSON

docs/app/js/sanddance-app.js:131644–131650  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

131642 if ((0, _vegaUtil.isFunction)(proj[key])) proj[key](value);
131643}
131644function collectGeoJSON(data) {
131645 data = (0, _vegaUtil.array)(data);
131646 return data.length === 1 ? data[0] : {
131647 type: FeatureCollection,
131648 features: data.reduce((a, f)=>a.concat(featurize(f)), [])
131649 };
131650}
131651function featurize(f) {
131652 return f.type === FeatureCollection ? f.features : (0, _vegaUtil.array)(f).filter((d)=>d != null).map((d)=>d.type === Feature ? d : {
131653 type: Feature,

Callers 1

fitFunction · 0.70

Calls 1

featurizeFunction · 0.70

Tested by

no test coverage detected