This is an example implementation for https://github.com/stapi-spec/stapi-fastapi generating opportunity previews based on a TLE.
The mock backend uses SQLite/Spatialite as storage, therefore the
SPATIALITE_LIBRARY_PATH
env var must be set to load the spatialite extension:
export DATABASE=sqlite:///order.sqlite
export SPATIALITE_LIBRARY_PATH=/path/to/mod_spatialite.dylib
If you installed spatialite, for example, through apt
you can reference it like so:
export SPATIALITE_LIBRARY_PATH=mod_spatialite.so
poetry run tle
GET all products
curl http://127.0.0.1:8000/products
POST to opportunities
curl -d '{"datetime":"2014-10-01T13:00:00Z/2014-10-10T15:30:00Z","product_id":"mock:standard","geometry":{"type":"Point","coordinates":[-115.06855238269905,31.987811301701587]},"properties":{"off_nadir":{"minimum":0,"maximum":40}},"filter":{}}' -X POST http://127.0.0.1:8000/opportunities