Skip to content

Instantly share code, notes, and snippets.

@claustres
Created December 10, 2019 13:55
Show Gist options
  • Save claustres/8881e00f155662e02cfb0fdda5018f74 to your computer and use it in GitHub Desktop.
Save claustres/8881e00f155662e02cfb0fdda5018f74 to your computer and use it in GitHub Desktop.
Geospatial query on Feathers service
// Our geospatial services store GeoJson objects like this
const result = await app.service('service').create({
type: 'Polygon',
geometry: {
type: 'Polygon',
coordinates: [...]
},
properties: { ... }
})
// We can the make geospatial queries like this
const results = await app.service('service').find({
query: {
geometry: {
$geoIntersects: {
$geometry: {
type: 'Polygon',
coordinates: [...]
}
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment