Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
coordinates: projectCoordinates(geometry.coordinates, { toSR: projection })
}
} catch (e) {
return null
}
}
sql.fn.reducePrecision = function (geometry, precision) {
if (!(geometry && geometry.coordinates)) return geometry
return {
type: geometry.type,
coordinates: reducePrecision(geometry.coordinates, precision)
}
}
sql.aggr.hash = function (value, obj, acc) {
obj = obj || {}
if (obj[value]) obj[value]++
else obj[value] = 1
return obj
}
/**
* Modify propterties to fit ESRI specs
* @param {object} properties GeoJSON properties
* @param {object} geometry GeoJSON geometry
* @param {string} dateFields comma-delimited list of date fields
* @param {string} requiresObjectId boolean-string flagging requirement of OBJECTID as part of properties
* @param {string} idField name of attribute to be used as OBJECTID
*/
function esriFy (properties, geometry, dateFields, requiresObjectId, idField) {
const parsedDateFields = (dateFields.length === 0) ? [] : dateFields.split(',')