0

Actually I want to convert the shp file to .grd file. But before I convert the .shp to .grd, on my thinking, first I must convert the .shp into ascii. Is it possible to convert directly from .shp to .grd? if not, so I just want to know how to convert .shp into ascii in QGIS or R?. Thank you.

Thank you.

  • Actually I want to convert the shp file to .grd file. But before I convert the .shp to .grd, on my thinking, first I must convert the .shp into ascii. Is it possible to convert directly from .shp to .grd? if not, so I just want to know how to convert .shp into ascii in QGIS. Thank you. – Din Jun 10 '15 at 3:44
  • You'll need to edit your original post to include the additional information you just gave. – happy_soil Jun 10 '15 at 7:13
1

Within the library(raster) you can write out both grid and ascii files. Be sure to look into the dataTypes when writing grids as they will be different depending on the size of the values within your grid.

Once you have the raster package running use writeFormats() to see what kinds of grids you can write out. The first column will indicate the call within write Raster() In your case:

writeRaster(format="ascii")

Use rgdal and readOGRto get the .shp files into R.

Further, you can use writeOGR within rgdal to write out in many other formats which, can all be seen usin gdalDrivers().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.