winnow
Version:
Apply sql-like filters to GeoJSON
14 lines (11 loc) • 433 B
JavaScript
const esriPredicates = {
esriSpatialRelContains: 'ST_Contains',
esriSpatialRelWithin: 'ST_Within',
esriSpatialRelIntersects: 'ST_Intersects',
esriSpatialRelEnvelopeIntersects: 'ST_EnvelopeIntersects'
}
function normalizeSpatialPredicate ({ spatialPredicate, spatialRel } = {}) {
const predicate = spatialPredicate || spatialRel
return esriPredicates[predicate] || predicate
}
module.exports = normalizeSpatialPredicate