{
    "version":"0.1.0",
    "id":"GDP-CalcAggStac",
    "title":"Run aggregation using NHGF STAC catalog",
    "description":"Apply gdptools aggregation to user polygons using NHGF STAC catalog metadata and pre-computed weights.",
    "jobControlOptions":[
        "sync-execute",
        "async-execute"
    ],
    "keywords":[
        "area-weighted intersections",
        "gdptools",
        "aggregation",
        "stac",
        "nhgf"
    ],
    "links":[
        {
            "type":"text/html",
            "rel":"about",
            "title":"Project documentation",
            "href":"https://gdptools-pygeoapi-plugin.readthedocs.io/en/latest/usage.html#calc-agg-stac-process",
            "hreflang":"en"
        },
        {
            "type":"application/json",
            "rel":"describedby",
            "title":"NHGF STAC Catalog",
            "href":"https://api.water.usgs.gov/gdp/pygeoapi/stac/stac-collection/",
            "hreflang":"en"
        },
        {
            "type":"application/json",
            "rel":"self",
            "href":"https://api.water.usgs.gov:443/gdp/pygeoapi/processes/GDP-CalcAggStac?f=json",
            "title":"Process description as JSON",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"alternate",
            "href":"https://api.water.usgs.gov:443/gdp/pygeoapi/processes/GDP-CalcAggStac?f=html",
            "title":"Process description as HTML",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/job-list",
            "href":"https://api.water.usgs.gov:443/gdp/pygeoapi/jobs?f=html",
            "title":"Jobs list as HTML",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/job-list",
            "href":"https://api.water.usgs.gov:443/gdp/pygeoapi/jobs?f=json",
            "title":"Jobs list as JSON",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/execute",
            "href":"https://api.water.usgs.gov:443/gdp/pygeoapi/processes/GDP-CalcAggStac/execution?f=json",
            "title":"Execution for this process as JSON",
            "hreflang":"en-US"
        }
    ],
    "inputs":{
        "collection_id":{
            "title":"STAC Collection ID",
            "description":"The ID of a collection in the NHGF STAC catalog (e.g., 'conus404', 'terraclim').",
            "schema":{
                "type":"string"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "variables":{
            "title":"Variable names",
            "description":"JSON array of variable names to extract from the STAC collection (e.g., '[\"PWAT\", \"T2\"]').",
            "schema":{
                "type":"string",
                "contentMediaType":"application/json"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "weights":{
            "title":"Weight table",
            "description":"JSON-exported DataFrame produced by calc_weights_stac.",
            "schema":{
                "type":"string",
                "contentMediaType":"application/json"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "shape_file":{
            "title":"Feature collection",
            "description":"GeoJSON FeatureCollection for the polygon(s) being aggregated.",
            "schema":{
                "type":"string",
                "contentMediaType":"application/geo+json"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "shape_crs":{
            "title":"Feature CRS",
            "description":"EPSG code or proj string describing the feature CRS.",
            "schema":{
                "type":"string"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "shape_poly_idx":{
            "title":"Feature identifier field",
            "description":"Name of the column containing the polygon identifier.",
            "schema":{
                "type":"string"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "start_date":{
            "title":"Start date",
            "description":"Beginning of the aggregation window (YYYY-MM-DD).",
            "schema":{
                "type":"string",
                "format":"date"
            },
            "minOccurs":1,
            "maxOccurs":1
        },
        "end_date":{
            "title":"End date",
            "description":"End of the aggregation window (YYYY-MM-DD).",
            "schema":{
                "type":"string",
                "format":"date"
            },
            "minOccurs":1,
            "maxOccurs":1
        }
    },
    "outputs":{
        "aggregated_json":{
            "title":"Aggregated result",
            "description":"JSON records (time, varname, units, polygon columns).",
            "schema":{
                "type":"object",
                "contentMediaType":"application/json"
            }
        }
    },
    "example":{
        "inputs":{
            "collection_id":"conus404_daily",
            "variables":"[\"T2\"]",
            "weights":"{\"i\":{\"0\":2,\"1\":1},\"index\":{\"0\":0,\"1\":1},\"j\":{\"0\":3,\"1\":3},\"poly_idx\":{\"0\":\"1\",\"1\":\"1\"},\"wght\":{\"0\":0.5,\"1\":0.5}}",
            "shape_file":"{\"type\": \"FeatureCollection\", \"features\": [{\"id\": \"0\", \"type\": \"Feature\", \"properties\": {\"id\": 1, \"poly_idx\": \"1\"}, \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [[[-105.5, 40.0], [-105.0, 40.0], [-105.0, 40.5], [-105.5, 40.5], [-105.5, 40.0]]]}}]}",
            "shape_crs":"4326",
            "shape_poly_idx":"poly_idx",
            "start_date":"1999-01-01",
            "end_date":"1999-01-07"
        }
    },
    "outputTransmission":[
        "value"
    ]
}