Skip to content

Instantly share code, notes, and snippets.

@samapriya
Created August 4, 2025 13:33
Show Gist options
  • Select an option

  • Save samapriya/ba2f3798149f013b2d60964af1db953f to your computer and use it in GitHub Desktop.

Select an option

Save samapriya/ba2f3798149f013b2d60964af1db953f to your computer and use it in GitHub Desktop.
{
"openapi": "3.1.0",
"info": {
"title": "Climate Engine Zonal Statistics API v1",
"version": "1.0.0",
"description": "Access zonal statistics from Climate Engine datasets over different geometries. Extract pixel counts, temporal statistics, static values, and grouped summaries for points, polygons, and feature collections."
},
"servers": [
{
"url": "https://api.climateengine.org",
"description": "Production Climate Engine API"
}
],
"paths": {
"/zonal_stats/pixel_count/coordinates": {
"get": {
"tags": ["zonal_stats/pixel_count"],
"summary": "Pixel Count for Coordinates",
"description": "Computes the number of pixels in each drought category for polygons. Useful for analyzing drought severity distribution across geographic areas.\n\n**Use Case:** Determine how many pixels fall into different drought categories (e.g., severe drought, moderate drought) within your area of interest.\n\n**Example URL:**\n```\n/zonal_stats/pixel_count/coordinates?dataset=GRIDMET_DROUGHT&variable=spi180d&bins=[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]&end_date=2023-12-31&coordinates=[[[-121.61,38.78],[-121.52,38.78],[-121.52,38.83],[-121.61,38.83],[-121.61,38.78]]]\n```",
"operationId": "pixel_count_coordinates",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Polygon coordinates in GeoJSON format",
"default": "[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]",
"title": "Coordinates"
},
"description": "**Required.** List of longitude, latitude pairs defining polygon vertices. See [Formatting Coordinates](https://support.climateengine.org/article/152-formatting-coordinates-for-api-requests) for detailed examples.",
"example": "[[[-121.61,38.78],[-121.52,38.78],[-121.52,38.83],[-121.61,38.83],[-121.61,38.78]]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET_DROUGHT"],
"description": "Drought dataset for pixel counting",
"default": "GRIDMET_DROUGHT",
"title": "Dataset"
},
"description": "**Required.** Dataset containing drought indices for pixel counting analysis.",
"example": "GRIDMET_DROUGHT"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Drought index variable name",
"default": "spi180d",
"title": "Variable"
},
"description": "**Required.** Drought index variable to analyze. Common options:\n- `spi180d` - 6-month Standardized Precipitation Index\n- `spi1y` - 12-month Standardized Precipitation Index\n- `spei2y` - 24-month Standardized Precipitation Evapotranspiration Index",
"example": "spi180d"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-30",
"title": "End Date"
},
"description": "**Required.** End date for the analysis in YYYY-MM-DD format.",
"example": "2023-12-31"
},
{
"name": "bins",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Bin values for pixel counting (up to 10 values)",
"default": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"title": "Bins"
},
"description": "Drought severity thresholds for categorizing pixels. Standard drought categories:\n- Below -2.0: Extreme drought\n- -2.0 to -1.5: Severe drought\n- -1.5 to -1.2: Moderate drought\n- -1.2 to -0.7: Abnormally dry\n- Above 0.5: Above normal moisture",
"example": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification. Specify maxError in meters to reduce polygon complexity. See [ee.Feature.simplify](https://developers.google.com/earth-engine/apidocs/ee-feature-simplify) for details.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand the geometry.",
"example": 400
},
{
"name": "mask_image_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Image Id"
},
"description": "Optional Earth Engine image ID to use as a mask for filtering pixels."
},
{
"name": "mask_band",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Band"
},
"description": "Band name in the mask image to use for filtering."
},
{
"name": "mask_value",
"in": "query",
"required": false,
"schema": {
"type": "number",
"title": "Mask Value"
},
"description": "Pixel value in the mask band to include in analysis."
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the pixel count data.",
"example": "json"
},
{
"name": "export_path",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Export Path"
},
"description": "Google Cloud Storage path for exporting results (requires proper permissions).",
"example": "climate-engine-public/my_pixel_count.csv"
}
],
"responses": {
"200": {
"description": "Pixel count data successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Pixel count results for each bin",
"items": {
"type": "object",
"properties": {
"bin_range": {
"type": "string",
"description": "Drought severity range for this bin"
},
"pixel_count": {
"type": "integer",
"description": "Number of pixels in this drought category"
},
"percentage": {
"type": "number",
"description": "Percentage of total pixels in this category"
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and summary statistics"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/pixel_count/feature_collection": {
"get": {
"tags": ["zonal_stats/pixel_count"],
"summary": "Pixel Count for Feature Collection",
"description": "Computes the number of pixels in each drought category for features in an Earth Engine FeatureCollection. Useful for analyzing drought conditions across multiple administrative boundaries or watersheds.\n\n**Use Case:** Analyze drought severity distribution across multiple counties, watersheds, or other predefined geographic areas.\n\n**Example URL:**\n```\n/zonal_stats/pixel_count/feature_collection?dataset=GRIDMET_DROUGHT&variable=spi180d&feature_collection_asset_id=USGS/WBD/2017/HUC08&filter_by=name&sub_choices=Animas\n```",
"operationId": "pixel_count_feature_collection",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID. Popular collections:\n- `USGS/WBD/2017/HUC08` - Watershed boundaries (8-digit HUC)\n- `TIGER/2018/Counties` - US counties\n- `FAO/GAUL_SIMPLIFIED_500m/2015/level1` - Global administrative areas",
"example": "USGS/WBD/2017/HUC08"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET_DROUGHT"],
"description": "Drought dataset",
"default": "GRIDMET_DROUGHT",
"title": "Dataset"
},
"description": "**Required.** Dataset containing drought indices.",
"example": "GRIDMET_DROUGHT"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Drought index variable",
"default": "spi180d",
"title": "Variable"
},
"description": "**Required.** Drought index variable to analyze.",
"example": "spi180d"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-30",
"title": "End Date"
},
"description": "**Required.** End date for the analysis in YYYY-MM-DD format.",
"example": "2023-12-31"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Property name in the FeatureCollection to use for filtering. For example:\n- `name` for watershed or county names\n- `huc8` for watershed codes\n- `GEOID` for census IDs",
"example": "name"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include. Multiple values can be separated by commas.",
"example": "Animas,San Juan"
},
{
"name": "bins",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Bin values for pixel counting",
"default": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"title": "Bins"
},
"description": "Drought severity thresholds for categorizing pixels.",
"example": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification to improve processing speed.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand geometries.",
"example": 400
},
{
"name": "mask_image_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Image Id"
},
"description": "Optional Earth Engine image ID to use as a mask."
},
{
"name": "mask_band",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Band"
},
"description": "Band name in the mask image."
},
{
"name": "mask_value",
"in": "query",
"required": false,
"schema": {
"type": "number",
"title": "Mask Value"
},
"description": "Pixel value in the mask band to include."
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
},
{
"name": "export_path",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Export Path"
},
"description": "Google Cloud Storage path for exporting results.",
"example": "climate-engine-public/my_results.csv"
}
],
"responses": {
"200": {
"description": "Pixel count data successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Pixel count results for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"pixel_counts": {
"type": "array",
"description": "Pixel count data for each bin",
"items": {
"type": "object",
"properties": {
"bin_range": {
"type": "string",
"description": "Drought severity range"
},
"pixel_count": {
"type": "integer",
"description": "Number of pixels"
},
"percentage": {
"type": "number",
"description": "Percentage of total pixels"
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/pixel_count/timeseries/coordinates": {
"get": {
"tags": ["zonal_stats/pixel_count"],
"summary": "Pixel Count Time Series for Coordinates",
"description": "Computes time series of pixel counts in each drought category for a single polygon. Useful for tracking drought evolution over time.\n\n**Use Case:** Monitor how drought conditions change over time within a specific area, showing the progression from normal conditions to drought and recovery.\n\n**Example URL:**\n```\n/zonal_stats/pixel_count/timeseries/coordinates?dataset=GRIDMET_DROUGHT&variable=spi180d&start_date=2020-01-01&end_date=2020-12-31&coordinates=[[[-121.61,38.78],[-121.52,38.78],[-121.52,38.83],[-121.61,38.83],[-121.61,38.78]]]\n```",
"operationId": "pixel_count_timeseries_coordinates",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Single polygon coordinates",
"default": "[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]",
"title": "Coordinates"
},
"description": "**Required.** Longitude, latitude pairs defining a single polygon. Note: This endpoint processes only one polygon at a time.",
"example": "[[-121.61,38.78],[-121.52,38.78],[-121.52,38.83],[-121.61,38.83],[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET_DROUGHT"],
"description": "Drought dataset",
"default": "GRIDMET_DROUGHT",
"title": "Dataset"
},
"description": "**Required.** Dataset containing drought indices for time series analysis.",
"example": "GRIDMET_DROUGHT"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Drought index variable",
"default": "spi180d",
"title": "Variable"
},
"description": "**Required.** Drought index variable for time series extraction.",
"example": "spi180d"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-01",
"title": "Start Date"
},
"description": "**Required.** Start date for time series in YYYY-MM-DD format.",
"example": "2020-01-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-30",
"title": "End Date"
},
"description": "**Required.** End date for time series in YYYY-MM-DD format.",
"example": "2020-12-31"
},
{
"name": "bins",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Bin values for pixel counting",
"default": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"title": "Bins"
},
"description": "Drought severity thresholds for time series analysis.",
"example": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification for faster processing.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand the geometry.",
"example": 400
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the time series data.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Pixel count time series successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"timeseries": {
"type": "array",
"description": "Time series of pixel counts",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date",
"description": "Date of observation"
},
"pixel_counts": {
"type": "object",
"description": "Pixel counts for each drought category",
"additionalProperties": {
"type": "integer"
}
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and summary statistics"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/pixel_count/timeseries/feature_collection": {
"get": {
"tags": ["zonal_stats/pixel_count"],
"summary": "Pixel Count Time Series for Feature Collection",
"description": "Computes time series of pixel counts in each drought category for features in an Earth Engine FeatureCollection. Useful for tracking drought evolution across multiple administrative areas.\n\n**Use Case:** Monitor drought trends over time across multiple watersheds, counties, or other geographic units.\n\n**Example URL:**\n```\n/zonal_stats/pixel_count/timeseries/feature_collection?dataset=GRIDMET_DROUGHT&variable=spi180d&start_date=2020-01-01&end_date=2020-12-31&feature_collection_asset_id=USGS/WBD/2017/HUC08&filter_by=name&sub_choices=Animas\n```",
"operationId": "pixel_count_timeseries_feature_collection",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID with publicly readable permissions.",
"example": "USGS/WBD/2017/HUC08"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET_DROUGHT"],
"description": "Drought dataset",
"default": "GRIDMET_DROUGHT",
"title": "Dataset"
},
"description": "**Required.** Dataset containing drought indices.",
"example": "GRIDMET_DROUGHT"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Drought index variable",
"default": "spi180d",
"title": "Variable"
},
"description": "**Required.** Drought index variable for time series extraction.",
"example": "spi180d"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-01",
"title": "Start Date"
},
"description": "**Required.** Start date for time series in YYYY-MM-DD format.",
"example": "2020-01-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-30",
"title": "End Date"
},
"description": "**Required.** End date for time series in YYYY-MM-DD format.",
"example": "2020-12-31"
},
{
"name": "filter_by",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "**Required for this endpoint.** Property name in the FeatureCollection to use for filtering.",
"example": "name"
},
{
"name": "sub_choices",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "**Required for this endpoint.** Specific feature values to include in the time series analysis.",
"example": "Animas"
},
{
"name": "bins",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Bin values for pixel counting",
"default": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"title": "Bins"
},
"description": "Drought severity thresholds for time series analysis.",
"example": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the time series data.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Pixel count time series successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Time series data for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"timeseries": {
"type": "array",
"description": "Time series of pixel counts",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"pixel_counts": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/static_dataset/coordinates": {
"get": {
"tags": ["zonal_stats/static"],
"summary": "Static Dataset Statistics for Coordinates",
"description": "Returns static (time-independent) values for provided points or polygons. Values are spatially aggregated using the specified area reducer.\n\n**Use Case:** Extract static characteristics like elevation, soil properties, or risk indices for specific locations or areas.\n\n**Example URL:**\n```\n/zonal_stats/static_dataset/coordinates?dataset=EH&variable=ERisk&coordinates=[[-121.61,38.78]]&area_reducer=mean\n```",
"operationId": "static_dataset_coordinates",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Point or polygon coordinates",
"default": "[[-121.61,38.78]]",
"title": "Coordinates"
},
"description": "**Required.** Point coordinates as `[longitude, latitude]` or polygon coordinates as nested arrays. See [Formatting Coordinates](https://support.climateengine.org/article/152-formatting-coordinates-for-api-requests) for examples.",
"example": "[[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["WRC", "EH", "CDOUTLOOOK", "USDOUTLOOK"],
"description": "Static dataset name",
"default": "EH",
"title": "Dataset"
},
"description": "**Required.** Static (time-independent) dataset to query:\n- `WRC` - Water Resource Characteristics\n- `EH` - Environmental Health indicators\n- `CDOUTLOOOK` - Climate Division Outlook\n- `USDOUTLOOK` - US Drought Outlook",
"example": "EH"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable name in the dataset",
"default": "ERisk",
"title": "Variable"
},
"description": "**Required.** Variable name to extract from the static dataset. Available variables depend on the chosen dataset.",
"example": "ERisk"
},
{
"name": "area_reducer",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"stdev",
"count",
"count_un",
"skew",
"kurtosis",
"percentile_5",
"percentile_10",
"percentile_25",
"percentile_75",
"percentile_90",
"percentile_95"
],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "**Required.** How to aggregate data spatially within polygons:\n- `mean` - Average value\n- `median` - Median value\n- `min`/`max` - Minimum/Maximum value\n- `stdev` - Standard deviation\n- `percentile_X` - Various percentiles",
"example": "mean"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification to improve processing speed.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand geometries.",
"example": 400
},
{
"name": "mask_image_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Image Id"
},
"description": "Optional Earth Engine image ID to use as a mask."
},
{
"name": "mask_band",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Band"
},
"description": "Band name in the mask image."
},
{
"name": "mask_value",
"in": "query",
"required": false,
"schema": {
"type": "number",
"title": "Mask Value"
},
"description": "Pixel value in the mask band to include."
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
},
{
"name": "export_path",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Export Path"
},
"description": "Google Cloud Storage path for exporting results.",
"example": "climate-engine-public/my_static_results.csv"
}
],
"responses": {
"200": {
"description": "Static dataset values successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Static values for each coordinate",
"items": {
"type": "object",
"properties": {
"coordinate_id": {
"type": "integer",
"description": "Index of the coordinate"
},
"coordinates": {
"type": "array",
"description": "Original coordinates",
"items": {
"type": "number"
}
},
"value": {
"type": "number",
"description": "Aggregated static value"
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and dataset information"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/static_dataset/feature_collection": {
"get": {
"tags": ["zonal_stats/static"],
"summary": "Static Dataset Statistics for Feature Collection",
"description": "Returns static (time-independent) values for features in an Earth Engine FeatureCollection. Values are spatially aggregated within each feature using the specified area reducer.\n\n**Use Case:** Extract static characteristics for multiple administrative boundaries, watersheds, or other predefined geographic areas.\n\n**Example URL:**\n```\n/zonal_stats/static_dataset/feature_collection?dataset=WRC&variable=BP&feature_collection_asset_id=TIGER/2018/Counties&filter_by=NAME&sub_choices=Los Angeles&area_reducer=mean\n```",
"operationId": "static_dataset_feature_collection",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID with publicly readable permissions.",
"example": "TIGER/2018/Counties"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["WRC", "EH", "CDOUTLOOOK", "USDOUTLOOK"],
"description": "Static dataset name",
"default": "EH",
"title": "Dataset"
},
"description": "**Required.** Static dataset to query.",
"example": "WRC"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable name in the dataset",
"default": "ERisk",
"title": "Variable"
},
"description": "**Required.** Variable name to extract from the static dataset.",
"example": "BP"
},
{
"name": "area_reducer",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"stdev",
"count",
"count_un",
"skew",
"kurtosis",
"percentile_5",
"percentile_10",
"percentile_25",
"percentile_75",
"percentile_90",
"percentile_95"
],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "**Required.** How to aggregate data spatially within each feature.",
"example": "mean"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Property name in the FeatureCollection to use for filtering.",
"example": "NAME"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include. If not specified, all features will be processed.",
"example": "Los Angeles,San Francisco"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand geometries.",
"example": 400
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Static dataset values successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Static values for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"value": {
"type": "number",
"description": "Aggregated static value for this feature"
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/temporal_dataset/coordinates": {
"get": {
"tags": ["zonal_stats/temporal"],
"summary": "Temporal Dataset Statistics for Coordinates",
"description": "Computes temporal statistics for polygons over a specified time period. Values are spatially averaged within each polygon and then temporally aggregated.\n\n**Use Case:** Calculate seasonal or annual statistics (e.g., average summer temperature, total annual precipitation) for specific areas.\n\n**Example URL:**\n```\n/zonal_stats/temporal_dataset/coordinates?dataset=GRIDMET&variable=tmmx&temporal_statistic=mean&start_date=2023-06-01&end_date=2023-08-31&coordinates=[[[-121.61,38.78],[-121.52,38.78],[-121.52,38.83],[-121.61,38.83],[-121.61,38.78]]]\n```",
"operationId": "temporal_dataset_coordinates",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Polygon coordinates",
"default": "[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]",
"title": "Coordinates"
},
"description": "**Required.** Polygon coordinates for temporal statistics extraction.",
"example": "[[[-121.61,38.78],[-121.52,38.78],[-121.52,38.83],[-121.61,38.83],[-121.61,38.78]]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET", "PRISM", "LANDSAT_TOA", "MODIS_MOD13Q1"],
"description": "Temporal dataset name",
"default": "GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Time-dependent dataset to query:\n- `GRIDMET` - Daily meteorological data\n- `PRISM` - Monthly precipitation and temperature\n- `LANDSAT_TOA` - Landsat satellite imagery\n- `MODIS_MOD13Q1` - MODIS vegetation indices",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable name",
"default": "tmmx",
"title": "Variable"
},
"description": "**Required.** Climate or remote sensing variable to analyze.",
"example": "tmmx"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-01",
"title": "Start Date"
},
"description": "**Required.** Start date for temporal analysis in YYYY-MM-DD format.",
"example": "2023-06-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-30",
"title": "End Date"
},
"description": "**Required.** End date for temporal analysis in YYYY-MM-DD format.",
"example": "2023-08-31"
},
{
"name": "temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation method",
"default": "mean",
"title": "Temporal Statistic"
},
"description": "**Required.** How to aggregate data temporally:\n- `mean` - Average over time period\n- `median` - Median over time period\n- `min`/`max` - Minimum/Maximum over time period\n- `total` - Sum over time period (useful for precipitation)",
"example": "mean"
},
{
"name": "area_reducer",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"stdev",
"count",
"count_un",
"skew",
"kurtosis",
"percentile_5",
"percentile_10",
"percentile_25",
"percentile_75",
"percentile_90",
"percentile_95"
],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "**Required.** How to aggregate data spatially within polygons.",
"example": "mean"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand geometries.",
"example": 400
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Temporal statistics successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Temporal statistics for each coordinate",
"items": {
"type": "object",
"properties": {
"coordinate_id": {
"type": "integer",
"description": "Index of the coordinate"
},
"coordinates": {
"type": "array",
"description": "Original coordinates"
},
"temporal_statistic": {
"type": "number",
"description": "Computed temporal statistic value"
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and processing information"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/temporal_dataset/feature_collection": {
"get": {
"tags": ["zonal_stats/temporal"],
"summary": "Temporal Dataset Statistics for Feature Collection",
"description": "Computes temporal statistics for features in an Earth Engine FeatureCollection over a specified time period. Values are spatially averaged within each feature and then temporally aggregated.\n\n**Use Case:** Calculate seasonal or annual statistics for multiple administrative boundaries, watersheds, or other predefined geographic areas.\n\n**Example URL:**\n```\n/zonal_stats/temporal_dataset/feature_collection?dataset=LANDSAT_TOA&variable=EVI&temporal_statistic=mean&start_date=2023-07-01&end_date=2023-08-31&feature_collection_asset_id=USGS/WBD/2017/HUC08&filter_by=name&sub_choices=Animas\n```",
"operationId": "temporal_dataset_feature_collection",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID with publicly readable permissions.",
"example": "USGS/WBD/2017/HUC08"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET", "PRISM", "LANDSAT_TOA", "MODIS_MOD13Q1"],
"description": "Temporal dataset name",
"default": "GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Time-dependent dataset to query.",
"example": "LANDSAT_TOA"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable name",
"default": "tmmx",
"title": "Variable"
},
"description": "**Required.** Climate or remote sensing variable to analyze.",
"example": "EVI"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-01",
"title": "Start Date"
},
"description": "**Required.** Start date for temporal analysis in YYYY-MM-DD format.",
"example": "2023-07-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2010-06-30",
"title": "End Date"
},
"description": "**Required.** End date for temporal analysis in YYYY-MM-DD format.",
"example": "2023-08-31"
},
{
"name": "temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation method",
"default": "mean",
"title": "Temporal Statistic"
},
"description": "**Required.** How to aggregate data temporally.",
"example": "mean"
},
{
"name": "area_reducer",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"stdev",
"count",
"count_un",
"skew",
"kurtosis",
"percentile_5",
"percentile_10",
"percentile_25",
"percentile_75",
"percentile_90",
"percentile_95"
],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "**Required.** How to aggregate data spatially within each feature.",
"example": "mean"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Property name in the FeatureCollection to use for filtering.",
"example": "name"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include.",
"example": "Animas,San Juan"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Temporal statistics successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Temporal statistics for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"temporal_statistic": {
"type": "number",
"description": "Computed temporal statistic value"
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/group_by/coordinates": {
"get": {
"tags": ["zonal_stats/group_by"],
"summary": "Group By Statistics for Coordinates",
"description": "Returns summaries (mean, sum, etc.) for user-defined categories within user-defined polygons. This endpoint groups pixels by values in one dataset and summarizes another dataset within those groups.\n\n**Use Case:** Analyze population distribution by drought severity, or summarize land use by elevation zones within your area of interest.\n\n**Example URL:**\n```\n/zonal_stats/group_by/coordinates?coordinates=[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]&group_img_id=GRIDMET/DROUGHT/20200105&group_band=spi1y&summary_img_id=CIESIN/GPWv411/GPW_Population_Count/gpw_v4_population_count_rev11_2020_30_sec&summary_band=population_count&bins=[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]\n```",
"operationId": "group_by_coordinates",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Polygon coordinates",
"default": "[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]",
"title": "Coordinates"
},
"description": "**Required.** List of longitude, latitude pairs defining polygon vertices.",
"example": "[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]"
},
{
"name": "group_img_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine image ID for grouping",
"default": "GRIDMET/DROUGHT/20200105",
"title": "Group Image Id"
},
"description": "**Required.** Earth Engine asset or Google Cloud Storage URI containing the data to group by (e.g., drought indices, elevation, land cover).",
"example": "GRIDMET/DROUGHT/20200105"
},
{
"name": "group_band",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Band name in group image",
"default": "spi1y",
"title": "Group Band"
},
"description": "**Required.** Band name in the group image to use for categorization.",
"example": "spi1y"
},
{
"name": "group_img_type",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["continuous", "discrete"],
"description": "Data type of the group image",
"default": "continuous",
"title": "Group Image Type"
},
"description": "**Required.** Whether the group image contains:\n- `continuous` - Continuous values that will be binned\n- `discrete` - Discrete categories/classes",
"example": "continuous"
},
{
"name": "summary_img_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine image ID for summarizing",
"default": "CIESIN/GPWv411/GPW_Population_Count/gpw_v4_population_count_rev11_2020_30_sec",
"title": "Summary Image Id"
},
"description": "**Required.** Earth Engine asset or Google Cloud Storage URI containing the data to summarize within each group (e.g., population, vegetation indices, economic data).",
"example": "CIESIN/GPWv411/GPW_Population_Count/gpw_v4_population_count_rev11_2020_30_sec"
},
{
"name": "summary_band",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Band name in summary image",
"default": "population_count",
"title": "Summary Band"
},
"description": "**Required.** Band name in the summary image to aggregate.",
"example": "population_count"
},
{
"name": "bins",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Bin values or discrete categories",
"default": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"title": "Bins"
},
"description": "**Required.** For continuous data: bin values for grouping. For discrete data: specific category values to summarize.\n\nExamples:\n- Continuous: `[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]`\n- Discrete: `[1,2,3,4]` for land cover classes",
"example": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]"
},
{
"name": "area_reducer",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Aggregation method for summary values",
"default": "mean",
"title": "Area Reducer"
},
"description": "**Required.** How to aggregate the summary values within each group:\n- `mean` - Average value\n- `median` - Median value\n- `min`/`max` - Minimum/Maximum value\n- `sum` - Total sum (useful for counts like population)",
"example": "sum"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand geometries.",
"example": 100
},
{
"name": "mask_image_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Image Id"
},
"description": "Optional Earth Engine image ID to mask the summary image."
},
{
"name": "mask_band",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Mask Band"
},
"description": "Band name in the mask image."
},
{
"name": "mask_value",
"in": "query",
"required": false,
"schema": {
"type": "number",
"title": "Mask Value"
},
"description": "Pixel value in the mask band to include."
},
{
"name": "scale_img",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["group_img_id", "summary_img_id"],
"description": "Image to use for scale determination",
"title": "Scale Image"
},
"description": "Choose which image's resolution to use for processing. Defaults to the finest resolution image.",
"example": "group_img_id"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
},
{
"name": "export_path",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Export Path"
},
"description": "Google Cloud Storage path for exporting results. You must give the Climate Engine service account (climate-engine-pro-gcp@climate-engine-pro.iam.gserviceaccount.com) Storage Object Creator role.",
"example": "climate-engine-public/my_group_by_results.csv"
}
],
"responses": {
"200": {
"description": "Group by statistics successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Grouped summary statistics",
"items": {
"type": "object",
"properties": {
"coordinate_id": {
"type": "integer",
"description": "Index of the coordinate"
},
"groups": {
"type": "array",
"description": "Summary statistics for each group",
"items": {
"type": "object",
"properties": {
"group_value": {
"type": "string",
"description": "Group category or bin range"
},
"summary_statistic": {
"type": "number",
"description": "Aggregated value for this group"
},
"pixel_count": {
"type": "integer",
"description": "Number of pixels in this group"
}
}
}
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and processing information"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/zonal_stats/group_by/feature_collection": {
"get": {
"tags": ["zonal_stats/group_by"],
"summary": "Group By Statistics for Feature Collection",
"description": "Returns summaries (mean, sum, etc.) for user-defined categories within features of an Earth Engine FeatureCollection. Groups pixels by values in one dataset and summarizes another dataset within those groups for each feature.\n\n**Use Case:** Analyze population distribution by drought severity across multiple counties, or summarize vegetation health by elevation zones across multiple watersheds.\n\n**Example URL:**\n```\n/zonal_stats/group_by/feature_collection?feature_collection_asset_id=TIGER/2018/States&filter_by=NAME&sub_choices=California&group_img_id=GRIDMET/DROUGHT/20200105&group_band=spi1y&summary_img_id=CIESIN/GPWv411/GPW_Population_Count/gpw_v4_population_count_rev11_2020_30_sec&summary_band=population_count\n```",
"operationId": "group_by_feature_collection",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID with publicly readable permissions.",
"example": "TIGER/2018/States"
},
{
"name": "group_img_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine image ID for grouping",
"default": "GRIDMET/DROUGHT/20200105",
"title": "Group Image Id"
},
"description": "**Required.** Earth Engine asset containing the data to group by.",
"example": "GRIDMET/DROUGHT/20200105"
},
{
"name": "group_band",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Band name in group image",
"default": "spi1y",
"title": "Group Band"
},
"description": "**Required.** Band name in the group image to use for categorization.",
"example": "spi1y"
},
{
"name": "group_img_type",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["continuous", "discrete"],
"description": "Data type of the group image",
"default": "continuous",
"title": "Group Image Type"
},
"description": "**Required.** Whether the group image contains continuous or discrete data.",
"example": "continuous"
},
{
"name": "summary_img_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine image ID for summarizing",
"default": "CIESIN/GPWv411/GPW_Population_Count/gpw_v4_population_count_rev11_2020_30_sec",
"title": "Summary Image Id"
},
"description": "**Required.** Earth Engine asset containing the data to summarize within each group.",
"example": "CIESIN/GPWv411/GPW_Population_Count/gpw_v4_population_count_rev11_2020_30_sec"
},
{
"name": "summary_band",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Band name in summary image",
"default": "population_count",
"title": "Summary Band"
},
"description": "**Required.** Band name in the summary image to aggregate.",
"example": "population_count"
},
{
"name": "bins",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Bin values or discrete categories",
"default": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"title": "Bins"
},
"description": "**Required.** Bin values for continuous data or specific categories for discrete data.",
"example": "[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]"
},
{
"name": "area_reducer",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Aggregation method for summary values",
"default": "mean",
"title": "Area Reducer"
},
"description": "**Required.** How to aggregate the summary values within each group.",
"example": "sum"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Property name in the FeatureCollection to use for filtering.",
"example": "NAME"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include in the analysis.",
"example": "California,Nevada"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand geometries.",
"example": 100
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the results.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Group by statistics successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Grouped statistics for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"groups": {
"type": "array",
"description": "Summary statistics for each group within this feature",
"items": {
"type": "object",
"properties": {
"group_value": {
"type": "string",
"description": "Group category or bin range"
},
"summary_statistic": {
"type": "number",
"description": "Aggregated value for this group"
},
"pixel_count": {
"type": "integer",
"description": "Number of pixels in this group"
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": ["loc", "msg", "type"],
"title": "ValidationError"
},
"CoordinateFormat": {
"type": "string",
"description": "Coordinates in GeoJSON format",
"examples": [
"[[-121.61,38.78]]",
"[[[-122.06,39.16],[-122.06,37.76],[-120.45,37.76],[-120.45,39.16]]]"
],
"title": "CoordinateFormat"
},
"DroughtBins": {
"type": "string",
"description": "Drought severity bins for pixel counting",
"examples": [
"[-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5]",
"[-3,-2,-1,0,1,2,3]"
],
"title": "DroughtBins"
},
"AreaReducer": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"stdev",
"count",
"count_un",
"skew",
"kurtosis",
"percentile_5",
"percentile_10",
"percentile_25",
"percentile_75",
"percentile_90",
"percentile_95",
"sum"
],
"description": "Spatial aggregation methods for reducing data within polygons",
"title": "AreaReducer"
},
"TemporalStatistic": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation methods for time series data",
"title": "TemporalStatistic"
}
},
"securitySchemes": {
"APIKeyHeader": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "API key authentication. Format: `Bearer YOUR_API_KEY`"
}
}
},
"tags": [
{
"name": "zonal_stats/pixel_count",
"description": "Compute pixel counts in drought categories for spatial analysis and drought monitoring"
},
{
"name": "zonal_stats/static",
"description": "Extract values from time-independent datasets like elevation, soil properties, or risk indices"
},
{
"name": "zonal_stats/temporal",
"description": "Compute temporal statistics from climate and remote sensing datasets over specified time periods"
},
{
"name": "zonal_stats/group_by",
"description": "Generate grouped summaries by categorizing one dataset and summarizing another within those categories"
}
],
"externalDocs": {
"description": "Climate Engine Documentation",
"url": "https://docs.climateengine.org/"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment