hypercadaster-ES 1.3.0__tar.gz → 1.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hypercadaster_es-1.3.0/hypercadaster_es.egg-info → hypercadaster_es-1.3.2}/PKG-INFO +28 -29
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/README.md +10 -4
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/__init__.py +1 -1
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/_db.py +3 -2
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/downloaders.py +15 -1
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/mergers.py +11 -3
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/utils.py +151 -26
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2/hypercadaster_es.egg-info}/PKG-INFO +28 -29
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_es.egg-info/requires.txt +16 -10
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/setup.py +19 -11
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/LICENSE +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/MANIFEST.in +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/_pretty.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/building_inference.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/cached_files/ine_inspire_codes.xlsx +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/energy.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/energy_config.yaml +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/functions.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/interoperability.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/reporting.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/social.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/topology.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_ES/weather.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_es.egg-info/SOURCES.txt +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_es.egg-info/dependency_links.txt +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_es.egg-info/top_level.txt +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/setup.cfg +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_aggregation.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_agricultural_archetype.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_cat_cache.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_cat_empty_schema.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_census_tract_aggregations.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_code_normalisation.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_codes.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_dem_tiles.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_energy_config.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_energy_scenarios.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_floorplan_partition.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_geometry.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_import_surface.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_live_smoke.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_shadow_rules.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_social.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_theoretical_cat_spaces.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_topology.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_weather.py +0 -0
- {hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/tests/test_zero_floor_buildings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: hypercadaster_es
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.2
|
|
4
4
|
Summary: Python library to obtain the Spanish cadaster data joined with external attributes.
|
|
5
5
|
Home-page: https://github.com/BeeGroup-cimne
|
|
6
6
|
Author: Jose Manuel Broto Vispe
|
|
@@ -33,7 +33,7 @@ Requires-Dist: shapely<3.0,>=2.0
|
|
|
33
33
|
Requires-Dist: pyproj<4.0,>=3.5
|
|
34
34
|
Requires-Dist: rasterio<2.0,>=1.3
|
|
35
35
|
Requires-Dist: fiona<2.0,>=1.9
|
|
36
|
-
Requires-Dist: geopandas<1.1
|
|
36
|
+
Requires-Dist: geopandas<1.2,>=1.1.2
|
|
37
37
|
Requires-Dist: pyogrio<1.0,>=0.8
|
|
38
38
|
Requires-Dist: affine>=2.4
|
|
39
39
|
Requires-Dist: snuggs>=1.4
|
|
@@ -43,28 +43,34 @@ Requires-Dist: pyrosm>=0.6
|
|
|
43
43
|
Requires-Dist: networkx>=3.2
|
|
44
44
|
Requires-Dist: eppy>=0.5.63
|
|
45
45
|
Requires-Dist: geomeppy>=0.12
|
|
46
|
-
Requires-Dist: pyarrow>=
|
|
46
|
+
Requires-Dist: pyarrow>=23.0.1
|
|
47
47
|
Requires-Dist: openpyxl>=3.1
|
|
48
48
|
Requires-Dist: et-xmlfile>=1.1
|
|
49
49
|
Requires-Dist: arrow>=1.4.0
|
|
50
50
|
Requires-Dist: fastkml>=1.4.0
|
|
51
|
-
Requires-Dist: lxml>=6.0
|
|
52
|
-
Requires-Dist: duckdb
|
|
53
|
-
Requires-Dist:
|
|
54
|
-
Requires-Dist:
|
|
51
|
+
Requires-Dist: lxml>=6.1.0
|
|
52
|
+
Requires-Dist: duckdb<2,>=1.5.3
|
|
53
|
+
Requires-Dist: cdsapi>=0.7
|
|
54
|
+
Requires-Dist: xarray>=2024.1
|
|
55
|
+
Requires-Dist: cfgrib>=0.9.10
|
|
56
|
+
Requires-Dist: pvlib>=0.11
|
|
57
|
+
Requires-Dist: requests<3.0,>=2.33
|
|
58
|
+
Requires-Dist: urllib3<3,>=2.8
|
|
55
59
|
Requires-Dist: charset-normalizer>=3.3
|
|
56
|
-
Requires-Dist: idna>=3.
|
|
57
|
-
Requires-Dist: certifi>=
|
|
60
|
+
Requires-Dist: idna>=3.15
|
|
61
|
+
Requires-Dist: certifi>=2026.10.18
|
|
58
62
|
Requires-Dist: beautifulsoup4>=4.12
|
|
59
|
-
Requires-Dist: soupsieve>=2.
|
|
63
|
+
Requires-Dist: soupsieve>=2.9
|
|
60
64
|
Requires-Dist: xmltodict>=0.13
|
|
61
65
|
Requires-Dist: matplotlib<4,>=3.8
|
|
62
66
|
Requires-Dist: contourpy>=1.2
|
|
63
67
|
Requires-Dist: cycler>=0.12
|
|
64
68
|
Requires-Dist: kiwisolver>=1.4
|
|
65
69
|
Requires-Dist: fonttools>=4.53
|
|
66
|
-
Requires-Dist: pillow>=
|
|
70
|
+
Requires-Dist: pillow>=13.0
|
|
67
71
|
Requires-Dist: folium>=0.20.0
|
|
72
|
+
Requires-Dist: contextily>=1.5
|
|
73
|
+
Requires-Dist: plotly>=5.20
|
|
68
74
|
Requires-Dist: click>=8.1
|
|
69
75
|
Requires-Dist: click-plugins>=1.1
|
|
70
76
|
Requires-Dist: cligj>=0.7
|
|
@@ -83,27 +89,14 @@ Requires-Dist: ruff>=0.4; extra == "dev"
|
|
|
83
89
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
84
90
|
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
85
91
|
Requires-Dist: pdoc>=14.0; extra == "dev"
|
|
86
|
-
Dynamic: author
|
|
87
|
-
Dynamic: author-email
|
|
88
|
-
Dynamic: classifier
|
|
89
|
-
Dynamic: description
|
|
90
|
-
Dynamic: description-content-type
|
|
91
|
-
Dynamic: home-page
|
|
92
|
-
Dynamic: keywords
|
|
93
|
-
Dynamic: license
|
|
94
|
-
Dynamic: license-file
|
|
95
|
-
Dynamic: provides-extra
|
|
96
|
-
Dynamic: requires-dist
|
|
97
|
-
Dynamic: requires-python
|
|
98
|
-
Dynamic: summary
|
|
99
92
|
|
|
100
93
|
# hypercadaster_ES
|
|
101
94
|
|
|
102
95
|
A comprehensive Python library for downloading, processing, and analyzing Spanish cadastral data with integration of external geographic datasets and EnergyPlus model generation.
|
|
103
96
|
|
|
104
|
-
[](https://python.org)
|
|
105
98
|
[](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
|
|
106
|
-
[](https://github.com/BeeGroup-cimne/hypercadaster_ES)
|
|
107
100
|
|
|
108
101
|
## 🎯 Overview
|
|
109
102
|
|
|
@@ -206,9 +199,15 @@ For detailed installation instructions and advanced examples, see [Installation
|
|
|
206
199
|
|
|
207
200
|
## 👥 Authors & Contributors
|
|
208
201
|
|
|
209
|
-
**
|
|
202
|
+
**Main Authors:**
|
|
210
203
|
- **Jose Manuel Broto Vispe** - jmbrotovispe@gmail.com
|
|
211
204
|
- **Gerard Mor** - gmor@cimne.upc.edu
|
|
205
|
+
- **Maite Sellart** - tsellart@cimne.upc.edu
|
|
206
|
+
|
|
207
|
+
**Co-authors:**
|
|
208
|
+
- **David Blanco** - dblanco@cimne.upc.edu
|
|
209
|
+
- **Gerard Laguna** - glaguna@cimne.upc.edu
|
|
210
|
+
- **Nadiya Mehraj** - nmehraj@cimne.upc.edu
|
|
212
211
|
|
|
213
212
|
**Institutional Affiliations:**
|
|
214
213
|
- **CIMNE** - Centre Internacional de Mètodes Numèrics en Enginyeria, Building Energy and Environment (BEE) group
|
|
@@ -222,4 +221,4 @@ This project is licensed under the **EUPL v1.2**. See the [license](https://join
|
|
|
222
221
|
|
|
223
222
|
*hypercadaster_ES - Built with ❤️ for the Spanish urban analysis and building research community*
|
|
224
223
|
|
|
225
|
-
*Last updated:
|
|
224
|
+
*Last updated: November 2026 | Version 1.3.2*
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A comprehensive Python library for downloading, processing, and analyzing Spanish cadastral data with integration of external geographic datasets and EnergyPlus model generation.
|
|
4
4
|
|
|
5
|
-
[](https://python.org)
|
|
6
6
|
[](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
|
|
7
|
-
[](https://github.com/BeeGroup-cimne/hypercadaster_ES)
|
|
8
8
|
|
|
9
9
|
## 🎯 Overview
|
|
10
10
|
|
|
@@ -107,9 +107,15 @@ For detailed installation instructions and advanced examples, see [Installation
|
|
|
107
107
|
|
|
108
108
|
## 👥 Authors & Contributors
|
|
109
109
|
|
|
110
|
-
**
|
|
110
|
+
**Main Authors:**
|
|
111
111
|
- **Jose Manuel Broto Vispe** - jmbrotovispe@gmail.com
|
|
112
112
|
- **Gerard Mor** - gmor@cimne.upc.edu
|
|
113
|
+
- **Maite Sellart** - tsellart@cimne.upc.edu
|
|
114
|
+
|
|
115
|
+
**Co-authors:**
|
|
116
|
+
- **David Blanco** - dblanco@cimne.upc.edu
|
|
117
|
+
- **Gerard Laguna** - glaguna@cimne.upc.edu
|
|
118
|
+
- **Nadiya Mehraj** - nmehraj@cimne.upc.edu
|
|
113
119
|
|
|
114
120
|
**Institutional Affiliations:**
|
|
115
121
|
- **CIMNE** - Centre Internacional de Mètodes Numèrics en Enginyeria, Building Energy and Environment (BEE) group
|
|
@@ -123,4 +129,4 @@ This project is licensed under the **EUPL v1.2**. See the [license](https://join
|
|
|
123
129
|
|
|
124
130
|
*hypercadaster_ES - Built with ❤️ for the Spanish urban analysis and building research community*
|
|
125
131
|
|
|
126
|
-
*Last updated:
|
|
132
|
+
*Last updated: November 2026 | Version 1.3.2*
|
|
@@ -26,7 +26,7 @@ from ._db import ResultsHandle
|
|
|
26
26
|
from . import (mergers, utils, building_inference, downloaders, interoperability,
|
|
27
27
|
energy, weather, social, topology, reporting)
|
|
28
28
|
|
|
29
|
-
__version__ = "1.3.
|
|
29
|
+
__version__ = "1.3.2"
|
|
30
30
|
__author__ = "Jose Manuel Broto Vispe"
|
|
31
31
|
__email__ = "jmbrotovispe@gmail.com"
|
|
32
32
|
|
|
@@ -131,9 +131,10 @@ def cat_cache_read(results_dir: str, cadaster_code: str):
|
|
|
131
131
|
con = duckdb.connect(path, read_only=True)
|
|
132
132
|
if not _table_exists(con, CAT_SPACES_TABLE):
|
|
133
133
|
return None
|
|
134
|
-
|
|
134
|
+
# Relation .pl(): duckdb 2.0 dropped .pl() on the DB-API connection.
|
|
135
|
+
df = con.sql(
|
|
135
136
|
f'SELECT * FROM "{CAT_SPACES_TABLE}" WHERE cadaster_code = ?',
|
|
136
|
-
[str(cadaster_code)],
|
|
137
|
+
params=[str(cadaster_code)],
|
|
137
138
|
).pl()
|
|
138
139
|
if df.height == 0:
|
|
139
140
|
return None
|
|
@@ -2299,6 +2299,13 @@ def parse_CAT_file(cadaster_code, CAT_files_dir, allowed_dataset_types = [14, 15
|
|
|
2299
2299
|
"""
|
|
2300
2300
|
# Function to parse a single line into a dictionary for each record type
|
|
2301
2301
|
def process_line(line, allowed_dataset_types):
|
|
2302
|
+
# Skip empty lines or lines with only whitespace
|
|
2303
|
+
if not line or not line.strip():
|
|
2304
|
+
return None
|
|
2305
|
+
|
|
2306
|
+
if len(line) < 2 or not line[:2].strip().isdigit():
|
|
2307
|
+
return None
|
|
2308
|
+
|
|
2302
2309
|
parsed_row = {}
|
|
2303
2310
|
|
|
2304
2311
|
line = line.encode('utf-8').decode('utf-8')
|
|
@@ -2326,6 +2333,9 @@ def parse_CAT_file(cadaster_code, CAT_files_dir, allowed_dataset_types = [14, 15
|
|
|
2326
2333
|
|
|
2327
2334
|
# Aggregate rows for each type from parsed rows
|
|
2328
2335
|
for row_dict in parsed_rows:
|
|
2336
|
+
if row_dict is None:
|
|
2337
|
+
continue
|
|
2338
|
+
|
|
2329
2339
|
for dataset_type, row in row_dict.items():
|
|
2330
2340
|
row_data[dataset_type].append(row)
|
|
2331
2341
|
|
|
@@ -2333,7 +2343,11 @@ def parse_CAT_file(cadaster_code, CAT_files_dir, allowed_dataset_types = [14, 15
|
|
|
2333
2343
|
combined_dfs = {}
|
|
2334
2344
|
for dataset_type, rows in row_data.items():
|
|
2335
2345
|
schema = {i[3]: i[4] for i in catstruct[dataset_type]}
|
|
2336
|
-
|
|
2346
|
+
cleaned_rows = []
|
|
2347
|
+
for row in rows:
|
|
2348
|
+
cleaned_row = [None if v == "" else v for v in row]
|
|
2349
|
+
cleaned_rows.append(cleaned_row)
|
|
2350
|
+
combined_dfs[dataset_type] = pl.DataFrame(cleaned_rows, schema=schema, orient="row")
|
|
2337
2351
|
|
|
2338
2352
|
return combined_dfs
|
|
2339
2353
|
|
|
@@ -18,6 +18,7 @@ import os
|
|
|
18
18
|
import glob
|
|
19
19
|
import numpy as np
|
|
20
20
|
import pandas as pd
|
|
21
|
+
import time
|
|
21
22
|
from ._pretty import PrettyDict
|
|
22
23
|
import polars as pl
|
|
23
24
|
import geopandas as gpd
|
|
@@ -1095,9 +1096,16 @@ def join_cadaster_building(gdf, cadaster_dir, census_tracts_dir, DEM_raster_dir,
|
|
|
1095
1096
|
'reference': 'building_reference',
|
|
1096
1097
|
'beginning': 'year_of_construction'
|
|
1097
1098
|
})
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1099
|
+
if 'year_of_construction' in building_gdf_.columns:
|
|
1100
|
+
building_gdf_['year_of_construction'] = (
|
|
1101
|
+
building_gdf_['year_of_construction']
|
|
1102
|
+
.astype('string')
|
|
1103
|
+
.str[:4]
|
|
1104
|
+
)
|
|
1105
|
+
|
|
1106
|
+
building_gdf_['year_of_construction'] = pd.to_numeric(
|
|
1107
|
+
building_gdf_['year_of_construction'], errors='coerce').astype('Int64')
|
|
1108
|
+
|
|
1101
1109
|
building_gdf_.drop(
|
|
1102
1110
|
["localId", "namespace", "officialAreaReference", "value_uom", "horizontalGeometryEstimatedAccuracy",
|
|
1103
1111
|
"horizontalGeometryEstimatedAccuracy_uom", "horizontalGeometryReference", "referenceGeometry",
|
|
@@ -3854,7 +3854,7 @@ def _create_full_street_names(gdf):
|
|
|
3854
3854
|
|
|
3855
3855
|
return gdf_result
|
|
3856
3856
|
|
|
3857
|
-
def flat_gdf_to_building_spaces_resolution(gdf, building_reference_col="building_reference"):
|
|
3857
|
+
def flat_gdf_to_building_spaces_resolution(gdf, building_reference_col="building_reference", chunk_size=50_000):
|
|
3858
3858
|
"""Explode a building-level (Geo)DataFrame to one row per building space.
|
|
3859
3859
|
|
|
3860
3860
|
Each ``br__building_spaces_<name>`` column holds a ``{use_type: [values]}``
|
|
@@ -3891,6 +3891,9 @@ def flat_gdf_to_building_spaces_resolution(gdf, building_reference_col="building
|
|
|
3891
3891
|
pandas.DataFrame
|
|
3892
3892
|
One row per building space.
|
|
3893
3893
|
"""
|
|
3894
|
+
|
|
3895
|
+
import gc
|
|
3896
|
+
|
|
3894
3897
|
prefix = "br__building_spaces_"
|
|
3895
3898
|
out_prefix = "building_space_"
|
|
3896
3899
|
excluded_per_space = {"br__building_spaces_by_floor"}
|
|
@@ -3901,36 +3904,158 @@ def flat_gdf_to_building_spaces_resolution(gdf, building_reference_col="building
|
|
|
3901
3904
|
return (isinstance(v, dict) and len(v) > 0
|
|
3902
3905
|
and all(isinstance(x, list) for x in v.values()))
|
|
3903
3906
|
|
|
3907
|
+
# Find per-space columns
|
|
3904
3908
|
candidate_cols = [
|
|
3905
3909
|
c for c in gdf.columns
|
|
3906
3910
|
if c.startswith(prefix) and c not in excluded_per_space
|
|
3907
3911
|
]
|
|
3908
3912
|
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3913
|
+
per_space_cols = []
|
|
3914
|
+
|
|
3915
|
+
for col in candidate_cols:
|
|
3916
|
+
for value in gdf[col]:
|
|
3917
|
+
if _is_per_space(value):
|
|
3918
|
+
per_space_cols.append(col)
|
|
3919
|
+
break
|
|
3920
|
+
|
|
3921
|
+
if not per_space_cols:
|
|
3922
|
+
sys.stderr.write("[FLAT] No per-space columns found")
|
|
3923
|
+
return pd.DataFrame()
|
|
3924
|
+
|
|
3925
|
+
renamed_space_cols = {
|
|
3926
|
+
c: out_prefix + c[len(prefix):]
|
|
3927
|
+
for c in per_space_cols
|
|
3928
|
+
}
|
|
3929
|
+
|
|
3930
|
+
context_cols = [
|
|
3931
|
+
c for c in gdf.columns
|
|
3932
|
+
if c not in per_space_cols
|
|
3933
|
+
]
|
|
3934
|
+
|
|
3935
|
+
sys.stderr.write(f"[FLAT] per-space columns: {len(per_space_cols)}")
|
|
3936
|
+
|
|
3937
|
+
sys.stderr.write(f"[FLAT] context columns: {len(context_cols)}")
|
|
3938
|
+
|
|
3939
|
+
sys.stderr.write("[FLAT] Counting building spaces...")
|
|
3940
|
+
|
|
3941
|
+
# Determine how many output rows we need.
|
|
3942
|
+
total_records = 0
|
|
3943
|
+
|
|
3944
|
+
n_buildings = len(gdf)
|
|
3945
|
+
|
|
3946
|
+
for start in range(0, n_buildings, chunk_size):
|
|
3947
|
+
stop = min(start + chunk_size, n_buildings)
|
|
3948
|
+
sys.stderr.write(f"[FLAT] counting buildings {start:,} -> {stop:,}")
|
|
3949
|
+
part = gdf.iloc[start:stop]
|
|
3950
|
+
|
|
3951
|
+
for _, row in part.iterrows():
|
|
3952
|
+
ref = None
|
|
3953
|
+
for col in per_space_cols:
|
|
3954
|
+
value = row[col]
|
|
3955
|
+
if _is_per_space(value):
|
|
3956
|
+
ref = value
|
|
3957
|
+
break
|
|
3958
|
+
|
|
3959
|
+
if ref is None:
|
|
3960
|
+
continue
|
|
3961
|
+
|
|
3962
|
+
for values in ref.values():
|
|
3963
|
+
if isinstance(values, list):
|
|
3964
|
+
total_records += len(values)
|
|
3965
|
+
|
|
3966
|
+
del part
|
|
3967
|
+
|
|
3968
|
+
gc.collect()
|
|
3969
|
+
|
|
3970
|
+
sys.stderr.write(f"[FLAT] Total records: {total_records:,}")
|
|
3971
|
+
|
|
3972
|
+
if total_records == 0:
|
|
3973
|
+
return pd.DataFrame()
|
|
3974
|
+
|
|
3975
|
+
sys.stderr.write("[FLAT] Allocating output columns...")
|
|
3976
|
+
|
|
3977
|
+
output = {}
|
|
3978
|
+
|
|
3979
|
+
for col in context_cols:
|
|
3980
|
+
output[col] = [None] * total_records
|
|
3981
|
+
|
|
3982
|
+
output["use_type"] = [None] * total_records
|
|
3983
|
+
|
|
3984
|
+
for col in per_space_cols:
|
|
3985
|
+
output[renamed_space_cols[col]] = [None] * total_records
|
|
3986
|
+
|
|
3987
|
+
pos = 0
|
|
3988
|
+
# Fill the preallocated columns.
|
|
3989
|
+
for start in range(0, n_buildings, chunk_size):
|
|
3990
|
+
stop = min(start + chunk_size, n_buildings)
|
|
3991
|
+
|
|
3992
|
+
sys.stderr.write(f"\n[FLAT] filling buildings {start:,} -> {stop:,}")
|
|
3993
|
+
|
|
3994
|
+
part = gdf.iloc[start:stop]
|
|
3995
|
+
|
|
3996
|
+
for _, row in part.iterrows():
|
|
3997
|
+
values_by_col = {}
|
|
3998
|
+
for col in per_space_cols:
|
|
3999
|
+
value = row[col]
|
|
4000
|
+
if _is_per_space(value):
|
|
4001
|
+
values_by_col[col] = value
|
|
4002
|
+
|
|
4003
|
+
if not values_by_col:
|
|
4004
|
+
continue
|
|
4005
|
+
|
|
4006
|
+
# First valid per-space column is reference.
|
|
4007
|
+
ref = next(iter(values_by_col.values()))
|
|
4008
|
+
|
|
4009
|
+
for use_type, values in ref.items():
|
|
4010
|
+
if not isinstance(values, list):
|
|
4011
|
+
continue
|
|
4012
|
+
|
|
4013
|
+
n_spaces = len(values)
|
|
4014
|
+
|
|
4015
|
+
for i in range(n_spaces):
|
|
4016
|
+
for col in context_cols:
|
|
4017
|
+
output[col][pos] = row[col]
|
|
4018
|
+
|
|
4019
|
+
output["use_type"][pos] = use_type
|
|
4020
|
+
|
|
4021
|
+
for col in per_space_cols:
|
|
4022
|
+
by_use = values_by_col.get(col)
|
|
4023
|
+
if by_use is None:
|
|
4024
|
+
continue
|
|
4025
|
+
|
|
4026
|
+
seq = by_use.get(use_type)
|
|
4027
|
+
|
|
4028
|
+
if isinstance(seq, list) and i < len(seq):
|
|
4029
|
+
output[renamed_space_cols[col]][pos] = seq[i]
|
|
4030
|
+
|
|
4031
|
+
pos += 1
|
|
4032
|
+
|
|
4033
|
+
del part
|
|
4034
|
+
|
|
4035
|
+
gc.collect()
|
|
4036
|
+
|
|
4037
|
+
sys.stderr.write(f"[FLAT] filled {pos:,} / {total_records:,}")
|
|
4038
|
+
|
|
4039
|
+
if pos != total_records:
|
|
4040
|
+
raise RuntimeError(
|
|
4041
|
+
f"Expected {total_records:,} records but generated {pos:,}"
|
|
4042
|
+
)
|
|
4043
|
+
|
|
4044
|
+
sys.stderr.write("\n[FLAT] Creating final DataFrame...")
|
|
4045
|
+
|
|
4046
|
+
result = pd.DataFrame(output)
|
|
4047
|
+
|
|
4048
|
+
del output
|
|
4049
|
+
gc.collect()
|
|
4050
|
+
|
|
4051
|
+
lead = [c for c in (building_reference_col,"use_type") if c in result.columns]
|
|
4052
|
+
rest = [c for c in result.columns if c not in lead]
|
|
4053
|
+
result = result[lead + rest]
|
|
4054
|
+
|
|
4055
|
+
gc.collect()
|
|
4056
|
+
|
|
4057
|
+
sys.stderr.write(f"[FLAT] Final DataFrame: {len(result):,} rows")
|
|
4058
|
+
|
|
3934
4059
|
return result
|
|
3935
4060
|
|
|
3936
4061
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: hypercadaster_es
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.2
|
|
4
4
|
Summary: Python library to obtain the Spanish cadaster data joined with external attributes.
|
|
5
5
|
Home-page: https://github.com/BeeGroup-cimne
|
|
6
6
|
Author: Jose Manuel Broto Vispe
|
|
@@ -33,7 +33,7 @@ Requires-Dist: shapely<3.0,>=2.0
|
|
|
33
33
|
Requires-Dist: pyproj<4.0,>=3.5
|
|
34
34
|
Requires-Dist: rasterio<2.0,>=1.3
|
|
35
35
|
Requires-Dist: fiona<2.0,>=1.9
|
|
36
|
-
Requires-Dist: geopandas<1.1
|
|
36
|
+
Requires-Dist: geopandas<1.2,>=1.1.2
|
|
37
37
|
Requires-Dist: pyogrio<1.0,>=0.8
|
|
38
38
|
Requires-Dist: affine>=2.4
|
|
39
39
|
Requires-Dist: snuggs>=1.4
|
|
@@ -43,28 +43,34 @@ Requires-Dist: pyrosm>=0.6
|
|
|
43
43
|
Requires-Dist: networkx>=3.2
|
|
44
44
|
Requires-Dist: eppy>=0.5.63
|
|
45
45
|
Requires-Dist: geomeppy>=0.12
|
|
46
|
-
Requires-Dist: pyarrow>=
|
|
46
|
+
Requires-Dist: pyarrow>=23.0.1
|
|
47
47
|
Requires-Dist: openpyxl>=3.1
|
|
48
48
|
Requires-Dist: et-xmlfile>=1.1
|
|
49
49
|
Requires-Dist: arrow>=1.4.0
|
|
50
50
|
Requires-Dist: fastkml>=1.4.0
|
|
51
|
-
Requires-Dist: lxml>=6.0
|
|
52
|
-
Requires-Dist: duckdb
|
|
53
|
-
Requires-Dist:
|
|
54
|
-
Requires-Dist:
|
|
51
|
+
Requires-Dist: lxml>=6.1.0
|
|
52
|
+
Requires-Dist: duckdb<2,>=1.5.3
|
|
53
|
+
Requires-Dist: cdsapi>=0.7
|
|
54
|
+
Requires-Dist: xarray>=2024.1
|
|
55
|
+
Requires-Dist: cfgrib>=0.9.10
|
|
56
|
+
Requires-Dist: pvlib>=0.11
|
|
57
|
+
Requires-Dist: requests<3.0,>=2.33
|
|
58
|
+
Requires-Dist: urllib3<3,>=2.8
|
|
55
59
|
Requires-Dist: charset-normalizer>=3.3
|
|
56
|
-
Requires-Dist: idna>=3.
|
|
57
|
-
Requires-Dist: certifi>=
|
|
60
|
+
Requires-Dist: idna>=3.15
|
|
61
|
+
Requires-Dist: certifi>=2026.10.18
|
|
58
62
|
Requires-Dist: beautifulsoup4>=4.12
|
|
59
|
-
Requires-Dist: soupsieve>=2.
|
|
63
|
+
Requires-Dist: soupsieve>=2.9
|
|
60
64
|
Requires-Dist: xmltodict>=0.13
|
|
61
65
|
Requires-Dist: matplotlib<4,>=3.8
|
|
62
66
|
Requires-Dist: contourpy>=1.2
|
|
63
67
|
Requires-Dist: cycler>=0.12
|
|
64
68
|
Requires-Dist: kiwisolver>=1.4
|
|
65
69
|
Requires-Dist: fonttools>=4.53
|
|
66
|
-
Requires-Dist: pillow>=
|
|
70
|
+
Requires-Dist: pillow>=13.0
|
|
67
71
|
Requires-Dist: folium>=0.20.0
|
|
72
|
+
Requires-Dist: contextily>=1.5
|
|
73
|
+
Requires-Dist: plotly>=5.20
|
|
68
74
|
Requires-Dist: click>=8.1
|
|
69
75
|
Requires-Dist: click-plugins>=1.1
|
|
70
76
|
Requires-Dist: cligj>=0.7
|
|
@@ -83,27 +89,14 @@ Requires-Dist: ruff>=0.4; extra == "dev"
|
|
|
83
89
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
84
90
|
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
85
91
|
Requires-Dist: pdoc>=14.0; extra == "dev"
|
|
86
|
-
Dynamic: author
|
|
87
|
-
Dynamic: author-email
|
|
88
|
-
Dynamic: classifier
|
|
89
|
-
Dynamic: description
|
|
90
|
-
Dynamic: description-content-type
|
|
91
|
-
Dynamic: home-page
|
|
92
|
-
Dynamic: keywords
|
|
93
|
-
Dynamic: license
|
|
94
|
-
Dynamic: license-file
|
|
95
|
-
Dynamic: provides-extra
|
|
96
|
-
Dynamic: requires-dist
|
|
97
|
-
Dynamic: requires-python
|
|
98
|
-
Dynamic: summary
|
|
99
92
|
|
|
100
93
|
# hypercadaster_ES
|
|
101
94
|
|
|
102
95
|
A comprehensive Python library for downloading, processing, and analyzing Spanish cadastral data with integration of external geographic datasets and EnergyPlus model generation.
|
|
103
96
|
|
|
104
|
-
[](https://python.org)
|
|
105
98
|
[](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
|
|
106
|
-
[](https://github.com/BeeGroup-cimne/hypercadaster_ES)
|
|
107
100
|
|
|
108
101
|
## 🎯 Overview
|
|
109
102
|
|
|
@@ -206,9 +199,15 @@ For detailed installation instructions and advanced examples, see [Installation
|
|
|
206
199
|
|
|
207
200
|
## 👥 Authors & Contributors
|
|
208
201
|
|
|
209
|
-
**
|
|
202
|
+
**Main Authors:**
|
|
210
203
|
- **Jose Manuel Broto Vispe** - jmbrotovispe@gmail.com
|
|
211
204
|
- **Gerard Mor** - gmor@cimne.upc.edu
|
|
205
|
+
- **Maite Sellart** - tsellart@cimne.upc.edu
|
|
206
|
+
|
|
207
|
+
**Co-authors:**
|
|
208
|
+
- **David Blanco** - dblanco@cimne.upc.edu
|
|
209
|
+
- **Gerard Laguna** - glaguna@cimne.upc.edu
|
|
210
|
+
- **Nadiya Mehraj** - nmehraj@cimne.upc.edu
|
|
212
211
|
|
|
213
212
|
**Institutional Affiliations:**
|
|
214
213
|
- **CIMNE** - Centre Internacional de Mètodes Numèrics en Enginyeria, Building Energy and Environment (BEE) group
|
|
@@ -222,4 +221,4 @@ This project is licensed under the **EUPL v1.2**. See the [license](https://join
|
|
|
222
221
|
|
|
223
222
|
*hypercadaster_ES - Built with ❤️ for the Spanish urban analysis and building research community*
|
|
224
223
|
|
|
225
|
-
*Last updated:
|
|
224
|
+
*Last updated: November 2026 | Version 1.3.2*
|
|
@@ -13,7 +13,7 @@ shapely<3.0,>=2.0
|
|
|
13
13
|
pyproj<4.0,>=3.5
|
|
14
14
|
rasterio<2.0,>=1.3
|
|
15
15
|
fiona<2.0,>=1.9
|
|
16
|
-
geopandas<1.1
|
|
16
|
+
geopandas<1.2,>=1.1.2
|
|
17
17
|
pyogrio<1.0,>=0.8
|
|
18
18
|
affine>=2.4
|
|
19
19
|
snuggs>=1.4
|
|
@@ -23,28 +23,34 @@ pyrosm>=0.6
|
|
|
23
23
|
networkx>=3.2
|
|
24
24
|
eppy>=0.5.63
|
|
25
25
|
geomeppy>=0.12
|
|
26
|
-
pyarrow>=
|
|
26
|
+
pyarrow>=23.0.1
|
|
27
27
|
openpyxl>=3.1
|
|
28
28
|
et-xmlfile>=1.1
|
|
29
29
|
arrow>=1.4.0
|
|
30
30
|
fastkml>=1.4.0
|
|
31
|
-
lxml>=6.0
|
|
32
|
-
duckdb
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
lxml>=6.1.0
|
|
32
|
+
duckdb<2,>=1.5.3
|
|
33
|
+
cdsapi>=0.7
|
|
34
|
+
xarray>=2024.1
|
|
35
|
+
cfgrib>=0.9.10
|
|
36
|
+
pvlib>=0.11
|
|
37
|
+
requests<3.0,>=2.33
|
|
38
|
+
urllib3<3,>=2.8
|
|
35
39
|
charset-normalizer>=3.3
|
|
36
|
-
idna>=3.
|
|
37
|
-
certifi>=
|
|
40
|
+
idna>=3.15
|
|
41
|
+
certifi>=2026.10.18
|
|
38
42
|
beautifulsoup4>=4.12
|
|
39
|
-
soupsieve>=2.
|
|
43
|
+
soupsieve>=2.9
|
|
40
44
|
xmltodict>=0.13
|
|
41
45
|
matplotlib<4,>=3.8
|
|
42
46
|
contourpy>=1.2
|
|
43
47
|
cycler>=0.12
|
|
44
48
|
kiwisolver>=1.4
|
|
45
49
|
fonttools>=4.53
|
|
46
|
-
pillow>=
|
|
50
|
+
pillow>=13.0
|
|
47
51
|
folium>=0.20.0
|
|
52
|
+
contextily>=1.5
|
|
53
|
+
plotly>=5.20
|
|
48
54
|
click>=8.1
|
|
49
55
|
click-plugins>=1.1
|
|
50
56
|
cligj>=0.7
|
|
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
|
|
|
3
3
|
|
|
4
4
|
HERE = pathlib.Path(__file__).parent
|
|
5
5
|
|
|
6
|
-
VERSION = "1.3.
|
|
6
|
+
VERSION = "1.3.2"
|
|
7
7
|
PACKAGE_NAME = "hypercadaster_es"
|
|
8
8
|
AUTHOR = "Jose Manuel Broto Vispe"
|
|
9
9
|
AUTHOR_EMAIL = "jmbrotovispe@gmail.com"
|
|
@@ -35,7 +35,7 @@ INSTALL_REQUIRES = [
|
|
|
35
35
|
"pyproj>=3.5,<4.0",
|
|
36
36
|
"rasterio>=1.3,<2.0",
|
|
37
37
|
"fiona>=1.9,<2.0",
|
|
38
|
-
"geopandas>=
|
|
38
|
+
"geopandas>=1.1.2,<1.2",
|
|
39
39
|
"pyogrio>=0.8,<1.0",
|
|
40
40
|
"affine>=2.4",
|
|
41
41
|
"snuggs>=1.4",
|
|
@@ -51,22 +51,28 @@ INSTALL_REQUIRES = [
|
|
|
51
51
|
"geomeppy>=0.12",
|
|
52
52
|
|
|
53
53
|
# --- File formats & tabular IO ---
|
|
54
|
-
"pyarrow>=
|
|
54
|
+
"pyarrow>=23.0.1",
|
|
55
55
|
"openpyxl>=3.1",
|
|
56
56
|
"et-xmlfile>=1.1",
|
|
57
57
|
"arrow>=1.4.0",
|
|
58
58
|
"fastkml>=1.4.0",
|
|
59
|
-
"lxml>=6.0
|
|
60
|
-
"duckdb>=1.5.3",
|
|
59
|
+
"lxml>=6.1.0",
|
|
60
|
+
"duckdb>=1.5.3,<2", # 2.0 rejects new work while a prior result is unfinished; port pending
|
|
61
|
+
|
|
62
|
+
# --- Weather (ERA5-Land -> EPW) ---
|
|
63
|
+
"cdsapi>=0.7", # Copernicus CDS client (Apache-2.0)
|
|
64
|
+
"xarray>=2024.1", # (Apache-2.0)
|
|
65
|
+
"cfgrib>=0.9.10", # GRIB engine for xarray; pulls eccodes (Apache-2.0)
|
|
66
|
+
"pvlib>=0.11", # solar position / irradiance (BSD-3)
|
|
61
67
|
|
|
62
68
|
# --- Web / HTTP ---
|
|
63
|
-
"requests>=2.
|
|
64
|
-
"urllib3>=2.
|
|
69
|
+
"requests>=2.33,<3.0",
|
|
70
|
+
"urllib3>=2.8,<3",
|
|
65
71
|
"charset-normalizer>=3.3",
|
|
66
|
-
"idna>=3.
|
|
67
|
-
"certifi>=
|
|
72
|
+
"idna>=3.15",
|
|
73
|
+
"certifi>=2026.10.18",
|
|
68
74
|
"beautifulsoup4>=4.12",
|
|
69
|
-
"soupsieve>=2.
|
|
75
|
+
"soupsieve>=2.9",
|
|
70
76
|
"xmltodict>=0.13",
|
|
71
77
|
|
|
72
78
|
# --- Plotting & visuals ---
|
|
@@ -75,8 +81,10 @@ INSTALL_REQUIRES = [
|
|
|
75
81
|
"cycler>=0.12",
|
|
76
82
|
"kiwisolver>=1.4",
|
|
77
83
|
"fonttools>=4.53",
|
|
78
|
-
"pillow>=
|
|
84
|
+
"pillow>=13.0",
|
|
79
85
|
"folium>=0.20.0",
|
|
86
|
+
"contextily>=1.5", # basemap tiles (BSD-3); imported at module level in utils
|
|
87
|
+
"plotly>=5.20", # interactive energy-scenario reports (MIT)
|
|
80
88
|
|
|
81
89
|
# --- CLI & packaging helpers ---
|
|
82
90
|
"click>=8.1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hypercadaster_es-1.3.0 → hypercadaster_es-1.3.2}/hypercadaster_es.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|