# sodb2021-budovy: houses by type and dwellings by type of building, Senec, census 2021

How many houses Senec had on census day, 1 January 2021, by type of house, and how many dwellings, by the
type of building they are in, as the 2021 census (Sčítanie obyvateľov, domov a bytov 2021, ŠÚ SR) publishes
them for the town (`SK0108508217`). Built on 8 Nov 2026 by `scripts/fetch_sodb2021.py`, beside its other
output `sodb2021.json`.

Houses: 4,444, of them 3,061 family houses (`rodinný dom`, 68.88 %) and 390 apartment buildings
(`bytový dom`, 8.78 %). Dwellings: 9,894, of them 4,908 in apartment buildings (49.61 %) and 3,226 in family
houses (32.61 %).

## Files

| File | Content |
|---|---|
| `sodb2021-budovy.json` | a list of 18 records: 9 types of house (`measure` `domy`), then 9 types of building for the dwellings (`measure` `byty`), in the layers' order |
| `sodb2021-budovy.csv` | the same records, one row each, same columns. UTF-8, CRLF, empty = null |

## Source

ŠÚ SR's census GIS, ArcGIS REST, no key; one query per layer for the town:

| `measure` | Layer | Query |
|---|---|---|
| `domy` | `dom_char_typ_pl/FeatureServer/4` (`DA8465_obec_SK`, houses by type of house, municipalities) | `https://gis.scitanie.sk/server/rest/services/Hosted/dom_char_typ_pl/FeatureServer/4/query?where=uzemie='SK0108508217'&outFields=*&returnGeometry=false&f=json` |
| `byty` | `byty_char_typ_pl/FeatureServer/2` (`DA8465B_obec_SK`, dwellings by type of building, municipalities) | the same on `byty_char_typ_pl/FeatureServer/2` |

Each layer returns one feature for Senec: a count and a share per type (`cv_<n>` and `cv_<n>p`) and the total
(`spolu`). The type names are the layer's field aliases, copied as given. The build stops if the types don't
add up to the total.

Terms (read 9 Nov 2026): CC BY 4.0, with ŠÚ SR named as the source. The census GIS states no terms of its own
(its ArcGIS items carry no licence, and scitanie.sk has no terms page). ŠÚ SR's terms of use
(`https://statdata.statistics.sk/public/ui/dc/domov/terms-of-use`) cover the statistical information on its websites
under CC BY 4.0, and ŠÚ SR registers the 2021 census tables in NKOD as CC BY 4.0 (for example `om7814rr`, houses by
type and form of ownership).

## Fields

| Field | Content |
|---|---|
| `record_id` | `<measure>-<building_type_code>`, such as `domy-cv_1`: from the layer and its field name, so a rebuild keeps it |
| `territory_code`, `territory` | the census code and name of the town: `SK0108508217`, Senec |
| `census_date` | the census day, `2021-01-01` |
| `measure` | `domy` (houses) or `byty` (dwellings) |
| `measure_label` | `domy podľa typu domu` or `byty podľa typu budovy` |
| `building_type_code` | the layer's field for the type: `cv_1` rodinný dom, `cv_2` bytový dom, `cv_3` polyfunkčná budova, `cv_5` ostatné budovy na bývanie, `cv_7` neskolaudovaný rodinný dom, `cv_9` núdzový objekt, neurčený na bývanie, `cv_91` inštitucionálne alebo kolektívne zariadenia, `cv_90` ostatné, `cv_0` nezistený. The same codes in both layers |
| `building_type` | the type's name, the layer's alias for the field |
| `count` | houses (`domy`) or dwellings (`byty`) of that type |
| `share_pct` | the census's own share of the total, in %, two decimals (`cv_<n>p`), not recomputed |
| `total` | all houses (4,444) or all dwellings (9,894) in the town, the layer's `spolu` |
| `source_layer` | the layer, as `<service>/FeatureServer/<id>` |
| `source_url` | the query that returned the record (the table above) |
| `last_update` | the day the record's content last changed (kept by `dataset_io.write_dataset` while the census figures stay the same) |

## Caveats

- A census count, once: 1 January 2021. Houses and dwellings built since are not in it.
- `byty` counts dwellings by the type of the building they are in, so the 3,226 dwellings in family houses
  and the 3,061 family houses are different units: one family house can hold more than one dwelling.
- This is not the register of addresses: `adresy-senec` counts address points by the cadastre's building type,
  a different measure from a different date.

## Rebuild

```bash
.venv/bin/python -I scripts/fetch_sodb2021.py   # every SODB layer the script reads, 3 s apart (~30 s); rewrites sodb2021.json too
```

## License

Published by Som Senec under the Creative Commons Attribution 4.0 International licence (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/. You may use it for any purpose, commercial use included, if you credit "Som Senec, somsenec.sk". The source documents that each record links to keep their own terms.
