Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

geopandas dataframe to ogr layer

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 ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #geopandas #dataframe #ogr #layer
ADD COMMENT
Topic
Name
8+1 =