Skip to content

Instantly share code, notes, and snippets.

@xuanlongma
Last active December 14, 2015 11:08
Show Gist options
  • Save xuanlongma/5076697 to your computer and use it in GitHub Desktop.
Save xuanlongma/5076697 to your computer and use it in GitHub Desktop.
invoke system command to convert shapefiles to raster
## invoke system command to convert shapefiles to raster
## Please install gdal before using this snippet
## http://www.gdal.org
## 12000: the width of the output raster
## 6400: the height of the output raster
## layer: the attribute field
system(command = 'gdal_rasterize -a input -ts 12000 6400 -l
layer /Users/me/Desktop/input.shp /Users/me/Desktop/output.tif')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment