Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1x 1x 1x 7x 6x 6x 6x 6x 6x 1x | const _ = require('lodash') const getCollectionCrs = require('./get-collection-crs') const normalizeSpatialReference = require('./normalize-spatial-reference') function getSpatialReference (geojson, { inputCrs, sourceSR } = {}) { if (!inputCrs && !sourceSR && _.isEmpty(geojson)) return const spatialReference = inputCrs || sourceSR || getCollectionCrs(geojson) || { wkid: 4326, latestWkid: 4326 } Iif (!spatialReference) return const { latestWkid, wkid, wkt } = normalizeSpatialReference(spatialReference) Eif (wkid) { return { wkid, latestWkid } } return { wkt } } module.exports = getSpatialReference |