OpenStreetMap logo OpenStreetMap

Köln population

Posted by sauce1984 on 29 December 2025 in English. Last updated on 30 December 2025.

dataset column i: A0025A

rel62578,r2613711,r2613712,r2613713,r2613714,r2613715,r2613716,r2613717,r2613718,r2613719,r2613720,r2613721,r2613722,r2613723,r2613724,r2613725,r2613726,r2613727,r2613728,r2613729,r2613730,r2613731,r2613732,r2613733,r2613734,r2613735,r2613736,r2613737,r2613738,r2613739,r2613740,r2613741,r2613742,r2613743,r2613744,r2613745,r2613746,r2613747,r2613748,r2613749,r2613750,r2613751,r2613752,r2613753,r2613754,r2613755,r2613756,r2613757,r2613758,r2613759,r2613760,r2613761,r2613762,r2613763,r2613764,r2613765,r2613766,r2613767,r2613768,r2613769,r2613770,r2613771,r2613772,r2613773,r2613774,r2613775,r2613776,r2613777,r2613778,r2613779,r2613780,r2613781,r2613782,r2613783,r2613784,r2613785,r2613786,r2613787,r2613788,r2613789,r2613790,r2613791,r2613792,r2613793,r2613794,r2613795,r2613796,r2613797,r2613798,r2613800,r2613801,r2613802,r2613803,r2613804,r2613805,r2776569
[out:xml][timeout:25];{{geocodeArea:Köln}}->.searchArea;rel["admin_level"~"6|9|10"](area.searchArea);out meta;
import re
import pandas as pd

req = requests.get("https://overpass-api.de/api/interpreter?data=%5Bout%3Axml%5D%5Btimeout%3A25%5D%3B%7B%7BgeocodeArea%3AKöln%7D%7D-%3E.searchArea%3Brel%5B%22admin_level%22~%229%22%5D%28area.searchArea%29%3Bout%20meta%3B")


src = pd.read_csv("https://www.offenedaten-koeln.de/sites/default/files/Stadt_K%C3%B6ln_Statistischer_Datenkatalog_1.csv")

yy=XXXXXXXXXXXX.split("\n\n")

z=""

for y in yy[1:]:
    y1 = re.search("ref = ([0-9]+)",y).group(1)
    tdf = src[src.S_RAUM == int(y1)]
    new_pop_v=int(tdf.A0025A.iloc[0])
    
    srcattrib = "Stadt Köln (2025) - Amt für Stadtentwicklung und Statistik - Informationsservice: https://www.offenedaten-koeln.de/dataset/statistischer-datenkatalog-köln (Stadt_Köln_Statistischer_Datenkatalog_1.csv dl-de->by-2.0)"
    
    y = re.sub("  population = [0-9]+", f"  population = {new_pop_v}",y)
    y = re.sub("source:population = .+\n", f"source:population = {srcattrib}\n", y)
    
    z+=y+"\n\n"

z+= f"changeset\n  source = {srcattrib}"

Discussion

Comment from Lumikeiju on 30 December 2025 at 03:12

Hi - please be sure to select the correct language from the dropdown menu before publishing your diary posts! Thanks :)

Log in to leave a comment