Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

convert shp to geojson python

import geopandas as gpd

gdf = gpd.read_file('filename.shp')
json = gpd.GeoSeries([gdf.geometry.iloc[0]]).__geo_interface__
Comment

convert geojson to shp python

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

convert geojson to shp python

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

PREVIOUS NEXT
Code Example
Javascript :: how to swap two elements in an array js 
Javascript :: react native get route name 
Javascript :: usehistory example 
Javascript :: firebase get current user javascript 
Javascript :: loop through object element names javascript 
Javascript :: javascript wait 10 seconds 
Javascript :: Check your Homestead.yaml (or Homestead.json) file, the path to your private key does not exist. 
Javascript :: nodejs require everything without prefix 
Javascript :: angular int to string 
Javascript :: jquery all elements whose id contains 
Javascript :: javascript format date yyyy-mm-dd 
Javascript :: current date in javascript 
Javascript :: slick on init 
Javascript :: random word generator from alphabets javascript 
Javascript :: react native build apk 
Javascript :: fetch api post req 
Javascript :: how to pass an object directly to formdata in javascript 
Javascript :: jquery populate select from json 
Javascript :: valid phone number regex with country code 
Javascript :: video js toggle play pause 
Javascript :: An accessor cannot be declared in an ambient context. 
Javascript :: toobject() javascript 
Javascript :: date to seconds js 
Javascript :: how to encode a string in javascript 
Javascript :: loopback get relationship in before save 
Javascript :: how to get the nth child of dom js 
Javascript :: datatable visable show entries 
Javascript :: javascript alphabet to number 
Javascript :: onclick string 
Javascript :: adonis attach 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =