Created
September 23, 2019 13:55
-
-
Save AlexandraKapp/0d4d0bb2b47661fe89903200dabfa0e4 to your computer and use it in GitHub Desktop.
Merge data with Berlin Planungsraeume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geopandas as gpd | |
import pandas as pd | |
from shapely.geometry import Point | |
plr = gpd.read_file('data/lor_planungsraeume.geojson', encoding='utf-8') | |
df = pd.read_csv('data/DATAFILE.csv', sep=";", dtype={'PLR_CODES':str}, na_values=['OTHER_NAN_VALUES']) | |
df.set_index('PLR_CODES', inplace=True) | |
data = df.join(plr.set_index('spatial_name'), rsuffix='_r') | |
gpd.GeoDataFrame(data).to_file('output.geojson', driver='GeoJSON', encoding='utf-8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment