matchgeodem / scripts /get_data_metadata.py
paeslemesa's picture
Updated statcs/ splis/ and scrips/
0a7933d verified
Raw
History Blame Contribute Delete
1.16 kB
#%%
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}")
# %%