Created
December 10, 2019 13:55
-
-
Save claustres/8881e00f155662e02cfb0fdda5018f74 to your computer and use it in GitHub Desktop.
Geospatial query on Feathers service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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