Convert ESRI grids to .asc on R

1,398 views
Skip to first unread message

Gabriel Costa

unread,
Oct 29, 2011, 6:16:13 PM10/29/11
to Maxent
Anybody could help me on how to Convert ESRI grids to .asc on R?
Thanks in advance,
Gabriel

Gabriel Costa
-------------------------------------------------------------------------------------------
Universidade Federal do Rio Grande do Norte
Centro de Biociências, Departamento de Botânica, Ecologia e Zoologia.
Campus Universitário - Lagoa Nova
59078-900 - Natal, RN - Brasil

David Galbraith

unread,
Oct 29, 2011, 7:38:36 PM10/29/11
to max...@googlegroups.com
If you have an ESRI license, there's a 'conversion toolbox' that might let you export to .asc format, of maybe a right-click -> "export data' option.  You still have to watch out for maximum file size issues though, and local memory/heap space stuff if you are dealing with large data sets and/or operating system limitations.

There are also multiple options involving R, GRASS, and linux-Java-Googly type paths to attempt in the absence of ESRI license realities, but the learning curves' steepness and vertical ranges can become problematic for some projects' goals and limitations.


--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To post to this group, send email to max...@googlegroups.com.
To unsubscribe from this group, send email to maxent+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maxent?hl=en.


Jesse Langdon

unread,
Oct 30, 2011, 11:53:55 AM10/30/11
to Maxent
You can use the Multidimension Tools in ArcGIS. I'm not sure if
ArcView has those tools, or just ArcEditor and above...

Good luck.

Jesse

John B

unread,
Oct 30, 2011, 9:15:03 PM10/30/11
to max...@googlegroups.com
Hi Gabriel,

There are a few packages that will allow you to do this in R, with the help of GDAL.

A couple of methods that might work for you are:

# Using sp and rgdal packages
# install.packages(c('sp', 'rgdal'))
library(sp)
library(rgdal)
x <- readGDAL('path/to/ESRI/ASCII/binary/grid/')
write.asciigrid(x, 'path/to/output/filename.asc')

# Using raster package
# install.packages('raster')
library(raster)
x <- raster('path/to/ESRI/ASCII/binary/grid/')
writeRaster(x, 'path/to/output/filename.asc', NAflag=-9999)

Good luck,
John

Gabriel Costa

unread,
Oct 31, 2011, 12:42:56 PM10/31/11
to max...@googlegroups.com
Thanks John,
That sounds great! 
Gabriel

Gabriel Costa
-------------------------------------------------------------------------------------------
Universidade Federal do Rio Grande do Norte
Centro de Biociências, Departamento de Botânica, Ecologia e Zoologia.
Campus Universitário - Lagoa Nova
59078-900 - Natal, RN - Brasil
Fone: 55-84-3215-3441 ramal 220
Fax: 55-84-3211-9205
http://web.mac.com/costagc
lattes: http://lattes.cnpq.br/2151112850152895
skype: fuelgabriel
















--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maxent/-/NVcqmZVTNTgJ.

Anne Ghisla

unread,
Nov 1, 2011, 1:18:54 PM11/1/11
to max...@googlegroups.com
On Sat, 29 Oct 2011 19:38:36 -0400
David Galbraith <davidmg...@gmail.com> wrote:

> If you have an ESRI license, there's a 'conversion toolbox' that
> might let you export to .asc format, of maybe a right-click ->
> "export data' option. You still have to watch out for maximum file
> size issues though, and local memory/heap space stuff if you are
> dealing with large data sets and/or operating system limitations.
>
> There are also multiple options involving R, GRASS, and
> linux-Java-Googly type paths to attempt in the absence of ESRI
> license realities, but the learning curves' steepness and vertical
> ranges can become problematic for some projects' goals and
> limitations.

Hello list,

The limitations of the ESRI license costs can be problematic too, and I
find wise to have at least one ready-to-use alternative to ESRI before
there is urgent need of it, with no time to learn to use a new tool.

Some solutions consist of few lines of code, like John Baumgartner
showed in his response to this thread, or few clicks in a graphical
interface. I encourage the posting of diverse solutions to the same
question/problem, so that everyone can pick the most suitable for
his/her needs.

All the best!

Anne Ghisla
Edmund Mach Foundation
Research and Innovation Centre
Department of Biodiversity and Molecular Ecology
GIS and Remote Sensing Unit
--
http://gis.cri.fmach.it/ghisla/

signature.asc

David Galbraith

unread,
Nov 1, 2011, 6:01:01 PM11/1/11
to max...@googlegroups.com
Excellently put, and also there's always the danger of proprietary updates which cause incompatibility issues when combining multiple code packages.
Reply all
Reply to author
Forward
0 new messages