Re: [R-sig-Geo] thinning a SpatialPolygonsDataFrame

2009-11-19 Thread Pinaud David
://www.cebc.cnrs.fr/ *** __ Information from ESET Mail Security, version of virus signature database 4621 (20091119) __ The message was checked by ESET Mail Security. http://www.eset.com attachment

Re: [R-sig-Geo] thinning a SpatialPolygonsDataFrame

2009-11-19 Thread Roger Bivand
On Thu, 19 Nov 2009, Pinaud David wrote: Hi Michael, Roger is fully right, this function does not preserve the topology, so be aware of that, some problems can occur... If you want to use shapefiles::dp() just for raw plotting and visual simplification, you can try (on the fly):

[R-sig-Geo] Spatial3dArray - coordinates method

2009-11-19 Thread Torleif Markussen Lunde
Hi To read netcdf data (or any other gridded spatial time data) I find it convenient to define new classes Spatial3dArray and Spatial4dArray. setClass(Spatial3dArray, representation(Spatial, data = array, coords = list, time = character, btime =

Re: [R-sig-Geo] Spatial3dArray - coordinates method

2009-11-19 Thread Edzer Pebesma
No problems; sp in csv now has this, the next release will have it. Torleif Markussen Lunde wrote: Hi To read netcdf data (or any other gridded spatial time data) I find it convenient to define new classes Spatial3dArray and Spatial4dArray. setClass(Spatial3dArray,

Re: [R-sig-Geo] thinning a SpatialPolygonsDataFrame

2009-11-19 Thread Michael Friendly
Thanks very much for doing the heavy lifting here, Roger. For use in the Guerry package, I've turned this into a function (rather than saving other versions of gfrance). If you include something like this in sp, I'll withdraw it from Guerry. thinnedSpatialPoly - function(SP, tolerance,

[R-sig-Geo] Filling in holes in DTM

2009-11-19 Thread Tobin Cara
Hello, Would anyone know a good way to fill in holes within a DTM? There is no data inside these holes and it is affecting my calculations, so I prefer for an interpolation of the nearest neighbors to fill in a value or something similar. Thank you, Cara [[alternative HTML version

Re: [R-sig-Geo] Filling in holes in DTM

2009-11-19 Thread milton ruser
Hi Ton Check r.watershed/r.terraflow/r.flow/r.fill modules on Grass. cheers miltinho On Thu, Nov 19, 2009 at 9:16 AM, Tobin Cara cara.to...@epfl.ch wrote: Hello, Would anyone know a good way to fill in holes within a DTM? There is no data inside these holes and it is affecting my

Re: [R-sig-Geo] Filling in holes in DTM

2009-11-19 Thread Tomislav Hengl
Hi Cara, There is a very efficient function in SAGA called Close Gaps that does exactly that. What makes it especially efficient is that it allows you to set a mask map. See: rsaga.get.usage(grid_tools, 7) SAGA CMD 2.0.3 library path: C:/Progra~1/saga_vc/modules library name: grid_tools

Re: [R-sig-Geo] Lambert projection to lat/long question....

2009-11-19 Thread Robert J. Hijmans
Blair: Have a look at spTransform in rgdal. Robert On Thu, Nov 19, 2009 at 9:39 AM, Blair Christian blair.christ...@gmail.com wrote: Hi All, Before trying to reinvent the wheel, I was wondering if the mapproj or any other library had code to take lambert coordinates (along with the

Re: [R-sig-Geo] Lambert projection to lat/long question....

2009-11-19 Thread Robert J. Hijmans
Blair, sorry, too quick: Have a look at spTransform in rgdal and at projectRaster in the raster package. Robert On Thu, Nov 19, 2009 at 9:39 AM, Blair Christian blair.christ...@gmail.com wrote: Hi All, Before trying to reinvent the wheel, I was wondering if the mapproj or any other library

[R-sig-Geo] flags in execGRASS

2009-11-19 Thread Agustin Lobo
Hi! The following works: doGRASS(r.grow.distance,flags=c(overwrite),parameters=list(distance=dummyd,input=dummy)) [1] r.grow.distance --overwrite distance=dummyd input=dummy But using o instead of overwrite does not

Re: [R-sig-Geo] Lambert projection to lat/long question....

2009-11-19 Thread Blair Christian
Those are perfect. I wish I had the time to contribute as much software as you do, Robert. Very impressive contributions on the r-forge pages. Thanks, Blair On Thu, Nov 19, 2009 at 12:46 PM, Robert J. Hijmans r.hijm...@gmail.com wrote: Blair, sorry, too quick: Have a look at spTransform in

Re: [R-sig-Geo] execGRASS() for r.mapcalc?

2009-11-19 Thread Roger Bivand
On Thu, 19 Nov 2009, Agustin Lobo wrote: I'm used to do: cmd = r.mapcalc 'delme=100' system(cmd) and works, but how could I do the equivalent using execGRASS() ? You cannot. r.mapcalc does not provide an --interface-description XML self-definition. You have either to use system() as

Re: [R-sig-Geo] flags in execGRASS

2009-11-19 Thread Roger Bivand
On Thu, 19 Nov 2009, Agustin Lobo wrote: Hi! The following works: doGRASS(r.grow.distance,flags=c(overwrite),parameters=list(distance=dummyd,input=dummy)) [1] r.grow.distance --overwrite distance=dummyd input=dummy But using o instead of overwrite does not Because only overwrite is

Re: [R-sig-Geo] Spatial3dArray - coordinates method

2009-11-19 Thread Michael Sumner
Wow, this is great - I was thinking about this just yesterday. Torleif: do you have an opinion on which NetCDF path is the most useful for R with sp? RNetCDF or ncdf? GDAL is workable but takes extra effort to build and then reconstruct 3d/4d from 2d bands. (I use Windows mostly) I use the

Re: [R-sig-Geo] Spatial3dArray - coordinates method

2009-11-19 Thread Torleif Markussen Lunde
Hi Mike At the moment I have written wrapper functions around ncdf. As in get.var.ncdf you can subset which area to read, and which (continuous) time dimensions you want to read. At the moment the functions (to correctly return time, lat and long) are limited to output from the WRF-model

[R-sig-Geo] Problem using mahasuhab

2009-11-19 Thread Ned Horning
Hi - I was wondering if anyone out there can help with my effort to create habitat suitability maps using mahasuhab from the adehabitat package or another package if there is a better option. I would like to compare the resulting maps with some software a colleague is working on. When I try

Re: [R-sig-Geo] Problem using mahasuhab

2009-11-19 Thread Mathieu Basille
Hi Ned, Adehabitat was not meant to import all kind of raster maps. It might be that your file is not in the right format. Are your file with such a header: ncols 308 nrows 435 xllcorner 40 yllcorner 6515000 cellsize 1000 NODATA_value - (whatever the values are) If yes, then it might

Re: [R-sig-Geo] Problem using mahasuhab

2009-11-19 Thread Ned Horning
Mathieu, Thanks for the help - rgdal / spixdf2kasc seems to have done the trick. Here is the header from my ascii grid: -- ncols900 nrows1650 xllcorner0 yllcorner0 cellsize1000 NODATA_value- -- All the best, Ned Mathieu Basille wrote: Hi Ned, Adehabitat was not

[R-sig-Geo] changing the data type of a gdal dataset

2009-11-19 Thread Alan Swanson
Dear R gurus, I have a function that applies various model prediction functions over a set of large image files, producing a single output file with the same spatial extent. Due to memory issues, I'm breaking the input and output files into tiles. I have this working except for one small