import geopandas as gpd
gdf = gpd.read_file('filename.shp')
json = gpd.GeoSeries([gdf.geometry.iloc[0]]).__geo_interface__
import urllib, geojson, gdal
url= ' http://ig3is.grid.unep.ch/istsos/wa/istsos/services/ghg/procedures/operations/geojson?epsg=4326'
response = urllib.urlopen(url)
data = geojson.loads(response.read())
file = open ('data.geojson', 'w')
pickle.dump(data,file)
file.close()
ogr2ogr -f "ESRI Shapefile" destination_data.shp "data.geojson"
import urllib, geojson, gdal, subprocess
url= ' http://ig3is.grid.unep.ch/istsos/wa/istsos/services/ghg/procedures/operations/geojson?epsg=4326'
response = urllib.urlopen(url)
data = geojson.loads(response.read())
with open('data.geojson', 'w') as f:
geojson.dump(data, f)
args = ['ogr2ogr', '-f', 'ESRI Shapefile', 'destination_data.shp', 'data.geojson']
subprocess.Popen(args)