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
const axios = require('axios') | |
const endpoint = 'https://api.withleaf.io/api/authenticate' | |
const data = { username:'username', password:'password', rememberMe:'true'} | |
axios.post(endpoint, { data }) | |
.then(res => console.log(res.data)) | |
.catch(console.error) |
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
import requests | |
url = "https://api.withleaf.io/api/authenticate" | |
data = {'username':'your email', 'password':'your password', 'rememberMe':'true'} | |
headers = {'Content-Type': 'application/json'} | |
response = requests.request("POST", url, headers=headers, json=data) |
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
curl -X POST \ | |
-H 'Content-Type: application/json' \ | |
-d '{ "username":"username", "password":"password", "rememberMe":"true" }' \ | |
'https://api.withleaf.io/api/authenticate' |
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
images_to_list(get_newest_image(external_id, "planet")) | |
['NDRE.tif', | |
'NDRE_color.tif', | |
'NDVI.tif', | |
'NDVI_color.tif', | |
'RGB.tif', | |
'ortho_analytic_8b_sr.tif', | |
'NDRE.png', | |
'NDRE_absolute.png', |
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
external_id = "field_demo" | |
field = get_sat_field(external_id) | |
def get_newest_image(field_id, provider, image=None, format=None): | |
endpoint = f'https://api.withleaf.io/services/satellite/api/fields/{field_id}/processes' | |
params = {'startDate': '2023-07-21', 'maxClouds' : 5, "coverage": 100, "provider": provider, "sort": "date,desc"} | |
headers = {'Authorization': f'Bearer {TOKEN}'} | |
response = requests.get(endpoint, headers=headers, params=params) | |
image_info = response.json()[0] | |
images = image_info['images'] |
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
external_id = "field_demo" | |
field = get_sat_field(external_id) | |
def get_newest_image(field_id, provider, image=None, format=None): | |
endpoint = f'https://api.withleaf.io/services/satellite/api/fields/{field_id}/processes' | |
params = {'startDate': '2023-07-21', 'maxClouds' : 5, "coverage": 100, "provider": provider, "sort": "date,desc"} | |
headers = {'Authorization': f'Bearer {TOKEN}'} | |
response = requests.get(endpoint, headers=headers, params=params) | |
image_info = response.json()[0] | |
images = image_info['images'] |
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
def create_new_satellite_field(external_id, days_before, coordinates): | |
endpoint = 'https://api.withleaf.io/services/satellite/api/fields' | |
headers = {'Authorization': f'Bearer {TOKEN}'} | |
payload = {"externalId" : external_id, "providers" : providers, "daysBefore": days_before, "geometry": {"type": "MultiPolygon", "coordinates": coordinates}} | |
response = requests.post(endpoint, headers=headers, json=payload) | |
return response | |
external_id = 'field__demo' | |
providers = ['planet', 'sentinel'] | |
days_before = 365 |
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
https://connections.deere.com/connections/{clientId}/select-organizations?redirect_uri={redirectUri} |
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
https://api.withleaf.io/services/beta/api/users/{leafUserId}/layers?fieldId={fieldId}&provider=Sentera&type=RGB |
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
https://api.withleaf.io/services/beta/api/users/{leafUserId}/layers?fieldId={fieldId}&provider=Sentera&type=NDVI |
NewerOlder