No project description provided
Project description
Fathom Python SDK client
The Python SDK client for communicating with the Fathom API
Example usage:
"""An example usage of the Fathom API client."""
import os
from fathom import Client, point, points, simple_polygon
if __name__ == "__main__":
client = Client(
os.getenv("FATHOM_CLIENT_ID"),
os.getenv("FATHOM_CLIENT_SECRET"),
os.getenv("FATHOM_API_ADDR"),
)
layer_ids = [
"GLOBAL-1ARCSEC-00_OFFSET-1in10-PLUVIAL-DEFENDED-DEPTH-2020-PERCENTILE50-v0.0.0_test",
"GLOBAL-1ARCSEC-00_OFFSET-1in100-PLUVIAL-DEFENDED-DEPTH-2020-PERCENTILE50-v0.0.0_test",
]
pt = point(lat=50.8162643, lng=-1.1081944)
client.get_points(points([pt]), layer_ids)
poly = simple_polygon(
[
point(52.41, -1.52),
point(52.4, -1.52),
point(52.4, -1.5),
point(52.41, -1.5),
point(52.41, -1.52),
]
)
results = client.get_polygon(poly, layer_ids).results
for layer_id, data in results.items():
for geotiff in data.polygons.geo_tiffs:
f = open(layer_id + ".tif", "wb")
f.write(geotiff)
f.close()
results = client.get_with_shapefile(shapefile, layer_ids).results
for layer_id, data in results.items():
for geotiff in data.polygons.geo_tiffs:
f = open(layer_id + ".tif", "wb")
f.write(geotiff)
f.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for fathom_global_client_sdk-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffbd44f707d558d1037cfea59342a4fc1e4f669ebe9b4d3ba8326c2c05c323f2 |
|
MD5 | 3b4a7ccb2e5f3bf920b37fc6b1ed721b |
|
BLAKE2b-256 | a06412c5d6c10ea3734b58983b0dc645d56f2d9ea828d7f7bb2c3e3122ab87e7 |