Created
June 19, 2017 15:46
-
-
Save seumasmorrison/ade685b67b79bc0a562ea0937be388ef to your computer and use it in GitHub Desktop.
Snippet taken from https://gis.stackexchange.com/questions/174159/convert-a-pandas-dataframe-to-a-geodataframe
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
from geopandas import GeoDataFrame | |
from shapely.geometry import Point | |
geometry = [Point(xy) for xy in zip(df.Lon, df.Lat)] | |
df = df.drop(['Lon', 'Lat'], axis=1) | |
crs = {'init': 'epsg:4326'} | |
geo_df = GeoDataFrame(df, crs=crs, geometry=geometry) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment