I want to write a Python function to create a shapefile layer from clipping an input layer using a mask.
Does someone know the way how to do it?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI want to write a Python function to create a shapefile layer from clipping an input layer using a mask.
Does someone know the way how to do it?
import subprocess
subprocess.call(["ogr2ogr", "-f", "ESRI Shapefile", "-clipsrc", mymask, myresult, myinput], shell=True)
The my***s are all shapefiles.