I\'m having difficulty loading the following JSON containing GIS data (https://data.cityofnewyork.us/resource/5rqd-h5ci.json) into a GeoDataFrame.
The following code fai
A more idiomatic way that uses regular dataframe functions inherited from pandas
, and the native GeoDataFrame.from_features
:
gdf = gpd.GeoDataFrame(data.json())
# features column does not need to be stored, this is just for illustration
gdf['features'] = gdf['the_geom'].apply(lambda x: {'geometry': x, 'properties': {}})
gdf2 = gpd.GeoDataFrame.from_features(gdf['features'])
gdf = gdf.set_geometry(gdf2.geometry)
gdf.head()