Datasets:
File size: 1,155 Bytes
0a7933d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #%%
from pathlib import Path
import rasterio
path = Path("/home/sabrina/Documents/Tese/05_Dataset/MatchGeo-DEM-v1")
cities = {'ATA_MV', 'BRA_SP', 'CHN_WS', 'ESP_EH' ,'FIN_LM', 'GER_BN' ,'IDN_SV', 'KAZ_AC', 'KSA_WA' ,'NAM_HF' ,'NZL_KP' ,'PHL_TA', 'USA_GC'}
print("===============================================\nEPSG")
# 1. Get EPSG and WKT for all cities
for city in {'ATA_MV', 'BRA_SP', 'CHN_WS', 'ESP_EH' ,'FIN_LM', 'GER_BN' ,'IDN_SV', 'KAZ_AC', 'KSA_WA' ,'NAM_HF' ,'NZL_KP' ,'PHL_TA', 'USA_GC'}:
with rasterio.open(str(path) + f"/{city}/{city}.tif") as src:
print( f"{city}: {src.crs}")
#%%
print("===============================================\nNumber of Tiles")
# 2. Count tiles per city
for city in cities:
tile_path = Path(path, f"{city}/tiles")
ntiles = list(tile_path.glob("*.tif"))
print(f"{city} : {len(ntiles)}")
#%%
print("===============================================\nBounding Box")
# 3. Get bounding box from GeoJSON
for city in cities:
with rasterio.open(Path(path, f"{city}/{city}.tif")) as src:
profile = src.profile
bounds = src.bounds
print(f"{city} : {bounds}")
# %%
|