Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Roger Bivand
On Tue, 17 Sep 2013, Waichler, Scott R wrote: My system is Redhat, RHEL5. The package does document all of these requirements: file.show(system.file("README", package="rgdal")) or: https://r-forge.r-project.org/scm/viewvc.php/pkg/inst/README?view=markup&root=rgdal or read the inst/README f

Re: [R-sig-Geo] problems to stack() rasters due to different pixel resolution and raster extent

2013-09-16 Thread Gabriele Cozzi
Robert, Thanks for the input. Looks like resample() and terrain() return the same values, which is reassuring. G On Mon, Sep 16, 2013 at 5:38 PM, Robert J. Hijmans wrote: > Gabrielle you are right, if the resolution is in fact different -- I > did not look carefully enough at the decimals -- th

Re: [R-sig-Geo] writeRaster to TIF changes raster maximum value

2013-09-16 Thread Robert J. Hijmans
Guillaume, This indeed happens because of NA value handling problems. The native raster format uses 255 as the NA value for Byte files. That probably needs to change. You write such a file because you crop a large area and a temporary file is written. There are work arounds, see below, but i will

Re: [R-sig-Geo] unsubscirbe me plz

2013-09-16 Thread Michael Sumner
Unsubscirbe yrself plz: https://stat.ethz.ch/mailman/listinfo/r-sig-geo (This information is in every message to the list.) Cheers, Mike. On Tue, Sep 17, 2013 at 2:49 PM, vikas Bhutani wrote: > > > Thanks & Regards > Vikas Bhutani > [[alternative HTML version deleted]] > > _

[R-sig-Geo] unsubscirbe me plz

2013-09-16 Thread vikas Bhutani
Thanks & Regards Vikas Bhutani [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Hodgess, Erin
Ok. I think I see it now. You need to have a spatial object rather than a list. So you might set up pnw1 <- data.frame(x=pnw$x,y=pnw$y) coordinates(pwn1) <- ~x+y Then you'll have a spatial object. After that, put in your projection: proj4string(pnw1) <- CRS(x)

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Waichler, Scott R
My system is Redhat, RHEL5. > str(pnw) List of 4 $ x: num [1:893] -117 -117 -117 -117 -117 ... $ y: num [1:893] 46 46 45.9 45.9 45.9 ... $ range: num [1:4] -125 -111 42 49 $ names: chr [1:7] "idaho" "oregon" "washington:san juan island" "washington:lopez island" ... - attr(*, "clas

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Hodgess, Erin
Whoops...I meant pnw -Original Message- From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-boun...@r-project.org] On Behalf Of Hodgess, Erin Sent: Monday, September 16, 2013 7:12 PM To: Waichler, Scott R; Rob Robinson Cc: r-sig-geo@r-project.org Subject: Re: [R-sig-Geo] function to

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Hodgess, Erin
I think that you need to download some proj4 stuff. If you're on Ubuntu, go to the Ubuntu package search page and you'll find it. Also, what is the str(pnw.spc) please? Thanks, Erin -Original Message- From: Waichler, Scott R [mailto:scott.waich...@pnnl.gov] Sent: Monday, September 16

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Waichler, Scott R
I am working in Linux. I clicked on the ESRI:102749 option on the spatialreference.org website that Rob referred to, and got a spec that looks like it should work inside CRS(), but something seems to be amiss. > library(rgdal) > pnw.spc <- spTransform(pnw, CRS = CRS("+proj=lcc +lat_1=45.8

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Hodgess, Erin
Hi Scott: Are you in Windows or a Linux type computer, please? -Original Message- From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-boun...@r-project.org] On Behalf Of Waichler, Scott R Sent: Monday, September 16, 2013 6:49 PM To: Rob Robinson Cc: r-sig-geo@r-project.org Subject:

Re: [R-sig-Geo] Batch conver from img to rst

2013-09-16 Thread Greg Snow
rst <- sub( '\\.img$','.rst', img) On Mon, Sep 16, 2013 at 11:15 AM, Eddie Smith wrote: > Thanks Greg, > > This will get all my img > img <- list.files(pattern='\\.img$') > > Could anybody kindly help me with sub function to change the input file > name and the output file name? > > > > > > On

Re: [R-sig-Geo] adehabitatHR kernalBB batch processing

2013-09-16 Thread Phil H
Hi, #I find that the code above does work ok to pull out individual liker values... sig255 <- liker(ltraj, sig2 = 255, rangesig1 = c(0, 1000)) tataall <- lapply(seq_along(ltraj), function(x) kernelbb(ltraj[x], sig1=sig255[[x]]$sig1, sig2=sig255[[x]]$sig2, grid=100, byburst=T)) #however you do n

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Waichler, Scott R
Ok, now I know about the existence of EPSG codes, but apparently my rgdal installation can't find the list of them? Do I need to find a certain file in my system's PROJ4 installation, then tell that to rgdal? > library(maps) > library(rgdal) > pnw <- map('state', region = c('washington', 'orego

[R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Waichler, Scott R
Hi, Does an R function exist to convert to and from the State Plane Coordinates system used in the U.S.? My search with Rseek was fruitless. Scott Waichler Hydrology Group, Energy & Environment Directorate Pacific Northwest National Laboratory Richland, WA, USA scott.waich...@pnnl.gov

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Michael Sumner
State plane is either UTM or Lambert Conformal Conic ("+proj=lcc"), but this is a *family* (of families) of projections, not a specific coordinate system. You'll need to be more specific by finding from an authority which actual "State Plane" projection you need. http://en.wikipedia.org/wiki/State

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Rob Robinson
try following the instructions here http://www.gpsmeter.com/index.php?page=faq14 to find an epsg code then something along the lines of spTransform(data, CRS=CRS("+init=epsg:xxx")) should work? cheers rob ** The new Bird Atlas is coming: http://www.bto.org/shop/bird-atlas *** Dr Rob R

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Waichler, Scott R
Erin, thanks, I'm getting closer. Rgdal's projInfo() lists UTM, which I believe is closely related to the State Plane Coordinate system, but I still don't see a direct transformation to SPC in R. --Scott Waichler > Could you mean spTransform from rgdal, please? > > __

Re: [R-sig-Geo] function to convert to/from U.S. State Plane Coordinates?

2013-09-16 Thread Hodgess, Erin
Could you mean spTransform from rgdal, please? From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on behalf of Waichler, Scott R [scott.waich...@pnnl.gov] Sent: Monday, September 16, 2013 4:33 PM To: r-sig-geo@r-project.org Subject: [R

Re: [R-sig-Geo] writeRaster to TIF changes raster maximum value

2013-09-16 Thread Guillaume.Drolet
Dear Robert, Here's a link to 2 images: the original raster (full) and the cropped one (sub): https://www.dropbox.com/sh/8zo8fo964kr6ttk/pH1JIpTZ1C The original raster has Byte values, as you suspected. But I don't know how to handle that so that it's not used as NA value. From what I read, NA

Re: [R-sig-Geo] KernelUD calculation - coordinates type / transformation from lat/long

2013-09-16 Thread Ben
Hi Zuzana, try this: read in your data as 'dat' Karea_xyUTM<- kernel.area(dat, id=rep('1', nrow(dat))) 20 0.001132550 25 0.001470329 30 0.001847845 35 0.002265101 40 0.002722095 45 0.003238697 50 0.003834776 55 0.004510333 60 0.005285235 65 0.006139616 70 0.007073473 75 0.008146416 80 0.0093584

Re: [R-sig-Geo] writeRaster to TIF changes raster maximum value

2013-09-16 Thread Robert J. Hijmans
I suspect that the original file has Byte values and that 255 is used, perhaps erroneously, as NA. Can you give me access to the file? Thanks, Robert On Mon, Sep 16, 2013 at 8:10 AM, wrote: > Dear list members, > > I need your help trying to figure out why my raster's maximum value gets > change

Re: [R-sig-Geo] Batch conver from img to rst

2013-09-16 Thread Eddie Smith
Thanks Greg, This will get all my img img <- list.files(pattern='\\.img$') Could anybody kindly help me with sub function to change the input file name and the output file name? On Mon, Sep 16, 2013 at 6:09 PM, Greg Snow <538...@gmail.com> wrote: > Use the list.files function to get a list

Re: [R-sig-Geo] Batch conver from img to rst

2013-09-16 Thread Greg Snow
Use the list.files function to get a list of your file names, save that in a variable, then use lapply or a loop to run your above code for each filename. The sub function is one option for changing the input filename to the output filename. On Mon, Sep 16, 2013 at 11:06 AM, Eddie Smith wrote:

Re: [R-sig-Geo] problems to stack() rasters due to different pixel resolution and raster extent

2013-09-16 Thread Robert J. Hijmans
Gabrielle you are right, if the resolution is in fact different -- I did not look carefully enough at the decimals -- then crop/extend won't work and you will need resample. Another approach would be to use the "terrain" function in raster and compute slope and aspect from the elevation data. Rober

[R-sig-Geo] Batch conver from img to rst

2013-09-16 Thread Eddie Smith
Dear list, I can manually write a raster file(*.img) format to *.rst using this code: library(raster) myraster <- raster("1982001.img") rstraster <- writeRaster(myraster, filename="1982001.rst", format="IDRISI", overwrite=TRUE) I have bunch of img files located in one folder. How could I convert

[R-sig-Geo] writeRaster to TIF changes raster maximum value

2013-09-16 Thread Guillaume.Drolet
Dear list members, I need your help trying to figure out why my raster's maximum value gets changed in the resulting TIF file from a call to the writeRaster function. I read here (http://r-sig-geo.2731867.n2.nabble.com/writeRaster-to-ascii-file-asc-td7584093.html#none) that this problem could