Search
 
SCRIPT & CODE EXAMPLE
 

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 ...
Comment

PREVIOUS NEXT
Code Example
Python :: input a number and print even numbers up to that number in python 
Python :: filtering certain rows in python that contains a part of string 
Python :: end without space in python 
Python :: pandas series to dataframe index as column 
Python :: python add new key to dictionary 
Python :: color module python 
Python :: newtorkx remove node 
Python :: python get dir from path 
Python :: discord.py send message to channel with mutiple id 
Python :: if condition python 
Python :: pandas groupby 
Python :: pytest for loop 
Python :: state capitals python 
Python :: python string formatting - padding 
Python :: python histogram one liners 
Python :: how to find out the max and min date on the basis of property id in pandas 
Python :: knn imputation in r 
Python :: not equal to in python 
Python :: python [] for loop 
Python :: pandas split cell into multiple columns 
Python :: how to add string in csv in python 
Python :: python pytest no coverage on failure 
Python :: multiple model search in django rest framework 
Python :: python projects 
Python :: python using end keyword 
Python :: pip install pandas invalid syntax 
Python :: python basics 
Python :: jupyter read excel 
Python :: python lambda function use global variable 
Python :: how to find a specific word in a list python 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =