We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@andresfchamorro @bpstewar; can you provide the exact requests used to reproduce the bug and provide a little more description?
The text was updated successfully, but these errors were encountered:
Thanks for opening the issue, I will open a new one for small polygons as it's different and probably minor.
Do you think the API could support multi polygons? There are likely going to be many admin areas like this one with coastal features.
The response is 422 but the text for the exception doesn't yield anything. The json does say Input should be 'Polygon
Input should be 'Polygon
from typing import Dict import requests import geopandas as gpd import pandas as pd from geojson_pydantic import Feature, Polygon BASE_URL = "https://space2stats.ds.io" FIELDS_ENDPOINT = f"{BASE_URL}/fields" SUMMARY_ENDPOINT = f"{BASE_URL}/summary" iso3 = 'KEN' adm = 'ADM1' url = f'https://www.geoboundaries.org/api/current/gbOpen/{iso3}/{adm}/' res = requests.get(url).json() adm = gpd.read_file(res['gjDownloadURL']) aoi = adm.loc[42] feature = { "type": "Feature", "geometry": aoi.geometry.__geo_interface__, "properties": { key: value for key, value in aoi.items() if key != 'geometry' } } AOIModel = Feature[Polygon, Dict] # Define the Request Payload request_payload = { "aoi": feature, "spatial_join_method": "centroid", "fields": ["sum_pop_2020"], "geometry": "polygon" } # Get Summary Data response = requests.post(SUMMARY_ENDPOINT, json=request_payload) if response.status_code != 200: raise Exception(f"Failed to get summary: {response.text}") summary_data = response.json() df = pd.DataFrame(summary_data)
Sorry, something went wrong.
Handle multipolygons
c59a46d
closes #56
2de0600
alukach
bpstewar
andresfchamorro
No branches or pull requests
@andresfchamorro @bpstewar; can you provide the exact requests used to reproduce the bug and provide a little more description?
The text was updated successfully, but these errors were encountered: