{
    "version":"0.1.0",
    "id":"dasymetric-refinement",
    "use_case":"Human Population",
    "title":"Dasymetric refinement of LAU population to raster cells",
    "description":"Performs dasymetric refinement of LAU (Local Administrative Unit) human population for a chosen focus year, redistributing population to finer CORINE Land Cover raster cells (approx. 1 km2) within a catchment. With refinement type 'weighted', population is distributed across urban CORINE classes according to the supplied weight table; if EUBUCCO building footprints are also supplied, raster cells whose building count exceeds a threshold (default 1) are additionally treated as populated. With refinement type 'simple', a binary distribution restricted to urbanised CORINE classes 111 and 112 is used instead, and building footprints and the building count threshold are not used at all (R function 'dasymetric_refinement_raster')",
    "jobControlOptions":[
        "sync-execute",
        "async-execute"
    ],
    "keywords":[
        "human population use case",
        "AquaINFRA",
        "dasymetric mapping",
        "CORINE",
        "LAU",
        "EUBUCCO",
        "buildings",
        "population refinement"
    ],
    "links":[
        {
            "type":"text/html",
            "rel":"about",
            "title":"information",
            "href":"https://example.org/process",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"self",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/processes/dasymetric-refinement?f=json",
            "title":"Process description as JSON",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"alternate",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/processes/dasymetric-refinement?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://aquainfra.ogc.igb-berlin.de/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://aquainfra.ogc.igb-berlin.de/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://aquainfra.ogc.igb-berlin.de/pygeoapi/processes/dasymetric-refinement/execution?f=json",
            "title":"Execution for this process as JSON",
            "hreflang":"en-US"
        }
    ],
    "inputs":{
        "refinement_type":{
            "title":"Refinement type",
            "description":"The dasymetric refinement strategy to use. 'weighted' distributes population across urban CORINE classes according to the weight table, and additionally treats raster cells whose building count exceeds the supplied threshold as populated when building footprints are supplied. 'simple' uses a binary distribution restricted to CORINE classes 111 and 112 only, with all weights set equal; building footprints and the building count threshold are ignored entirely in this mode.",
            "schema":{
                "type":"string",
                "enum":[
                    "simple",
                    "weighted"
                ]
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile1_corineCLC_rds":{
            "title":"CORINE CLC raster",
            "description":"Path to an .rds file containing the CORINE Land Cover raster (SpatRaster) used as ancillary data for the refinement.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile2_corineYear_rds":{
            "title":"CORINE reference year",
            "description":"Path to an .rds file containing the CORINE CLC reference year as a single value. Only year 2018 is currently supported by this function.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile3_lauInCatchment_rds":{
            "title":"LAU polygons in catchment",
            "description":"Path to an .rds file containing LAU (Local Administrative Unit) polygons within the catchment, with a 'LAU_ID' column and an observed population column for the focus year.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile4_popFocusYear_rds":{
            "title":"Population focus year",
            "description":"Path to an .rds file containing the focus year for population data as a single value, used to select the LAU population column (e.g. 'POP_2018').",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile5_catchment_gpkg":{
            "title":"Catchment geometry",
            "description":"Path to a GeoPackage file containing the catchment boundary used to crop and mask the refinement output raster.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/geopackage+sqlite3"
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile6_weightTable_rds":{
            "title":"Weight table",
            "description":"Path to an .rds file containing the dasymetric weighting table (CORINE class code, label, percent weight). Used as-is for 'weighted' refinement; for 'simple' refinement, only classes 111 and 112 are retained and all weights are set equal.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            },
            "minOccurs":1,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile7_buildings_rds":{
            "title":"EUBUCCO building footprints (optional)",
            "description":"Path to an .rds file containing EUBUCCO building footprints (sf object) for the catchment, with a 'construction_year' column. Only buildings constructed in or before the focus year (or with unknown construction year) are used. Only read and used when refinement_type is 'weighted'; entirely ignored when refinement_type is 'simple'. If not supplied, the building-count step is skipped entirely and cells are determined by CORINE classes 111/112 alone.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "inputFile8_buildingCountThreshold":{
            "title":"Building count threshold (optional)",
            "description":"Single number: raster cells with a building count exceeding this threshold are treated as populated (in addition to CORINE classes 111/112). Only applied when refinement_type is 'weighted' and inputFile7_buildings_rds is supplied; ignored when refinement_type is 'simple' or no buildings are supplied. Defaults to 1 if not supplied (only relevant when inputFile7_buildings_rds is provided).",
            "schema":{
                "type":"integer",
                "minimum":1,
                "maximum":30
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        }
    },
    "outputs":{
        "refinement_rds":{
            "title":"Estimated population raster (.rds)",
            "description":"The dasymetric refinement output raster (SpatRaster, band named 'pop_est'), cropped and masked to the catchment, with estimated population per cell rounded to 1 decimal. Saved in R's native .rds format for use in subsequent pipeline steps.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            }
        },
        "refinement_tif":{
            "title":"Estimated population raster (GeoTIFF)",
            "description":"The same dasymetric refinement output raster as 'refinement_rds', saved as a GeoTIFF file for use in GIS software.",
            "schema":{
                "type":"object",
                "contentMediaType":"image/tiff; application=geotiff"
            }
        },
        "cell_statistics":{
            "title":"LAU-CORINE cell statistics",
            "description":"Table of raster cell counts per combination of LAU ID and CORINE class, used for downstream statistics and visualisation (e.g. distribution of CORINE classes across LAU).",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            }
        },
        "corine_final":{
            "title":"CORINE raster with buildings incorporated",
            "description":"For 'weighted' refinement: the CORINE raster with classes 111/112, combined with additional cells whose building count passed the supplied threshold if building footprints were supplied (otherwise classes 111/112 only). For 'simple' refinement: the CORINE raster restricted to classes 111/112 only, with no building-derived cells added. Saved as .rds.",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-rds"
            }
        }
    },
    "example":{
        "inputs":{
            "refinement_type":"weighted",
            "inputFile1_corineCLC_rds":"corine2018_valid.rds",
            "inputFile2_corineYear_rds":"coryear2018.rds",
            "inputFile3_lauInCatchment_rds":"lau_2018_catchment.rds",
            "inputFile4_popFocusYear_rds":"2018.rds",
            "inputFile5_catchment_gpkg":"catchment.gpkg",
            "inputFile6_weightTable_rds":"weight_table_final.rds",
            "inputFile7_buildings_rds":"eubucco_buildings.rds",
            "inputFile8_buildingCountThreshold":"5"
        }
    },
    "outputTransmission":[
        "value"
    ]
}