New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python API from OpenAPI endpoints #178
Labels
Comments
Another route is: https://github.com/swagger-api/swagger-codegen |
We need to be able to perform the following tasks from the Python client:
cc @aashish24 @AlmightyYakob |
Merged
Use case workflow
PsuedocodeSee import rasterio
from rasterio.plot import show
import matplotlib.pyplot as plt
# Define ROI
points = np.array([[-107.08212524738178, 39.01040379702808],
[-106.96182164246767, 39.03110215679572],
[-106.90895466037738, 38.98387516880551],
[-106.9805540376965, 38.91038429753703],
[-107.07130208569401, 38.952157178475225],
[-107.08212524738178, 39.01040379702808]])
shape = {"type": "Polygon",
"coordinates": [points.tolist(), ]}
...
q = GeoData.search(geojson=shape, **params)
raster = q[0] # choose raster from search results
f = GeoData.fetch_raster_file(raster)
src = rasterio.open(f)
show(src) # plots raster
sub = GeoData.subsample_raster(raster, geojson=shape)
src_sub = rasterio.open(sub)
# Show two in same plot
show(src, cmap='Greys')
show(src_sub) |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We need to (automatically?) generate a Python API from the OpenAPI endpoints. Or at least provide a way to access those endpoints from a Python client.
One viable option is: https://github.com/OpenAPITools/openapi-generator
Another approach would be to manually create the API... I'm actually leaning towards this to make sure we can design the API in a way that is user friendly and have clear documentation
First, we need a few clear use cases, likely coming from ndsampler
The text was updated successfully, but these errors were encountered: