Automatic Bounding Box Calculation
All geometryPolygon
and geometryLine
datasets require bounding box properties to define the spatial extent of the geometries: x_max
, x_min
, y_max
, and y_min
. These properties represent the maximum and minimum coordinates of the bounding box for each geometry.
While you can provide these values manually in your source data, you can also configure the system to calculate them automatically during the data upload process. This guide explains how to enable and use this feature.
Prerequisites
To use automatic bounding box calculation, your dataset definition must include a DWH property of type geometry
. This property must contain the actual geometry data for each record in either Well-Known Text (WKT) or Well-Known Binary (WKB) format. The bounding box coordinates will be calculated directly from this geometry data.
Enabling Automatic Calculation
You can enable automatic calculation on a per-property basis. To do this, add the "calculated": true
flag to the definition of the specific bounding box property (x_max
, x_min
, y_max
, or y_min
) within your dataset definition JSON.
Here's an example of how to enable automatic calculation for the x_min
property:
{
"name": "x_min",
"title": "x_min",
"column": "x_min",
"type": "decimal(19,6)",
"filterable": false,
"calculated": true // This enables automatic calculation
},
You would repeat this process, adding "calculated": true
, for each of the bounding box properties (x_max
, y_max
, y_min
) that you want the system to calculate automatically.
Important Considerations
CSV Data Constraint: When you set
"calculated": true
for a property (e.g.,x_min
), your source CSV file must not contain a column corresponding to that property (x_min
in this case). Including the column in the CSV when calculation is enabled will result in an upload error.Geometry Validity: The automatic calculation relies on valid data in your
geometry
property. If the geometry data for a specific record is missing, null, or invalid (e.g., malformed WKT/WKB), the calculation will fail, leading to an error during the upload process for that record.
Manual Alternative
If you choose not to enable automatic calculation for any of the x_max
, x_min
, y_max
, or y_min
properties, you must provide these columns with valid data directly in your source CSV file, as they are required properties for geometryPolygon
and geometryLine
datasets.
Example Dataset Definition
{
"name": "zsj_d_dwh",
"type": "dataset",
"title": "Basic Residential Units - parts",
"properties": {
"featureTitle": {
"type": "property",
"value": "nazev"
},
"featureSubtitle": {
"type": "function",
"value": "concat",
"content": [
{
"type": "text",
"value": "Municipality "
},
{
"type": "property",
"value": "upper_name"
}
]
}
},
"ref": {
"type": "dwh",
"subtype": "geometryPolygon",
"geometry": "zsjd-f75b60",
"primaryKey": "kod_zsj_d",
"categorizable": false,
"fullTextIndex": false,
"properties": [
{
"name": "kod_zsj_d",
"title": "kod_zsj_d",
"column": "kod_zsj_d",
"type": "string",
"filterable": true
},
{
"name": "x_min",
"title": "x_min",
"column": "x_min",
"type": "decimal(19,6)",
"filterable": false,
"calculated": true
},
{
"name": "x_max",
"title": "x_max",
"column": "x_max",
"type": "decimal(19,6)",
"filterable": false,
"calculated": true
},
{
"name": "y_min",
"title": "y_min",
"column": "y_min",
"type": "decimal(19,6)",
"filterable": false,
"calculated": true
},
{
"name": "y_max",
"title": "y_max",
"column": "y_max",
"type": "decimal(19,6)",
"filterable": false,
"calculated": true
},
{
"name": "nazev",
"title": "Název",
"column": "nazev",
"type": "string",
"filterable": true
},
{
"name": "popis",
"title": "Description",
"column": "popis",
"type": "string",
"filterable": false
},
{
"name": "kod_zsj",
"title": "kod_zsj",
"column": "kod_zsj",
"type": "string",
"filterable": false
},
{
"name": "kod_cast_obec",
"title": "kod_cast_obec",
"column": "kod_cast_obec",
"type": "string",
"filterable": false
},
{
"name": "kod_zuj",
"title": "kod_zuj",
"column": "kod_zuj",
"type": "string",
"filterable": false
},
{
"name": "upper_name",
"title": "Upper name",
"column": "upper_name",
"type": "string",
"filterable": false
},
{
"name": "area",
"title": "Rozloha",
"column": "area",
"type": "decimal(19,6)",
"filterable": true
},
{
"name": "kod_pou",
"title": "kod_pou",
"column": "kod_pou",
"type": "string",
"filterable": false
},
{
"name": "wkt",
"title": "wkt geometry",
"column": "wkt",
"type": "geometry",
"filterable": false
}
]
},
"dataSources": [
{
"licenceHolder": "RUIAN - ČÚZK",
"licenceHolderUrl": "http://vdp.cuzk.cz/",
"licenceUrl": "https://www.cuzk.cz/Uvod/Produkty-a-sluzby/RUIAN/RUIAN-(1).aspx"
},
{
"licenceHolder": "Český statistický úřad",
"licenceHolderUrl": "https://www.czso.cz/csu/czso/home",
"licenceUrl": "https://www.czso.cz/csu/czso/podminky_pro_vyuzivani_a_dalsi_zverejnovani_statistickych_udaju_csu"
}
]
}