geopandas dataframe to ogr layer

49

import geopandas as gpd
from osgeo import ogr

# Read file into GeoDataFrame
data = gpd.read_file("my_shapefile.shp")

# Pass the GeoDataFrame into ogr as GeoJson
shp = ogr.Open(data.to_json())

# Do your stuff with ogr ...

Comments

Submit
0 Comments