# Latvia 3D Density Atlas data dictionary

The 1 km downloads describe 65,644 official statistical squares intersecting Latvia. Population refers to 1 January 2026. Registered building coverage uses the VZD cadastral snapshot of 21 November 2026. Each row carries its source, status and reference year or snapshot date.

## Choose a file

| File | Use |
|---|---|
| `cells_1km.gpkg` | Open the `cells` polygon layer in QGIS. Filter on the text field `cell_id` to find a square selected in the viewer. Both metrics and their display classes are included. |
| `cells_1km.geojson` | The same cells and properties in an RFC 7946 FeatureCollection. Its feature ID equals `cell_id`. Coordinates use WGS 84 longitude, latitude in decimal degrees. The collection's `atlas` member contains provenance and licensing. |
| `cells_1km.csv` | Join `cell_id` as text to the GeoPackage's `cells` layer. Alternatively, import `longitude` as X and `latitude` as Y in EPSG:4326 to plot full-cell centroids. |
| `cells_100m_buildings.gpkg` | Separate high-resolution building download. Its `cells` layer stores 407,334 squares with known footprint area or an allocated registered building. Its `country` and `coverage_gaps` layers carry boundary and missing-coverage geometry. |
| [Coverage index](detail-status.bin.gz) and [index specification](detail-status.json) | Complete 100 m coverage status, including squares omitted from the sparse GeoPackage. The JSON supplies origin, dimensions, codes and checksums. |
| `metadata.json`, `qa.json`, `visual_config.json` and `downloads.json` | Source manifest and CRS history, national verification report, frozen display parameters, and download sizes, SHA-256 hashes and reuse terms. |

GeoPackage polygons use ETRS89-extended / LAEA Europe (EPSG:3035). They retain the entire original statistical square, including at the coast. The viewer clips display polygons to Latvia and slightly insets its raised columns. In the Exposure view, colour fills each square up to the national boundary and represents `people_km2` on a logarithmic scale. The underlying metrics use the full cell area. CSP source grids use LKS-92 / Latvia TM (EPSG:3059). The frozen cadastral and boundary files declare LKS-2020 / Latvia TM (EPSG:10306).

## Common fields

| Field | Type and meaning |
|---|---|
| `cell_id` | Unique official CSP text ID. For example, `1kmX414Y345` is a 1 km square with southwest native grid coordinates 414,000 m east and 345,000 m north. In `100mX4147Y3459`, multiply each index by 100 m. |
| `geom` | Full polygon in a GeoPackage. GeoJSON uses its standard `geometry` member. |
| `resolution_m` | Native grid size, 1,000 or 100 metres. |
| `cell_area_m2` | Full polygon area in square metres measured in EPSG:3035. Projection changes mean this can differ slightly from the nominal square area. |
| `longitude`, `latitude` | CSV only. WGS 84 coordinates of the full polygon's EPSG:3035 centroid after transformation. |
| `grid_crs`, `building_source_crs`, `calculation_crs` | CSV only. EPSG identifiers for the original grid, the frozen cadastral geometry and the metric calculation. |

## Population fields in the 1 km files

| Field | Type and meaning |
|---|---|
| `population`, `people_km2` | Nullable integer disclosed count and nullable density in persons/km². Divide the count by full cell area in km². |
| `pop_status`, `pop_reason` | Publication status and the reason assigned from source fields. `observed` and `observed_zero` permit exact values. `suppressed` with `published_interval` preserves a published band. `assumed_zero` with `absent_row` identifies a 2026 square whose population and density are set to zero because CSP omitted its total row. This is an atlas assumption. |
| `numb_flag`, `pop_lower`, `pop_upper` | CSP's source count flag and inclusive published bounds when available. Code `77` means 1 to 10 people. Only the bounds are public in these cells. Exact count, density, class and height are null. |
| `pop_year`, `pop_source`, `pop_unit` | Selected source year, source identifier and density unit. The slice is `TIME=2026`, `SEX=T`, `AgeGroup=TOTAL` in CSP TER010_01. |
| `pop_class`, `pop_height_m` | Class and illustrative height of a disclosed density. Height uses map metres. |

This snapshot has 9,698 exact population observations, 21,726 published intervals and 34,220 squares with no observation. Its exact observations contain no reported zeros. These data support statistical comparison at the published grid resolution.

## Registered building fields at both resolutions

| Field | Type and meaning |
|---|---|
| `building_count`, `building_count_per_km2` | Nullable integer count and numeric count per full cell km². One representative point allocates each distinct cadastral building to a single cell at each resolution. A footprint can cover an adjacent cell whose allocated count is zero. |
| `building_cov_pct` | Primary building metric. One hundred times the area of the union of registered footprints intersecting the cell in Latvia, divided by full cell area. A value of 5 means 5%. |
| `building_status` | `calculated` permits measured zero and positive values. `incomplete` indicates partially missing cadastral coverage. `unknown` indicates that all of the cell's Latvian land lies within a coverage gap. Exact public metrics are null for both gap states. |
| `known_count`, `footprint_m2` | The contributing count of distinct accepted buildings and union area in m² from the available records. For gap cells these are partial contributions. |
| `building_snapshot`, `building_source`, `building_unit` | Cadastral snapshot date, source identifier and coverage unit (%). The measure includes all registered building uses. The publisher excludes restricted objects from its open data. |
| `building_class`, `building_height_m` | Class and illustrative height of calculated footprint coverage. Exact zero has height zero. |

### Resolve an omitted 100 m cell

First look for its ID in the 100 m GeoPackage. If absent, decompress `detail-status.bin.gz` to an array of unsigned bytes. Read the grid origin `[x0,y0]`, width and height from `detail-status.json`. For official 100 m indices `ix,iy`, compute `x=ix−x0` and `y=iy−y0`. Inside the array bounds the byte position is `y*width+x`. Rows progress from south to north.

| Code | Interpretation for a missing row |
|---|---|
| 0 or outside the array | Outside the in-country grid. |
| 1 | Calculated registered footprint, count and coverage are zero. |
| 2 | Incomplete coverage. Exact count and coverage are unknown. |
| 3 | Unknown coverage. Exact count and coverage are unknown. |

The status array covers 6,468,607 in-country cells. Among them, 5,908,964 omitted cells have a calculated zero. Use the status array whenever a sparse row is absent.

## Classes, precision and nulls

| Metric | Low | Medium | High |
|---|---:|---:|---:|
| Population, persons/km² | below 100 | 100 to below 1,000 | 1,000 or more |
| Registered building coverage, 1 km | below 1% | 1% to below 5% | 5% or more |
| Registered building coverage, 100 m | below 5% | 5% to below 20% | 20% or more |

Population uses green, yellow and red for low, medium and high density. The Buildings viewer subdivides the exported low class. Measured zero uses the background colour. Positive coverage below 0.5% at 1 km or below 1% at 100 m is light grey (sparse). The rest of the low class is green. Medium and high are yellow and red. Incomplete and unknown coverage share a muted blue on the map. The exports retain the specific status. Each height uses the raw measurement and a capped logarithmic transform. The cap is the 99th percentile of positive valid values for that metric and resolution. The height illustrates density. Null class and height preserve missing measurements.

CSV is UTF-8 with a comma delimiter and a header row. An unquoted empty field represents null. A quoted empty string in `numb_flag` means that the published source row had no count flag. CSV applications that merge these cases can use `pop_reason=absent_row` to identify an absent observation. Numeric exports preserve the precision of the canonical measurements. The Buildings popup shows the registered building count and the footprint in square metres per nominal cell area, rounded to the nearest square metre. Positive values below one square metre display as <1 m².

## Credits and reuse

The atlas transforms the official geometries, joins population observations to grid cells, aggregates unique registered footprints, and derives counts, coverage, classes and visual heights. The neutral background is drawn locally. The country outline and place labels use State Address Register data. The map makes no third-party background-tile requests.

- Central Statistical Bureau of Latvia (CSP). Population in 1 km grid cells, TER010_01. [Dataset](https://data.gov.lv/dati/dataset/iedzivotaji) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- CSP. Statistical grid geometry and structural code dictionaries. [Grid](https://data.gov.lv/dati/dataset/rezgis) · [Codebooks](https://data.gov.lv/dati/dataset/csp-strukturalie-metadati) · [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/)
- State Land Service of Latvia (VZD). Open cadastral spatial data, including registered building footprints. [Dataset](https://data.gov.lv/dati/dataset/kadastra-informacijas-sistemas-atverti-telpiskie-dati) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- VZD. State Address Register administrative boundaries and place coordinates. [Dataset](https://data.gov.lv/dati/dataset/varis-atvertie-dati) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
