Re: [R-sig-Geo] Is the raster package still receiving updates?

2017-10-20 Thread Hodgess, Erin
I could take a swat at it, if you wish.  Please do send me the list of fixes.  
I could start in about a week, if that would work.
Sincerely,
Erin


Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu


From: R-sig-Geo  on behalf of Michael Sumner 

Sent: Friday, October 20, 2017 8:05 PM
To: Thiago V. dos Santos
Cc: R-sig-geo Mailing List
Subject: Re: [R-sig-Geo] Is the raster package still receiving updates?

No,  it's effectively abandoned. No concrete plans known.

I'm interested to keep it going and have kept a list of fixes needed, but
not sure when or if I'll get to it.

I'd support any efforts in this,  I'll rely on raster for many years still.

Cheers,  Mike

On Sat, 21 Oct 2017, 02:05 Thiago V. dos Santos via R-sig-Geo, <
r-sig-geo@r-project.org> wrote:

> Dear list,
>
> I realized that the latest version of the raster package was released on
> CRAN over a year ago.
>
> I also noticed that Robert's participation in this list has become rather
> scarce.
>
> I was just wondering whether the raster package is still receiving updates?
>
> Greetings,
>  -- Thiago V. dos Santos
>
> Postdoctoral Research Fellow
> Department of Climate and Space Science and Engineering
> University of Michigan
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Dr. Michael Sumner
Software and Database Engineer
Australian Antarctic Division
203 Channel Highway
Kingston Tasmania 7050 Australia

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] authorized model formulas for spatio-temporal models, please

2017-05-01 Thread Hodgess, Erin
Hello everyone.


Where would I find the authorized model formulas for spatio-temporal models, 
please?


?Thanks,

Erin



Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu

[[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] a recommendation for a large spatial data set, please

2017-02-11 Thread Hodgess, Erin
I found a perfect one in the plotKML package; the USAWgrids data.

Thanks,
Erin



Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu


From: R-sig-Geo <r-sig-geo-boun...@r-project.org> on behalf of Hodgess, Erin 
<hodge...@uhd.edu>
Sent: Saturday, February 11, 2017 1:48 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] a recommendation for a large spatial data set, please

Hello everyone.


Hope you are having a great weekend.


Could anyone recommend a nice spatial data set with about 15-20K observations 
please?  I'm testing out some functions and programs and need to check with a 
large set.


Free is good, too.


Thanks,

Erin



Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a recommendation for a large spatial data set, please

2017-02-11 Thread Hodgess, Erin
Hello everyone.


Hope you are having a great weekend.


Could anyone recommend a nice spatial data set with about 15-20K observations 
please?  I'm testing out some functions and programs and need to check with a 
large set.


Free is good, too.


Thanks,

Erin



Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu

[[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] R function checking/transforming CRS layer R function

2017-01-27 Thread Hodgess, Erin
Hi again!


Give this bad boy a shot:






CRSfunction<-function(couche)

 {


   prj_couche<-couche@proj4string

   prj_couche_c <- couche@proj4string@projargs

   prj<-CRS("+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3

x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs")

   prj_c <- "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3

x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs"


   if (prj_couche_c != prj_c){

 couche@proj4string <- prj

   }

 }




Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu

From: Tristan Bourgeois <tristan.bourge...@gmail.com>
Sent: Friday, January 27, 2017 4:39 AM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] R function checking/transforming CRS layer R function

Hi Erin !

Yes,   I tried to apply my function to "UH"  which is a shapefile.




2017-01-27 11:28 GMT+01:00 Hodgess, Erin 
<hodge...@uhd.edu<mailto:hodge...@uhd.edu>>:
Hi Tristan!

I'm looking at your code right now.  What is your input, please; the UH?

Thanks,
Erin


Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu<mailto:hodge...@uhd.edu>


From: R-sig-Geo 
<r-sig-geo-boun...@r-project.org<mailto:r-sig-geo-boun...@r-project.org>> on 
behalf of Tristan Bourgeois 
<tristan.bourge...@gmail.com<mailto:tristan.bourge...@gmail.com>>
Sent: Friday, January 27, 2017 3:41 AM
To: r-sig-geo@r-project.org<mailto:r-sig-geo@r-project.org>
Subject: [R-sig-Geo] R function checking/transforming CRS layer R function

Dear all,

I'm trying to build up an r function able to check if the projection system
of a layer is in Lambert93 (WSG code : 2154) .
If the condition is false I want to transform the CRS into Lambert 93.

This is what I wrote :

> CRSfunction<-function(couche)
+ {
+   prj_couche<-CRS(couche)
+   prj<-CRS("+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3
+x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs")
+   if (prj_couche!=prj)
+ {CRS(couche)="+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3
+x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs" }
+ }
> CRSfunction(UH)
Error in CRS(couche) : no method for coercing this S4 class to a vector
In addition: Warning message:
In is.na<http://is.na>(projargs) : is.na<http://is.na>() applied to non-(list 
or vector) of type 'S4'
Called from: CRS(couche)
Browse[1]> Q


Does anybody can help to deal with the mistake I 've made ??

Plus, I'm not sure the function will work with both raster and shapefiles.

Cheers.


Tristan Bourgeois.
R New User

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org<mailto:R-sig-Geo@r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
Tristan Bourgeois

[[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] R function checking/transforming CRS layer R function

2017-01-27 Thread Hodgess, Erin
Hi Tristan!

I'm looking at your code right now.  What is your input, please; the UH?

Thanks,
Erin


Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu


From: R-sig-Geo  on behalf of Tristan 
Bourgeois 
Sent: Friday, January 27, 2017 3:41 AM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] R function checking/transforming CRS layer R function

Dear all,

I'm trying to build up an r function able to check if the projection system
of a layer is in Lambert93 (WSG code : 2154) .
If the condition is false I want to transform the CRS into Lambert 93.

This is what I wrote :

> CRSfunction<-function(couche)
+ {
+   prj_couche<-CRS(couche)
+   prj<-CRS("+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3
+x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs")
+   if (prj_couche!=prj)
+ {CRS(couche)="+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3
+x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs" }
+ }
> CRSfunction(UH)
Error in CRS(couche) : no method for coercing this S4 class to a vector
In addition: Warning message:
In is.na(projargs) : is.na() applied to non-(list or vector) of type 'S4'
Called from: CRS(couche)
Browse[1]> Q


Does anybody can help to deal with the mistake I 've made ??

Plus, I'm not sure the function will work with both raster and shapefiles.

Cheers.


Tristan Bourgeois.
R New User

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] Parallel processing a list of SpatialPoints

2016-08-17 Thread Hodgess, Erin
Do you know Mpi, by any chance,  please?  What kind of machine/operating system 
are you using,  please? 

Thanks,  
Erin 

Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu


From: R-sig-Geo [r-sig-geo-boun...@r-project.org] on behalf of David Wang 
[dw2...@outlook.com]
Sent: Wednesday, August 17, 2016 5:00 PM
To: r-sig-geo
Subject: [R-sig-Geo] Parallel processing a list of SpatialPoints

Hello,


I have a list of SpatialPointsDataFrame objects that represent feature centers 
along the time axis. For example, let's say the list is centers. centers[[1]] 
are the points at t = 1, centers[[2]] are the points at t = 2, and so on. Now 
for every point at t, I need to link it to, if any, the nearest point within a 
search radius at the next time step t + 1. The procedure is applied to all time 
steps, and the result are tracks that connect selected feature centers in time. 
I have implemented a solution using igraph package, with every center 
represented by a vertex and every link by an edge. This way, tracks are simply 
connected components of the graph. Now because the number of centers and links 
are quite large, the algorithm takes a while to run. But since finding the 
nearest neighbors between t and t + 1 and between t + 1 and t + 2 are 
independent, I think parallel processing should be possible, although I haven't 
figured out how. Does anyone here happen to have a pointer or !
 two? I work on a multicore PC. Here is my code snippet:


g <- graph.empty(directed = TRUE)
for (k in seq_along(centers)) {
  pts <- centers[[k]]
  g <- add_vertices(g, nv = length(pts), id = k, attr = as.data.frame(pts))
  if (length(V(g)[id == (k - 1)]) > 0 & length(V(g)[id == k]) > 0) {
v1 <- V(g)[id == (k - 1)]
v2 <- V(g)[id == k]
rd <- rdist(cbind(v1$x, v1$y), cbind(v2$x, v2$y))
for (i in 1:nrow(rd)) {
  if (min(rd[i, ]) < maxDist) {
e <- c(V(g)[id == (k - 1)][i], V(g)[id == k][which.min(rd[i, ])])
g <- add_edges(g, e)
  }
}
  }
}
tracks <- groups(components(g)) # vertex ids along each track


Thanks,

David

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a spatial data set recommendation, please

2016-07-28 Thread Hodgess, Erin
Hello!

Could anyone recommend some good spatial data sets with one or two variables 
with 5000+ observations, please?

I've been looking, probably not in the right place. Just getting little sets.

Thanks,
Erin


Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] gamma from fitVariogram output vs. Covariance matrix

2016-07-20 Thread Hodgess, Erin
Hello everyone:

I have a question about the gamma output which appears with the fitVariogram 
results, please.

Here is a sample output:
$ exp_var  :Classes �gstatVariogram� and 'data.frame': 12 obs. of  6 variables:
  ..$ np : num [1:12] 181 499 844 1758 2356 ...
  ..$ dist   : num [1:12] 22.4 52.2 85.4 126.4 176.9 ...
  ..$ gamma  : num [1:12] 116033 138020 133462 133186 134257 ...
  ..$ dir.hor: num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ dir.ver: num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ id : Factor w/ 1 level "var1": 1 1 1 1 1 1 1 1 1 1 ...


And you notice there are 12 values.  However, there are 1000 values in the 
actual data set itself. I realize that there are point-pairs selected in order 
to produce the gamma values.  But how would this relate to either a covariance 
or correlation matrix, please?

Thanks in advance,
Sincerely,
Erin




Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodge...@uhd.edu

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] something potentially fun/useful

2016-04-15 Thread Hodgess, Erin
Hello!

I hope this is ok to post this here.  There will be a special session on High 
Performance Computing in Geostatistics at the INASE conference in Riga, Latvia 
in May 28 - 30.  It will appear later today on the website.  
www.inase.org

Thanks,
Erin
PS  I am the organizer; please do feel free to contact me at hodge...@uhd.edu



[[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] still having trouble with rgdal, please

2016-04-14 Thread Hodgess, Erin
The LD_LIBRARY_PATH worked like a charm!

Thanks again!

Sincerely,
Erin


From: Roger Bivand [roger.biv...@nhh.no]
Sent: Thursday, April 14, 2016 1:47 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] still having trouble with rgdal, please

On Thu, 14 Apr 2016, Hodgess, Erin wrote:

> First of all, thanks to Roger Bivand for his great suggestions!  I am
> making gradual progress.
>
> However, not all is well yet.  One of my files from the gdal still seems
> to be missing:

Please read:

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

and note that while you as non-super-user cannot use ldconfig to tell the
system to look in the right place for libgdal.so (it was found during
compilation and linking), you can set the environment
variable LD_LIBRARY_PATH despite the weaknesses that this has compared to
using ldconfig as super user. Running Sys.getenv("LD_LIBRARY_PATH") in R
shows you that R sets it up for its own purposes anyway (mostly for the
Java runtime engine).

Hope this helps,

Roger

>
>
>> install.packages("rgdal",lib="/work/01260/ehodgess/Rlibs",configure.args=c('--with-gdal-config=/work/01260/ehodgess/gdal/bin/gdal-config
>>  --with-proj-include=/work/01260/ehodgess/proj4/include 
>> --with-proj-lib=/work/01260/ehodgess/proj4/lib'),depen=TRUE)
> trying URL 
> 'http://cran.revolutionanalytics.com/src/contrib/rgdal_1.1-8.tar.gz'
> Content type 'application/octet-stream' length 1649879 bytes (1.6 MB)
> ==
> downloaded 1.6 MB
>
> * installing *source* package 'rgdal' ...
> ** package 'rgdal' successfully unpacked and MD5 sums checked
> configure: CC: gcc -std=gnu99
> configure: CXX: g++
> configure: rgdal: 1.1-8
> checking for /usr/bin/svnversion... yes
> configure: svn revision: 616
> configure: gdal-config set to /work/01260/ehodgess/gdal/bin/gdal-config
> checking gdal-config exists... yes
> checking gdal-config executable... yes
> checking gdal-config usability... yes
> configure: GDAL: 2.0.2
> checking GDAL version >= 1.6.3... yes
> configure: experimental conditional use of GDAL2
>
>
> a bunch of good stuff
>
>
> g++ -shared -L/usr/local/lib64 -o rgdal.so OGR_write.o gdal-bindings.o init.o 
> local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o 
> projectit.o -L/work/01260/ehodgess/gdal/lib -lgdal 
> -L/work/01260/ehodgess/proj4/lib -lproj
> installing to /work/01260/ehodgess/Rlibs/rgdal/libs
> ** R
> ** data
> ** inst
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded
> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>  unable to load shared object 
> '/work/01260/ehodgess/Rlibs/rgdal/libs/rgdal.so':
>  libgdal.so.20: cannot open shared object file: No such file or directory
> Error: loading failed
> Execution halted
> ERROR: loading failed
> * removing '/work/01260/ehodgess/Rlibs/rgdal'
>
> The downloaded source packages are in
>'/tmp/RtmpXX2VTF/downloaded_packages'
> Warning message:
> In install.packages("rgdal", lib = "/work/01260/ehodgess/Rlibs",  :
>  installation of package 'rgdal' had non-zero exit status
>> system("echo $PATH")
> /work/01260/ehodgess/custom-R-3.2.2/R-3.2.2/bin:/opt/apps/xalt/0.6/bin:/opt/apps/intel15/mvapich2/2.1/bin:/opt/apps/intel/15/composer_xe_2015.2.164/bin/intel64:
> /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/opt/apps/xsede/gsi-openssh-5.7/bin:/usr/X11R6/bin:/opt/ofed/bin:/opt/ofed/sbin:.:/work/01260/ehodgess/gdal/bin:
> /work/01260/ehodgess/gdal/lib
>>
>
> So it's saying that libgdal.so.20 is not found.  However, it is in gdal/lib, 
> which is in the path.   (See last line).
>
> Is there something else that I should be putting into the install.packages 
> function, please?  I've tried all kinds of things (putting a copy of 
> libgdal.so.20 into Rlibs, etc.), but no good.
>
>
> Thanks,
> Erin
>
>
>
> Erin M. Hodgess, Ph.D.
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: hodge...@uhd.edu<mailto:hodge...@uhd.edu>
>
>
>   [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: roger.biv...@nhh.no
http://orcid.org/-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0J=en
http://depsy.org/person/434412

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] still having trouble with rgdal, please

2016-04-14 Thread Hodgess, Erin
First of all, thanks to Roger Bivand for his great suggestions!  I am making 
gradual progress.

However, not all is well yet.  One of my files from the gdal still seems to be 
missing:


> install.packages("rgdal",lib="/work/01260/ehodgess/Rlibs",configure.args=c('--with-gdal-config=/work/01260/ehodgess/gdal/bin/gdal-config
>  --with-proj-include=/work/01260/ehodgess/proj4/include 
> --with-proj-lib=/work/01260/ehodgess/proj4/lib'),depen=TRUE)
trying URL 'http://cran.revolutionanalytics.com/src/contrib/rgdal_1.1-8.tar.gz'
Content type 'application/octet-stream' length 1649879 bytes (1.6 MB)
==
downloaded 1.6 MB

* installing *source* package 'rgdal' ...
** package 'rgdal' successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 1.1-8
checking for /usr/bin/svnversion... yes
configure: svn revision: 616
configure: gdal-config set to /work/01260/ehodgess/gdal/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... yes
configure: GDAL: 2.0.2
checking GDAL version >= 1.6.3... yes
configure: experimental conditional use of GDAL2


a bunch of good stuff


g++ -shared -L/usr/local/lib64 -o rgdal.so OGR_write.o gdal-bindings.o init.o 
local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o 
projectit.o -L/work/01260/ehodgess/gdal/lib -lgdal 
-L/work/01260/ehodgess/proj4/lib -lproj
installing to /work/01260/ehodgess/Rlibs/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/work/01260/ehodgess/Rlibs/rgdal/libs/rgdal.so':
  libgdal.so.20: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/work/01260/ehodgess/Rlibs/rgdal'

The downloaded source packages are in
'/tmp/RtmpXX2VTF/downloaded_packages'
Warning message:
In install.packages("rgdal", lib = "/work/01260/ehodgess/Rlibs",  :
  installation of package 'rgdal' had non-zero exit status
> system("echo $PATH")
/work/01260/ehodgess/custom-R-3.2.2/R-3.2.2/bin:/opt/apps/xalt/0.6/bin:/opt/apps/intel15/mvapich2/2.1/bin:/opt/apps/intel/15/composer_xe_2015.2.164/bin/intel64:
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/opt/apps/xsede/gsi-openssh-5.7/bin:/usr/X11R6/bin:/opt/ofed/bin:/opt/ofed/sbin:.:/work/01260/ehodgess/gdal/bin:
/work/01260/ehodgess/gdal/lib
>

So it's saying that libgdal.so.20 is not found.  However, it is in gdal/lib, 
which is in the path.   (See last line).

Is there something else that I should be putting into the install.packages 
function, please?  I've tried all kinds of things (putting a copy of 
libgdal.so.20 into Rlibs, etc.), but no good.


Thanks,
Erin



Erin M. Hodgess, Ph.D.
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodge...@uhd.edu


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] installing rgdal when gdal is in a non-standard location

2016-04-14 Thread Hodgess, Erin
Hello!

I'm trying to install rgdal and I have already installed gdal.  gdal is in a 
non-standard location, since I don't have administrative rights on this system.

I've seen how to use the configure.args with proj, but don't see anything for 
gdal.

Sorry for the dumb question!

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] testing for timing in different sections of kriging

2015-10-12 Thread Hodgess, Erin
Hello!

I'm looking at the gstat package, in particular at the krige function.  I am 
interested in the amount of time that different steps within the main krige 
function itself take.

So what I did (which is probably wrong and complete overkill) is to download 
the source for gstat, untar it, and then copy it to a new directory called 
egstat.

In the R directory, I copied krige.R to ekr1.R and changed gstat to egstat; 
predict to pred1.  Also, I copied gstat.R to egstat.R and predict.gstat.R to 
pred1.R

I changed the cleanup function to read egstat instead of gstat.  Updated the 
DESCRIPTION file to read egstat with a number of 1.0.0.

When I try to run "build", this is the error that I get:

-o version.o
gcc -m64 -shared -s -static-libgcc -o egstat.dll tmp.def block.o chfactor.o copy
.o data.o direct.o err.o fit.o gcdist.o getest.o gls.o glvars.o hsehldr.o init.o
ivecop.o lex.o lm.o lufactor.o machine.o mapio.o matop.o meminfo.o memory.o msi
m.o norm.o nsearch.o parse.o polygon.o pqueue.o predict.o pxop.o qrfactor.o rand
om.o read.o reml.o s.o select.o sem.o sim.o solve.o sparse.o sprow.o stat.o subm
at.o userio.o utils.o vario.o vario_fn.o vario_io.o vecop.o version.o -Ld:/RComp
ile/r-compiling/local/local320/lib/x64 -Ld:/RCompile/r-compiling/local/local320/
lib -Lc:/Progra~1/R/R-32~1.2/bin/x64 -lR
installing to C:/Users/hodgesse/AppData/Local/Temp/Rtmpkbqf0I/Rinst10a010ca1991/
egstat/libs/x64
** R
** data
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in library.dynam(lib, package, package.lib) :
  DLL 'gstat' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
ERROR: loading failed
* removing 'C:/Users/hodgesse/AppData/Local/Temp/Rtmpkbqf0I/Rinst10a010ca1991/eg
stat'
  ---
ERROR: package installation failed

It's looking for gstat instead of egstat, but I don't know how to fix it.

This is on Windows version 7.

Thanks for any help!

Sincerely,
Erin


Erin M. Hodgess, Ph.D.
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodge...@uhd.edu


[[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] testing for timing in different sections of kriging

2015-10-12 Thread Hodgess, Erin
Arrgh!  That's it!  Thanks so much!

I like that modified function approach much better.

Thanks again,
Sincerely,
E
rin


-Original Message-
From: R-sig-Geo [mailto:r-sig-geo-boun...@r-project.org] On Behalf Of Edzer 
Pebesma
Sent: Monday, October 12, 2015 4:50 PM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] testing for timing in different sections of kriging

Erin, it seems you try to rename the whole package. In that case, in the first 
line of the NAMESPACE file, you also need to make the change, as it now is

useDynLib(gstat,

Please see "Writing R Extensions" for the full infos you'll need.

A simpler approach to learn about timings might be to not rename the package, 
but add your modified function to it (and export those).

On 12/10/15 15:27, Hodgess, Erin wrote:
> Hello!
> 
> I'm looking at the gstat package, in particular at the krige function.  I am 
> interested in the amount of time that different steps within the main krige 
> function itself take.
> 
> So what I did (which is probably wrong and complete overkill) is to download 
> the source for gstat, untar it, and then copy it to a new directory called 
> egstat.
> 
> In the R directory, I copied krige.R to ekr1.R and changed gstat to 
> egstat; predict to pred1.  Also, I copied gstat.R to egstat.R and 
> predict.gstat.R to pred1.R
> 
> I changed the cleanup function to read egstat instead of gstat.  Updated the 
> DESCRIPTION file to read egstat with a number of 1.0.0.
> 
> When I try to run "build", this is the error that I get:
> 
> -o version.o
> gcc -m64 -shared -s -static-libgcc -o egstat.dll tmp.def block.o 
> chfactor.o copy .o data.o direct.o err.o fit.o gcdist.o getest.o gls.o 
> glvars.o hsehldr.o init.o ivecop.o lex.o lm.o lufactor.o machine.o 
> mapio.o matop.o meminfo.o memory.o msi m.o norm.o nsearch.o parse.o 
> polygon.o pqueue.o predict.o pxop.o qrfactor.o rand om.o read.o reml.o 
> s.o select.o sem.o sim.o solve.o sparse.o sprow.o stat.o subm at.o 
> userio.o utils.o vario.o vario_fn.o vario_io.o vecop.o version.o 
> -Ld:/RComp
> ile/r-compiling/local/local320/lib/x64 
> -Ld:/RCompile/r-compiling/local/local320/
> lib -Lc:/Progra~1/R/R-32~1.2/bin/x64 -lR installing to 
> C:/Users/hodgesse/AppData/Local/Temp/Rtmpkbqf0I/Rinst10a010ca1991/
> egstat/libs/x64
> ** R
> ** data
> ** demo
> ** inst
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded Error in 
> library.dynam(lib, package, package.lib) :
>   DLL 'gstat' not found: maybe not installed for this architecture?
> Error: loading failed
> Execution halted
> ERROR: loading failed
> * removing 
> 'C:/Users/hodgesse/AppData/Local/Temp/Rtmpkbqf0I/Rinst10a010ca1991/eg
> stat'
>   ---
> ERROR: package installation failed
> 
> It's looking for gstat instead of egstat, but I don't know how to fix it.
> 
> This is on Windows version 7.
> 
> Thanks for any help!
> 
> Sincerely,
> Erin
> 
> 
> Erin M. Hodgess, Ph.D.
> Associate Professor
> Department of Computer and Mathematical Sciences University of Houston 
> - Downtown
> mailto: hodge...@uhd.edu<mailto:hodge...@uhd.edu>
> 
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

--
Edzer Pebesma
Institute for Geoinformatics (ifgi),  University of Münster, Heisenbergstraße 
2, 48149 Münster, Germany; +49 251 83 33081
Journal of Statistical Software:   http://www.jstatsoft.org/
Computers & Geosciences:   http://elsevier.com/locate/cageo/
Spatial Statistics Society http://www.spatialstatistics.info

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] Problem in EPSG 2154 => 102110

2015-09-22 Thread Hodgess, Erin
Hello!

I ran through your example, and brought the OGR file back into R via the 
readOGR function.

> xxx <- readOGR(dsn="C:\\ajeter",layer="toto")
OGR data source with driver: ESRI Shapefile
Source: "C:\ajeter", layer: "toto"
with 1 features
It has 2 fields
> str(xxx)
Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots
  ..@ data   :'data.frame': 1 obs. of  2 variables:
  .. ..$ IDENT: num 1
  .. ..$ ncols: num 1000
  ..@ polygons   :List of 1
  .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. ..@ Polygons :List of 1
  .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. ..@ labpt  : num [1:2] 700500 6500500
  .. .. .. .. .. .. ..@ area   : num 1e+06
  .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 70 70 701000 701000 
70 ...
  .. .. .. ..@ plotOrder: int 1
  .. .. .. ..@ labpt: num [1:2] 700500 6500500
  .. .. .. ..@ ID   : chr "0"
  .. .. .. ..@ area : num 1e+06
  ..@ plotOrder  : int 1
  ..@ bbox   : num [1:2, 1:2] 70 650 701000 6501000
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "x" "y"
  .. .. ..$ : chr [1:2] "min" "max"
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
  .. .. ..@ projargs: chr "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 
+x_0=70 +y_0=660 +ellps=GRS80 +units=m +no_defs"
>
If you put that big @projagrs into google.com, this is what you get:

Proj4js.defs["EPSG:2154"] = "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 
+x_0=70 +y_0=660 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";

Is that what you want, please?

Thanks,
Erin



From: R-sig-Geo [r-sig-geo-boun...@r-project.org] on behalf of PONS Frederic - 
CEREMA/DTerMed/DREC/SRILH [frederic.p...@cerema.fr]
Sent: Tuesday, September 22, 2015 9:25 AM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Problem in EPSG 2154 => 102110

Dear R-users,

I have a problem when I create a spatialpolygondataframe

I want to have an EPSG 2154 but after the export the epsg is 102110.

It seems to be the "same" CRS but it is not what I want.

A small example to help me
Best regards

xlla=70
ylla=650
ncolsa=1000
nrowsa=1000
cellsizea=1

tableau <- data.frame(IDENT = 1, ncols = 1000, row.names = 1)

crds <- cbind(x=c(xlla,xlla+ncolsa*cellsizea, xlla+ncolsa*cellsizea, xlla, 
xlla), y=c(ylla, ylla, ylla+nrowsa*cellsizea, ylla+nrowsa*cellsizea, ylla))

Pa <- Polygon (crds)
Psa <- Polygons (list ( Pa ), 1)
pola <- SpatialPolygons (list ( Psa ), proj4string=CRS("+init=epsg:2154"))
SPDFa <- SpatialPolygonsDataFrame(pola, tableau)

writeOGR(SPDFa, dsn="C:\\ajeter",layer="toto",driver="ESRI 
Shapefile",overwrite_layer=TRUE)

Frédéric Pons
Expert hydraulique sur les inondations et aléas côtiers
DREC/Service Risques Inondations Littoraux et Hydraulique - Tél.: (33)4 42 24 
76 68
Direction Territoriale Méditerranée
[cid:part1.04060105.02070900@cerema.fr]
Centre d’études et d’expertise sur les risques, l’environnement, la mobilité et 
l’aménagement
www.cerema.fr

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] krigeST question (yet again!)

2014-09-15 Thread Hodgess, Erin
Hello r-Sig-Geo-ers!



I have a goofy question (surprise!), please:



When we use krigeST, we can predict spatially in many locations other than the 
original data locations.  Can we also predict temporally farther out, please?  
For instance, say my data set runs from Jan 2014 - Aug 2014, and I want to 
predict from Sep - Oct 2014.  Could I set that up in in my prediction set (such 
that it would be reasonable), please?



Thanks,

Sincerely,

Erin



[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] parallel version of krige or krigeST please

2014-08-01 Thread Hodgess, Erin
Hello again!



Is there a parallel version of krige or krigeST, please?



Thanks in advance,

Sincerely,

Erin



[[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] how to change the fit.method from autoKrige, please

2014-07-29 Thread Hodgess, Erin
Greatthanks so much!

Sincerely,
Erin


From: Jon Skoien [jon.sko...@jrc.ec.europa.eu]
Sent: Tuesday, July 29, 2014 2:06 AM
To: Hodgess, Erin; r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] how to change the fit.method from autoKrige, please

It seems you cannot change the fit.method from autoKrige or
autofitVariogram, it uses the default from gstat::fit.variogram, which
is method 7.
However, you should probably first try to see why you get the error and
what is zero. I assume that your error is that you have zero distances
semivariances, do you have a lot of duplicated locations? Is this
necessary for your case to keep these, can you delete them, or can you
add some noise to the coordinates with jitter?

Best wishes,
Jon


On 7/28/2014 10:22 PM, Hodgess, Erin wrote:
 Hello!



 I'm using the autoKrige function on a data set and keep getting an error that 
 fit.method 7 has zero semivariances.



 How do I change the fit.method from within autoKrige, please?



 I've tried using it both inside and outside of miscFitOptions, but no luck 
 yet.



 Any suggestions would be much appreciated.



 Sincerely,

 Erin



   [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] question about autoKrige anis1 and anis2

2014-07-29 Thread Hodgess, Erin
Hello again!



I was using autoKrige (finally successfully!) and was looking at the model 
results.  I got anis1 of 1,1 and anis2 of 1,1.



How does this relate to the anis in the vgm function, please?



Thanks,

Erin



[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] how to change the fit.method from autoKrige, please

2014-07-28 Thread Hodgess, Erin
Hello!



I'm using the autoKrige function on a data set and keep getting an error that 
fit.method 7 has zero semivariances.



How do I change the fit.method from within autoKrige, please?



I've tried using it both inside and outside of miscFitOptions, but no luck yet.



Any suggestions would be much appreciated.



Sincerely,

Erin



[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] raster plotting question: figured it out

2014-07-25 Thread Hodgess, Erin
Sorry for the trouble.





[[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] raster plotting question: figured it out

2014-07-25 Thread Hodgess, Erin
Sure!



No prob:



min1 - min(a@data@values,b@data@valuesmailto:a@data@values,b@data@values)

max1 - max(a@data@values,b@data@valuesmailto:a@data@values,b@data@values)

bk1 - seq(from=min1,to=max1,len=6)  #note: make the len whatever you wish

par(mfrow=c(1,2))

plot(a,breaks=bk1)

plot(b,breaks=bk1)



Thanks!



I'm glad to hear that somebody else might use itthought I was just being a 
complete doofus!



Take care,

Erin




From: Michael Treglia [mtreg...@gmail.com]
Sent: Friday, July 25, 2014 1:42 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] raster plotting question: figured it out

Hey Erin,
Could you please include the solution? I haven't had to do that, but I'm sure 
that I (and others) will probably have to in the future, so it may be useful to 
have the solution in this thread
Thanks!
Mike


On Fri, Jul 25, 2014 at 2:25 PM, Hodgess, Erin 
hodge...@uhd.edumailto:hodge...@uhd.edu wrote:
Sorry for the trouble.





[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.orgmailto:R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a KMZ question, please

2014-07-09 Thread Hodgess, Erin
Hello Geo-Phytes!



How are you today?



I have a quick question, please:  I would like to make a KMZ file as an output 
from the plotKML function (from an STFDF object).



What zip programs can do this, please?  WinZip doesn't seem to work.  This is 
on Windows 7.



Thanks for any help,

Sincerely,

Erin



[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] trouble with makegrid

2014-04-24 Thread Hodgess, Erin
Hi everyone!

I have been using makegrid and it worked fine.  Until tonight.  I upgraded to 
R-3.1.0 on my Ubuntu, and am using plotKML and gstat from R-Forge.

Here is my new snag:

 u2 - SpatialPoints(makegrid(texb,n=800))
Warning message:
In makegrid(texb, n = 800) : NaNs produced
Error in coordinates(coords) :
  error in evaluating the argument 'obj' in selecting a method for function 
'coordinates': Error in if (any(sel)) min.coords[sel] = min.coords[sel] - 
cellsize[sel] :
  missing value where TRUE/FALSE needed


It worked fine this morning.

What went wrong, please?

Thanks,
Erin




[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] time units with plotKML

2014-04-21 Thread Hodgess, Erin
Hello everyone!

I'm trying to use the plotKML on an STFDF object.

I used the krigeST function and all was well.

But when I try to produce the kml plot, I get the following error:

Plotting the first variable on the list
KML file opened for writing...
Error in UseMethod(units-) :
  no applicable method for 'units-' applied to an object of class 
c('POSIXct', 'POSIXt')


Does this look familiar, please?  I'm using daily data, so it should be ok.

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] plotKML problem

2014-03-30 Thread Hodgess, Erin
Hello!

I have the following STFDF object, which uses quarterly data.

 str(st.u)
Formal class 'STFDF' [package spacetime] with 4 slots
  ..@ data   :'data.frame':6272 obs. of  1 variable:
  .. ..$ var1.pred: num [1:6272] 0.302 0.304 0.306 0.308 0.312 ...
  ..@ sp :Formal class 'SpatialPixels' [package sp] with 5 slots
  .. .. ..@ grid   :Formal class 'GridTopology' [package sp] with 3 slots
  .. .. .. .. ..@ cellcentre.offset: Named num [1:2] 0.057 0.029
  .. .. .. .. .. ..- attr(*, names)= chr [1:2] x1 x2
  .. .. .. .. ..@ cellsize : Named num [1:2] 0.034 0.034
  .. .. .. .. .. ..- attr(*, names)= chr [1:2] x1 x2
  .. .. .. .. ..@ cells.dim: Named int [1:2] 28 28
  .. .. .. .. .. ..- attr(*, names)= chr [1:2] x1 x2
  .. .. ..@ grid.index : int [1:784] 757 758 759 760 761 762 763 764 765 766 ...
  .. .. ..@ coords : num [1:784, 1:2] 0.057 0.091 0.125 0.159 0.193 0.227 
0.261 0.295 0.329 0.363 ...
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : NULL
  .. .. .. .. ..$ : chr [1:2] x1 x2
  .. .. ..@ bbox   : num [1:2, 1:2] 0.04 0.012 0.992 0.964
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : chr [1:2] x1 x2
  .. .. .. .. ..$ : chr [1:2] min max
  .. .. ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. .. .. ..@ projargs: chr +proj=longlat +datum=WGS84 +ellps=WGS84 
+towgs84=0,0,0
  ..@ time   :An ‘xts’ object on 2000 Q1/2001 Q4 containing:
  Data: int [1:8, 1] 1 2 3 4 5 6 7 8
  Indexed by objects of class: [yearqtr] TZ:
  xts Attributes:
 NULL
  ..@ endTime: POSIXct[1:8], format: 2000-03-31 18:00:00 2000-06-30 
19:00:00 ...

When I try to plot it with plotKML, I get the following:

 plotKML(st.u)
Plotting the first variable on the list
KML file opened for writing...
Temporal support not indicated... using 'dtime=0'.
Error in as.POSIXlt.character(x, tz, ...) :
  character string is not in a standard unambiguous format


Does the time stamp only work for daily objects, please?  I'm thinking that it 
should actually be ok.

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] yet another plotKML question

2014-03-30 Thread Hodgess, Erin
This is really goofy, so please forgive me in advance:  where is 
kml_layer.STFDF called from, please?

Sorry.

e


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] Back to krigeST and Dates

2014-03-29 Thread Hodgess, Erin
Hello everyone!

I'm trying to use krigeST with quarterly data.  I get the error message:


warning(The spatio-temporal variogram model does not carry a time unit 
attribute: krisgeST cannot check whether the temporal distance metrics 
coincide.)

I had run into that with annual data but thought that it would work with 
quarterly data.

I'm sure that this is something goofy that I'm just not seeing.  Any help would 
be much appreciated.

Sincerely,
Erin


[[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] Back to krigeST and Dates

2014-03-29 Thread Hodgess, Erin
Never mind...I found the old post with the answer.  Sorry for the trouble.


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Hodgess, Erin [hodge...@uhd.edu]
Sent: Saturday, March 29, 2014 9:56 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Back to krigeST and Dates

Hello everyone!

I'm trying to use krigeST with quarterly data.  I get the error message:


warning(The spatio-temporal variogram model does not carry a time unit 
attribute: krisgeST cannot check whether the temporal distance metrics 
coincide.)

I had run into that with annual data but thought that it would work with 
quarterly data.

I'm sure that this is something goofy that I'm just not seeing.  Any help would 
be much appreciated.

Sincerely,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] How to read or import a kml file in R

2014-03-24 Thread Hodgess, Erin
Hello Manuel:

Not sure what you're trying to do.  KML files display in Google Earth  Google 
Maps.

You can create KML files in R but not display them.

Hope this helps!

Sincerely,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Manuel Spínola [mspinol...@gmail.com]
Sent: Monday, March 24, 2014 1:02 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] How to read or import a kml file in R

Dear list members,

How to read a .kml file in R.  I was reading some threads on this, but I
stll don't understand how to do it.

The name of my file is Circuito Tamarindo.kml

Best,

Manuel

--
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río https://sites.google.com/site/lobitoderio/
Institutional website: ICOMVIS http://www.icomvis.una.ac.cr/

[[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] How to read or import a kml file in R

2014-03-24 Thread Hodgess, Erin
I didn't realize that readOGR could do that.  Very cool!  Thanks for the good 
info.


From: Alex Mandel [tech_...@wildintellect.com]
Sent: Monday, March 24, 2014 1:30 PM
To: Hodgess, Erin; Manuel Spínola; r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] How to read or import a kml file in R

Well that hardly seems the whole story.
rgdal package's readOGR should be able to import kml into an sp object,
which can be analyzed or plotted.

https://stat.ethz.ch/pipermail/r-sig-geo/2010-May/008370.html

I think Erin was confusing it with KMZ files which are a bundle of kml +
images(sometimes) that are hard to use anywhere but Google Earth. Though
the trick is to just unzip them and use the components individually.

Thanks,
Alex

On 03/24/2014 11:16 AM, Hodgess, Erin wrote:
 Hello Manuel:

 Not sure what you're trying to do.  KML files display in Google Earth  
 Google Maps.

 You can create KML files in R but not display them.

 Hope this helps!

 Sincerely,
 Erin

 
 From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
 behalf of Manuel Spínola [mspinol...@gmail.com]
 Sent: Monday, March 24, 2014 1:02 PM
 To: r-sig-geo@r-project.org
 Subject: [R-sig-Geo] How to read or import a kml file in R

 Dear list members,

 How to read a .kml file in R.  I was reading some threads on this, but I
 stll don't understand how to do it.

 The name of my file is Circuito Tamarindo.kml

 Best,

 Manuel

 --
 *Manuel Spínola, Ph.D.*
 Instituto Internacional en Conservación y Manejo de Vida Silvestre
 Universidad Nacional
 Apartado 1350-3000
 Heredia
 COSTA RICA
 mspin...@una.ac.cr
 mspinol...@gmail.com
 Teléfono: (506) 2277-3598
 Fax: (506) 2237-7036
 Personal website: Lobito de río https://sites.google.com/site/lobitoderio/
 Institutional website: ICOMVIS http://www.icomvis.una.ac.cr/

 [[alternative HTML version deleted]]


 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo



___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] a comparison question

2014-03-07 Thread Hodgess, Erin
Thanks to both very much!

From: Roger Bivand [roger.biv...@nhh.no]
Sent: Friday, March 07, 2014 10:35 AM
To: Wissner, Michael (DOF)
Cc: Hodgess, Erin; r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] a comparison question

On Fri, 7 Mar 2014, Wissner, Michael (DOF) wrote:

 Erin,

 My (basic) understanding of these two techniques is that kriging outputs
 a predictive surface with values derived from a variogram while GWR
 executes a regression equation on each feature in a dataset with a
 spatial weighting component.  So I think the answer to your question is
 that it depends on what output you're looking for and what you're trying
 to accomplish.

 From ESRI's How Kriging Works
 (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z007600.htm)...
 it has been said that kriging uses the data twice: the first time to
 estimate the spatial autocorrelation of the data and the second to make
 the predictions.

 From ESRI's How GWR Works
 (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005p003100)...
 GWR provides a local model of the variable or process you are trying
 to understand/predict by fitting a regression equation to every feature
 in the dataset. GWR constructs these separate equations by
 incorporating the dependent and explanatory variables of features
 falling within the bandwidth of each target feature.

 Thus, kriging fits a model based on the paired distances then applies
 that to predict an entire surface of a single z-value (variable). I
 think consensus among geostatisticians says that kriging is the best for
 spatial prediction of a single variable. GWR permits a whole set of
 explanatory variables to be analyzed and included in a spatially
 weighted regression model unique to each feature.  I think this
 technique more suited for exploring how a complete set of independent
 variables varies in its explanatory power across the spaces analyzed.

OK with regard to kriging; ESRI's help page for GWR does not refer to:

Paez A, Farber S, Wheeler D, 2011, A simulation-based study of
geographically weighted regression as a method for investigating spatially
varying relationships, Environment and Planning A 43(12) 2992-3010

which spgwr::gwr does refer to. Until you have read and understood this
article, never even consider using GWR, irrespective of what ESRI or the
authors of GWR say. Not only are there local collinearity (mentioned by
ESRI) problems, but GWR creates patterns in local for random input data,
see the gwr() examples. Use, if at all, very carefully.

Hope this helps,

Roger


 I hope this is useful.  I am by no means an authority on this and will
 keep a close eye on this thread.

 Chao, mike




 -Original Message-
 From: r-sig-geo-boun...@r-project.org 
 [mailto:r-sig-geo-boun...@r-project.org] On Behalf Of Hodgess, Erin
 Sent: Wednesday, March 05, 2014 3:03 PM
 To: r-sig-geo@r-project.org
 Subject: [R-sig-Geo] a comparison question

 Hello everyone:

 Here is a comparison question, please:  is kriging better than GWR, please?  
 Or are they even comparable, please?

 Thanks,
 Erin


   [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: roger.biv...@nhh.no


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a comparison question

2014-03-05 Thread Hodgess, Erin
 Hello everyone:

Here is a comparison question, please:  is kriging better than GWR, please?  Or 
are they even comparable, please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] question about STFDF time component

2014-02-17 Thread Hodgess, Erin
Hello!

Here is some code that I'm working on: part of a larger project

cat(ready to krige\n)
st.u - krigeST(index.index~1,w,newdata=pred.grd,modelList=stv)
print(str(st.u))
plotKML(st.u,var1.pred)



And here is the output:


ready to krige
Formal class 'STFDF' [package spacetime] with 4 slots
  ..@ data   :'data.frame':9075 obs. of  1 variable:
  .. ..$ var1.pred: num [1:9075] 104 104 103 103 103 ...
  ..@ sp :Formal class 'SpatialPixels' [package sp] with 5 slots
  .. .. ..@ grid   :Formal class 'GridTopology' [package sp] with 3 slots
  .. .. .. .. ..@ cellcentre.offset: Named num [1:2] -106 26
  .. .. .. .. .. ..- attr(*, names)= chr [1:2] x1 x2
  .. .. .. .. ..@ cellsize : Named num [1:2] 0.38 0.38
  .. .. .. .. .. ..- attr(*, names)= chr [1:2] x1 x2
  .. .. .. .. ..@ cells.dim: Named int [1:2] 33 25
  .. .. .. .. .. ..- attr(*, names)= chr [1:2] x1 x2
  .. .. ..@ grid.index : int [1:825] 793 794 795 796 797 798 799 800 801 802 ...
  .. .. ..@ coords : num [1:825, 1:2] -106 -106 -106 -105 -105 ...
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : NULL
  .. .. .. .. ..$ : chr [1:2] x1 x2
  .. .. ..@ bbox   : num [1:2, 1:2] -106.7 25.8 -94.1 35.3
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : chr [1:2] x1 x2
  .. .. .. .. ..$ : chr [1:2] min max
  .. .. ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. .. .. ..@ projargs: chr +proj=longlat +datum=WGS84 +ellps=WGS84 
+towgs84=0,0,0
  ..@ time   :An ‘xts’ object on 2001-01-01/2011-01-01 containing:
  Data: int [1:11, 1] 1 2 3 4 5 6 7 8 9 10 ...
 - attr(*, dimnames)=List of 2
  ..$ : NULL
  ..$ : chr timeIndex
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:
 NULL
  ..@ endTime: POSIXct[1:11], format: 2002-01-01 2003-01-01 ...
NULL
Plotting the first variable on the list
KML file opened for writing...
Temporal support not indicated... using 'dtime=0'.
Writing to KML...
Closing  var1.pred.kml
sh: 1: gnome-open: not found


My question is:  why am I getting the dtime=0 message when I have values for 
@time and @endTime?

Is it because one is xts and the other is POSIX, please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] another krigeST question

2014-02-17 Thread Hodgess, Erin
Hi again:

Now I'm getting the following:


Warning message:
In krigeST(index.index ~ 1, w, newdata = pred.grd, modelList = stv) :
  The spatio-temporal variogram model does not carry a time unit attribute: 
krisgeST cannot check whether the temporal distance metrics coincide.



Here is the code to generate the model:
stv - vgmST(sumMetric,
space=vgm(spsil1,smod1,sran1),
time=vgm(epsil1,emod1,eran1),
joint=vgm(60,Exp,100),
stAni=20)

Any help much appreciated.

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a goofy question

2014-02-16 Thread Hodgess, Erin
Hi!

I have a data frame and I'm passing the column names and the df name itself 
into the function.  Here is my code:


 str(coal2)
'data.frame':5006 obs. of  5 variables:
 $ x1: num  3.99 4.2 4.41 4.62 4.83 ...
 $ x2: num  1.13 1.13 1.13 1.13 1.13 ...
 $ var1.pred : num  9.91 9.87 9.83 9.79 9.77 ...
 $ var1.var  : num  1.26 1.25 1.25 1.25 1.24 ...
 $ var1.stdev: num  1.12 1.12 1.12 1.12 1.11 ...
 buzz
function(x,y,u) {
coordinates(u) - ~x+y
print(str(u))
}
 buzz(x=coal2$x1,y=coal2$x2,u=coal2)


Shouldn't I get a print statement, please?

Thanks,
Erin



[[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] a goofy question

2014-02-16 Thread Hodgess, Erin
That's exactly perfect!  I've been working on this dumb thing all afternoon!  
Thanks SO much!

Erin

From: Michael Sumner [mdsum...@gmail.com]
Sent: Sunday, February 16, 2014 6:53 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] a goofy question

Well, with a reproducible example this is what I (expect and) get:

coal2 - data.frame(x1 = rnorm(10), y1 = rnorm(10), var1.pred = 10)
library(sp)
buzz - function(x, y, u) {coordinates(u) - ~x+y; print(str(u))}
buzz(x=coal2$x1,y=coal2$y1,u=coal2)
Error in `[.data.frame`(object, , -coord.numbers, drop = FALSE) :
  undefined columns selected


I'm not sure the formula method for coordinates- is the best idea
here, try with the actual names (and think about what ~x+y is vs.
coal2$x1 and coal2$x2):

buzz - function(x, y, u) {coordinates(u) - c(x, y); print(str(u))}
buzz(x1, y1, coal2)

Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots
  ..@ data   :'data.frame': 10 obs. of  1 variable:
  .. ..$ var1.pred: num [1:10] 10 10 10 10 10 10 10 10 10 10
  ..@ coords.nrs : int [1:2] 1 2
  ..@ coords : num [1:10, 1:2] -1.112 -0.933 0.485 -0.104 -0.369 ...
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] x1 y1
  ..@ bbox   : num [1:2, 1:2] -2.08 -1.15 3.19 2.04
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : chr [1:2] x1 y1
  .. .. ..$ : chr [1:2] min max
  ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. ..@ projargs: chr NA
NULL


HTH


On Mon, Feb 17, 2014 at 11:36 AM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hi!

 I have a data frame and I'm passing the column names and the df name itself 
 into the function.  Here is my code:


 str(coal2)
 'data.frame':5006 obs. of  5 variables:
  $ x1: num  3.99 4.2 4.41 4.62 4.83 ...
  $ x2: num  1.13 1.13 1.13 1.13 1.13 ...
  $ var1.pred : num  9.91 9.87 9.83 9.79 9.77 ...
  $ var1.var  : num  1.26 1.25 1.25 1.25 1.24 ...
  $ var1.stdev: num  1.12 1.12 1.12 1.12 1.11 ...
 buzz
 function(x,y,u) {
 coordinates(u) - ~x+y
 print(str(u))
 }
 buzz(x=coal2$x1,y=coal2$x2,u=coal2)


 Shouldn't I get a print statement, please?

 Thanks,
 Erin



 [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
Michael Sumner
Hobart, Australia
e-mail: mdsum...@gmail.com

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] question about unique in lon/lat

2014-02-15 Thread Hodgess, Erin
Hello!

I have space-time data frame.  Here are the first few rows:

  name   indexlon  lat
1   Abilene,TX  95.285  -99.73314 32.44874
2   Abilene,TX  98.603  -99.73314 32.44874
3   Abilene,TX 100.197  -99.73314 32.44874
4   Abilene,TX 102.016  -99.73314 32.44874
5   Abilene,TX 100.000  -99.73314 32.44874
6   Abilene,TX 102.822  -99.73314 32.44874
7   Abilene,TX 107.988  -99.73314 32.44874
8   Abilene,TX 110.546  -99.73314 32.44874
9   Abilene,TX 105.897  -99.73314 32.44874
10  Abilene,TX 107.642  -99.73314 32.44874
11  Abilene,TX 108.523  -99.73314 32.44874
12 Amarillo,TX  92.486 -101.83130 35.22200
13 Amarillo,TX  95.431 -101.83130 35.22200
14 Amarillo,TX  97.485 -101.83130 35.22200
15 Amarillo,TX  99.714 -101.83130 35.22200
16 Amarillo,TX 100.000 -101.83130 35.22200
17 Amarillo,TX 103.649 -101.83130 35.22200
18 Amarillo,TX 105.998 -101.83130 35.22200
19 Amarillo,TX 109.965 -101.83130 35.22200
20 Amarillo,TX 109.325 -101.83130 35.22200
21 Amarillo,TX 112.550 -101.83130 35.22200
22 Amarillo,TX 112.541 -101.83130 35.22200
23 Austin  ,TX  83.228  -97.74306 30.26715
24 Austin  ,TX  83.232  -97.74306 30.26715
25 Austin  ,TX  86.072  -97.74306 30.26715
26 Austin  ,TX  93.592  -97.74306 30.26715


My question is:  is there a way to get the unique values from lon/lat for 
each city, please?

Thanks,
Erin


[[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] question about unique in lon/lat

2014-02-15 Thread Hodgess, Erin
Just figured it out:

 unique(cbind(bigz$lon,bigz$lat))

Nothing like posting to the list to help you solve a problem.

thanks,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Hodgess, Erin [hodge...@uhd.edu]
Sent: Saturday, February 15, 2014 8:30 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] question about unique in lon/lat

Hello!

I have space-time data frame.  Here are the first few rows:

  name   indexlon  lat
1   Abilene,TX  95.285  -99.73314 32.44874
2   Abilene,TX  98.603  -99.73314 32.44874
3   Abilene,TX 100.197  -99.73314 32.44874
4   Abilene,TX 102.016  -99.73314 32.44874
5   Abilene,TX 100.000  -99.73314 32.44874
6   Abilene,TX 102.822  -99.73314 32.44874
7   Abilene,TX 107.988  -99.73314 32.44874
8   Abilene,TX 110.546  -99.73314 32.44874
9   Abilene,TX 105.897  -99.73314 32.44874
10  Abilene,TX 107.642  -99.73314 32.44874
11  Abilene,TX 108.523  -99.73314 32.44874
12 Amarillo,TX  92.486 -101.83130 35.22200
13 Amarillo,TX  95.431 -101.83130 35.22200
14 Amarillo,TX  97.485 -101.83130 35.22200
15 Amarillo,TX  99.714 -101.83130 35.22200
16 Amarillo,TX 100.000 -101.83130 35.22200
17 Amarillo,TX 103.649 -101.83130 35.22200
18 Amarillo,TX 105.998 -101.83130 35.22200
19 Amarillo,TX 109.965 -101.83130 35.22200
20 Amarillo,TX 109.325 -101.83130 35.22200
21 Amarillo,TX 112.550 -101.83130 35.22200
22 Amarillo,TX 112.541 -101.83130 35.22200
23 Austin  ,TX  83.228  -97.74306 30.26715
24 Austin  ,TX  83.232  -97.74306 30.26715
25 Austin  ,TX  86.072  -97.74306 30.26715
26 Austin  ,TX  93.592  -97.74306 30.26715


My question is:  is there a way to get the unique values from lon/lat for 
each city, please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] vgmST question

2014-01-13 Thread Hodgess, Erin
Hello!

What is the best way to learn about the vgmST function, please?

I mean, in the sense of determining the variance parameters for space and time, 
and joint parms.

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] problems with plotting STFDF

2013-12-31 Thread Hodgess, Erin
Hello again!  Happy New Year!

Here is the solution for this particular situation.  Note:  thanks to many 
people for the help.  Anyhow, I started with looking at page 28 in the gstat 
vignette for krigeST.  If you work through that, you obtain an object called 
DE_kriged, which is an STFDF.

I copied some code from the following website:

(https://r-forge.r-project.org/scm/viewvc.php/pkg/R/coerce.R?view=markuproot=spacetime
https://r-forge.r-project.org/scm/viewvc.php/pkg/R/coerce.R?view=markuproot=spacetimepathrev=25)

to get the as.STIDF.STFDF lines:



# STFDF - STIDF
as.STIDF.STFDF = function(from) {
as(as(from, STSDF), STIDF)
}
setAs(STFDF, STIDF, as.STIDF.STFDF)


Now:

  DE1 - as.STIDF.STFDF(DE_kriged)

DE1 is an STIDF object, which is good, but the @sp section is a Spatial Pixels 
object.

Next I copied over the function kml_layer.STIDF to new_STIDF.R and added the 
following section (see the note)

new.STIDF -
function (obj, dtime = , ...)
{
if (all(dtime == 0)) {
TimeSpan.begin = format(time(obj@time), %Y-%m-%dT%H:%M:%SZ)
TimeSpan.end = TimeSpan.begin
}
else {
if (length(obj@time)  1  !nzchar(dtime)) {
print(obj@time)
period - periodicity(obj@time)
dtime - period$frequency
}
TimeSpan.begin - format(as.POSIXct(unclass(as.POSIXct(time(obj@time))) 
-
dtime/2, origin = 1970-01-01), %Y-%m-%dT%H:%M:%SZ)
TimeSpan.end - format(as.POSIXct(unclass(as.POSIXct(time(obj@time))) +
dtime/2, origin = 1970-01-01), %Y-%m-%dT%H:%M:%SZ)
}
if (class(obj@sp) == SpatialPoints | class(obj@sp) == 
SpatialPointsDataFrame) {
sp - SpatialPointsDataFrame(obj@sp, obj@data)
kml_layer.SpatialPoints(obj = sp, TimeSpan.begin = TimeSpan.begin,
TimeSpan.end = TimeSpan.end, ...)
}
else {
if (class(obj@sp) == SpatialPolygons | class(obj@sp) ==
SpatialPolygonsDataFrame) {
sp - SpatialPolygonsDataFrame(obj@sp, obj@data)
kml_layer.SpatialPolygons(obj = sp, TimeSpan.begin = TimeSpan.begin,
TimeSpan.end = TimeSpan.end, ...)
}
else {
if (class(obj@sp) == SpatialLines | class(obj@sp) ==
SpatialLinesDataFrame) {
sp - SpatialLinesDataFrame(obj@sp, obj@data)
kml_layer.SpatialLines(obj = sp, TimeSpan.begin = 
TimeSpan.begin,
  TimeSpan.end = TimeSpan.end, ...)
}

###
#  New for Spatial Pixels #
##
else {
if (class(obj@sp) == SpatialPixels | class(obj@sp) ==
SpatialPixelsDataFrame) {
sp - SpatialPixelsDataFrame(obj@sp, obj@data)
kml_layer.SpatialPoints(obj = sp, TimeSpan.begin = 
TimeSpan.begin,
  TimeSpan.end = TimeSpan.end, ...)
}



else {
stop(The STIDF object does not extend SpatialPoints*, 
SpatialLines* or SpatialPolygons*)
}
}
}
}
}

Finally, I ran this:
 library(plotKML)
plotKML version 0.4-0 (2013-11-15)
URL: http://plotkml.r-forge.r-project.org/
Warning message:
replacing previous import by ‘zoo::as.zoo’ when loading ‘gstat’
 library(gstat)
Loading required package: sp
 kml_open(stuff2.kml)
KML file opened for writing...
 new.STIDF(DE1,dtime=24*3600,colour=var1.pred)
Parsing to KML...
 kml_close(stuff2.kml)
Closing  stuff2.kml


All is well.  Google Earth lets you run the kml file and show the time change, 
as it should.

Hope this might help someone!

Thanks,
Erin







[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a space-time question

2013-12-31 Thread Hodgess, Erin
Hello yet again.

Here is a question that I'm about 99.9% sure that the answer is no, but here 
goes:  is there a sort of autoKrige for spacetime objects, please?

Thanks!

Sincerely,
Erin


[[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] problems with plotting STFDF

2013-12-29 Thread Hodgess, Erin
I had tried x - as(x, STIDF)
but it didn't like that.


Thanks!

Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Tomislav Hengl [he...@spatial-analyst.net]
Sent: Sunday, December 29, 2013 12:12 PM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] problems with plotting STFDF

Hi Erin,

In the spacetime package there should be a function that allows you to
coerce from STFDF to STIDF class e.g. as.STIDF.STFDF
(https://r-forge.r-project.org/scm/viewvc.php/pkg/R/coerce.R?view=markuproot=spacetime
https://r-forge.r-project.org/scm/viewvc.php/pkg/R/coerce.R?view=markuproot=spacetimepathrev=25).
Once your object is of STIDF class, then you can use kml function e.g.
in a loop:

x - as.STIDF.STFDF(x)
kml_open(x.kml)
kml_layer(x, colour=var1.pred)
kml_close(x.kml)

I might add plotting support for STFDF objects in the future. At the
moment I do not see a special reason for this because STFDF is basically
a 'compressed' / special case of STIDF, which hence needs to be
'decompressed' anyway before you can write it to KML (classes in the
spacetime package are hence more creative than in the KML, but then the
beauty of KML is that it is rather simple while the compression is
implemented usually through zipping / KMZ).

HTH

T. Hengl
https://www.vcard.wur.nl/Views/Profile/View.aspx?id=37263


On 29-12-2013 16:55, Edzer Pebesma wrote:

 On 12/28/2013 10:02 AM, Barry Rowlingson wrote:
 On Sat, Dec 28, 2013 at 2:57 AM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hello everyone!

 Hope you're enjoying some holiday time!

 I'm running into a little snag here.  I'm working through the example on 
 krigeST, which produces an STFDF object.  Fine so far.

 However, I would like to produce a Google Earth object from that.

 When I use plotKML, I get:

 plotKML(DE_kriged,var1.pred)
 Error in (function (classes, fdef, mtable)  :
unable to find an inherited method  for function ‘plotKML’ for signature 
 ‘STFDF’
 Or when I use kml, I get:

 kml(DE_kriged,var1.pred)
 Error in (function (classes, fdef, mtable)  :
unable to find an inherited method for function ‘kml’ for signature 
 ‘STFDF’
 What should I be doing, please?
   The functions are essentially saying I don't know what to do with an
 STFDF object. Is there any documentation that says these functions
 can do something sensible with STFDF data? Maybe the code is yet to be
 written...

 Barry

 library(plotKML)
 showMethods(plotKML)

 and also ?plotKML confirm what Barry just suggested.


 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] problems with plotting STFDF

2013-12-27 Thread Hodgess, Erin
Hello everyone!

Hope you're enjoying some holiday time!

I'm running into a little snag here.  I'm working through the example on 
krigeST, which produces an STFDF object.  Fine so far.

However, I would like to produce a Google Earth object from that.

When I use plotKML, I get:

 plotKML(DE_kriged,var1.pred)
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method  for function ‘plotKML’ for signature 
‘STFDF’


Or when I use kml, I get:

 kml(DE_kriged,var1.pred)
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘kml’ for signature ‘STFDF’


What should I be doing, please?

Thanks in advance,
Sincerely,
Erin






[[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] a projection question

2013-12-22 Thread Hodgess, Erin
Great!  This is so cool!

Thanks!


From: b.rowling...@gmail.com [b.rowling...@gmail.com] on behalf of Barry 
Rowlingson [b.rowling...@lancaster.ac.uk]
Sent: Sunday, December 22, 2013 4:16 AM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] a projection question

First thought is to try and project a sample point and catch any error
messages, but you can't be sure that your sample point is valid in the
given coordinate system.

Second thought was to look at the proj4 and rgdal packages to see if
they implemented checking of PROJ.4 strings. Couldn't see it.

So third thought was to look at the PROJ.4 API and see what its got:

http://trac.osgeo.org/proj/wiki/pj_init_plus

which is a C function to initialise a projection. So I wrote a little wrapper:

#include proj_api.h

void ptest(char *proj[], int *status){
  projPJ out;
  if(!(out = pj_init_plus(proj[0]))){
*status = 1;
  }else{
*status = 0;
   /* need to pj_free the out object here... I think... */
  }
}

with an R wrapper: isValidProjection -
function(s){.C(ptest,s,status=as.integer(-1))$status==0}

compiled it, linked with libproj.so and tested it:


 isValidProjection(+init=epsg:4326)
[1] TRUE

- user typo:

 isValidProjection(+init=apsg:4326)
[1] FALSE

- try more than +init strings:

 isValidProjection(+proj=tmerc +lon_0 +datum=WGS84)
[1] TRUE

- some bogus EPSG codes:

 isValidProjection(+init=epsg:4326999)
[1] FALSE
 isValidProjection(+init=epsg:-1)
[1] FALSE

Looks like it works. The tricky part of all this is linking the C code
with libproj.so which I did by doing:

R CMD SHLIB projtest.c /usr/lib/libproj.so

on the command line. Might work for you, but it might be worth asking
Roger, as maintainer or rgdal, or Smon Urbanek as maintainer of
project, to add it as a top-level R function.

 Maybe I'll check out the rgdal source and push a change for Roger...

Barry




On Sat, Dec 21, 2013 at 10:19 PM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hello everyone:

 I'm setting up a function in which the user enters the projection (as part of 
 other stuff).

 What is the best way to determine if the entered projection is correct, 
 please? (so I can send back an error message right away).

 Thanks,
 Erin


 [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a projection question

2013-12-21 Thread Hodgess, Erin
Hello everyone:

I'm setting up a function in which the user enters the projection (as part of 
other stuff).

What is the best way to determine if the entered projection is correct, please? 
(so I can send back an error message right away).

Thanks,
Erin


[[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] another covariance matrix question

2013-12-08 Thread Hodgess, Erin
Eeek!  I can't believe it.  Thanks so much!


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Edzer Pebesma [edzer.pebe...@uni-muenster.de]
Sent: Sunday, December 08, 2013 2:16 PM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] another covariance matrix question

On 12/07/2013 08:18 PM, Hodgess, Erin wrote:
 Hi again.

 I have a question about covariance matrices (again)

 Suppose we have an exponential model with c=2 and a=3.

 Then for

 c_{ij} = c exp(-h_{ij}/a),
 when i=j,
 we should have:
 c_{ii} = 2 exp(0) = 2

 But shouldn't c_{ii} = 1, please?

No, the covariance matrix has variances on the diagional, the
correlation matrix has 1 on the diagonal.


 Thanks,
 Erin


   [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] covariance matrix

2013-12-05 Thread Hodgess, Erin
Thanks to all for the good help...it's great!

Sincerely,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Edzer Pebesma [edzer.pebe...@uni-muenster.de]
Sent: Thursday, December 05, 2013 2:56 AM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] covariance matrix

Erin,

http://ifgi.uni-muenster.de/~epebe_01/mstp/lec5.html
http://ifgi.uni-muenster.de/~epebe_01/mstp/lec7.html

contain some minimal, one-dimensional kriging functions that I used in
my class recently.

R markdown source files are on https://github.com/edzer/mstp

On 12/05/2013 04:36 AM, Hodgess, Erin wrote:
 Hi!

 Here is a goofy question, please:  how do I get the covariance matrix based 
 on the estimated model, say exponential, please?

 I was looking at the variogram function in gstat and I think that the gamma 
 values may be part of the solution, but I'm not sure how to finish it out.

 I'm experimenting with putting together a toy data set through the variogram 
 and kriging process by hand (to a certain extent)

 Thanks for any help!
 Sincerely,
 Erin


   [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] covariance matrix

2013-12-04 Thread Hodgess, Erin
Hi!

Here is a goofy question, please:  how do I get the covariance matrix based on 
the estimated model, say exponential, please?

I was looking at the variogram function in gstat and I think that the gamma 
values may be part of the solution, but I'm not sure how to finish it out.

I'm experimenting with putting together a toy data set through the variogram 
and kriging process by hand (to a certain extent)

Thanks for any help!
Sincerely,
Erin


[[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] back with cutoff/variogram question

2013-11-24 Thread Hodgess, Erin
Hi!

This is from the gstat variogram.

I tried to track this down via the vario.c function, but I'm having some 
trouble with it.


From: b.rowling...@gmail.com [b.rowling...@gmail.com] on behalf of Barry 
Rowlingson [b.rowling...@lancaster.ac.uk]
Sent: Sunday, November 24, 2013 3:08 AM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] back with cutoff/variogram question

On Sun, Nov 24, 2013 at 5:46 AM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hello again.

 I'm back with the variogram question.  Here is the info from the help file:

   cutoff: spatial separation distance up to which point pairs are
   included in semivariance estimates; as a default, the length
   of the diagonal of the box spanning the data is divided by
   three.

 By the box spanning the data, does that mean the bounding box, please?  If 
 so, wouldn't that just be 2, please?

 There's quite a few 'variogram' functions in various R packages so it
might help if you told us which one!

 I should think that the box spanning the data is indeed the
bounding box. I don't see what you think would be '2' in this case
though, unless the diagonal length of the bounding box happened to be
6.

 For data that included points at (0,0) and (1,1) the diagonal would
have length sqrt(2) and so the cutoff default should be sqrt(2)/3.
Note you have to actually have points at those coordinates and not
just generate 1000 random points in the unit square.

 A few simple experiments with simulated point data sets with various
bounding boxes should confirm this, or you could just look at the
code?

Barry

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] back with cutoff/variogram question

2013-11-24 Thread Hodgess, Erin
This is perfect!  Thank you!

From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Edzer Pebesma [edzer.pebe...@uni-muenster.de]
Sent: Sunday, November 24, 2013 12:39 PM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] back with cutoff/variogram question

Erin, it is in

https://r-forge.r-project.org/scm/viewvc.php/pkg/src/sem.c?view=markuproot=gstat

file sem.c, line 692

defaults.h defines:

#define DEF_fraction0.3 /* fraction of max_dist for def. cutoff */

which is the default value for gl_fraction.

The default number of lag classes is 15 (gl_n_intervals). You can change
these defaults to e.g. 0.5 and 25 by:

variogram(gstat(NULL, zinc, zinc~1, meuse,
set=list(fraction=.5,intervals=25)))


On 11/24/2013 04:53 PM, Hodgess, Erin wrote:
 Hi!

 This is from the gstat variogram.

 I tried to track this down via the vario.c function, but I'm having some 
 trouble with it.

 
 From: b.rowling...@gmail.com [b.rowling...@gmail.com] on behalf of Barry 
 Rowlingson [b.rowling...@lancaster.ac.uk]
 Sent: Sunday, November 24, 2013 3:08 AM
 To: Hodgess, Erin
 Cc: r-sig-geo@r-project.org
 Subject: Re: [R-sig-Geo] back with cutoff/variogram question

 On Sun, Nov 24, 2013 at 5:46 AM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hello again.

 I'm back with the variogram question.  Here is the info from the help file:

   cutoff: spatial separation distance up to which point pairs are
   included in semivariance estimates; as a default, the length
   of the diagonal of the box spanning the data is divided by
   three.

 By the box spanning the data, does that mean the bounding box, please?  If 
 so, wouldn't that just be 2, please?

  There's quite a few 'variogram' functions in various R packages so it
 might help if you told us which one!

  I should think that the box spanning the data is indeed the
 bounding box. I don't see what you think would be '2' in this case
 though, unless the diagonal length of the bounding box happened to be
 6.

  For data that included points at (0,0) and (1,1) the diagonal would
 have length sqrt(2) and so the cutoff default should be sqrt(2)/3.
 Note you have to actually have points at those coordinates and not
 just generate 1000 random points in the unit square.

  A few simple experiments with simulated point data sets with various
 bounding boxes should confirm this, or you could just look at the
 code?

 Barry

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] variogram cutoff question

2013-11-23 Thread Hodgess, Erin
Hello everyone!

I have a quick question, please:  in the variogram function, how is the cutoff 
determined if it is not specified, please?

Thanks so much!

Sincerely,
Erin


[[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] variogram cutoff question

2013-11-23 Thread Hodgess, Erin
Please ignore the previousjust saw the help file.  It's right there.

Sorry for the trouble.


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Hodgess, Erin [hodge...@uhd.edu]
Sent: Saturday, November 23, 2013 9:54 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] variogram cutoff question

Hello everyone!

I have a quick question, please:  in the variogram function, how is the cutoff 
determined if it is not specified, please?

Thanks so much!

Sincerely,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
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
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-sig-Geo] function to convert to/from U.S. State Plane   
Coordinates?

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

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
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
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] function to convert to/from U.S. State Plane 
Coordinates?

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', 'oregon', 'idaho'), 
 plot=F) epsg - make_EPSG()
Error in make_EPSG() : Error opening epsg file
 pnw.spc - spTransform(pnw, CRS=CRS(+init=epsg:102749))
Error in spTransform(pnw, CRS = CRS(+init=epsg:102749)) :
  error in evaluating the argument 'CRSobj' in selecting a method for function 
'spTransform': Error in CRS(+init=epsg:102749) : no system list, errno: 13

--Scott

 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?
 
 On 17 September 2013 00:09, Waichler, Scott R 
 scott.waich...@pnnl.gov
 wrote:
 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?
 
  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.

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
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
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, 2013 7:10 PM
To: Hodgess, Erin; Rob Robinson
Cc: r-sig-geo@r-project.org
Subject: RE: [R-sig-Geo] function to convert to/from U.S. State Plane 
Coordinates?

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.84 +lat_2=47.34 
 +lat_0=45.34 +lon_0=-120.5 +x_0=50.02 +y_0=0 
 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs))
Error in spTransform(pnw, CRS = CRS(+proj=lcc +lat_1=45.84 
+lat_2=47.34 +lat_0=45.34 +lon_0=-120.5 
+x_0=50.02 +y_0=0 +ellps=GRS80 +datum=NAD83 
+to_meter=0.3048006096012192 +no_defs)) :
  load package rgdal for spTransform methods

 
 Are you in Windows or a Linux type computer, please?
 
 
 
 -Original Message-
 From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-bounces@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] function to convert to/from U.S. State Plane 
 Coordinates?
 
 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', 'oregon', 'idaho'),
  plot=F) epsg - make_EPSG()
 Error in make_EPSG() : Error opening epsg file
  pnw.spc - spTransform(pnw, CRS=CRS(+init=epsg:102749))
 Error in spTransform(pnw, CRS = CRS(+init=epsg:102749)) :
   error in evaluating the argument 'CRSobj' in selecting a method for 
 function 'spTransform': Error in CRS(+init=epsg:102749) : no system 
 list, errno: 13
 
 --Scott
 
  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?
 
  On 17 September 2013 00:09, Waichler, Scott R 
  scott.waich...@pnnl.gov
  wrote:
  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?
  
   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.
 
 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
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
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 convert to/from U.S. State Plane 
Coordinates?

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, 2013 7:10 PM
To: Hodgess, Erin; Rob Robinson
Cc: r-sig-geo@r-project.org
Subject: RE: [R-sig-Geo] function to convert to/from U.S. State Plane 
Coordinates?

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.84 +lat_2=47.34
 +lat_0=45.34 +lon_0=-120.5 +x_0=50.02 +y_0=0
 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs))
Error in spTransform(pnw, CRS = CRS(+proj=lcc +lat_1=45.84 
+lat_2=47.34 +lat_0=45.34 +lon_0=-120.5 
+x_0=50.02 +y_0=0 +ellps=GRS80 +datum=NAD83 
+to_meter=0.3048006096012192 +no_defs)) :
  load package rgdal for spTransform methods

 
 Are you in Windows or a Linux type computer, please?
 
 
 
 -Original Message-
 From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-bounces@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] function to convert to/from U.S. State Plane 
 Coordinates?
 
 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', 'oregon', 'idaho'),
  plot=F) epsg - make_EPSG()
 Error in make_EPSG() : Error opening epsg file
  pnw.spc - spTransform(pnw, CRS=CRS(+init=epsg:102749))
 Error in spTransform(pnw, CRS = CRS(+init=epsg:102749)) :
   error in evaluating the argument 'CRSobj' in selecting a method for 
 function 'spTransform': Error in CRS(+init=epsg:102749) : no system 
 list, errno: 13
 
 --Scott
 
  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?
 
  On 17 September 2013 00:09, Waichler, Scott R 
  scott.waich...@pnnl.gov
  wrote:
  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?
  
   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.
 
 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
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)
pnw2 - spTransform(pnw1,CRS())




-Original Message-
From: Waichler, Scott R [mailto:scott.waich...@pnnl.gov] 
Sent: Monday, September 16, 2013 7:19 PM
To: Hodgess, Erin; Rob Robinson
Cc: r-sig-geo@r-project.org
Subject: RE: [R-sig-Geo] function to convert to/from U.S. State Plane 
Coordinates?

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(*, class)= chr map

So, it sounds like there is extra proj4 stuff that I need to install beyond the 
base installation I already did, which also enabled installation of rgdal? 

Scott

 -Original Message-
 From: Hodgess, Erin [mailto:hodge...@uhd.edu]
 Sent: Monday, September 16, 2013 5:12 PM
 To: Waichler, Scott R; Rob Robinson
 Cc: r-sig-geo@r-project.org
 Subject: RE: [R-sig-Geo] function to convert to/from U.S. State Plane 
 Coordinates?
 
 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, 2013 7:10 PM
 To: Hodgess, Erin; Rob Robinson
 Cc: r-sig-geo@r-project.org
 Subject: RE: [R-sig-Geo] function to convert to/from U.S. State Plane 
 Coordinates?
 
 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.84 +lat_2=47.34
  +lat_0=45.34 +lon_0=-120.5 +x_0=50.02 +y_0=0
  +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs))
 Error in spTransform(pnw, CRS = CRS(+proj=lcc 
 +lat_1=45.84
 +lat_2=47.34 +lat_0=45.34 +lon_0=-120.5
 +x_0=50.02 +y_0=0 +ellps=GRS80 +datum=NAD83
 +to_meter=0.3048006096012192 +no_defs)) :
   load package rgdal for spTransform methods
 
 
  Are you in Windows or a Linux type computer, please?
 
 
 
  -Original Message-
  From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-bounces@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] function to convert to/from U.S. State 
  Plane Coordinates?
 
  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', 'oregon', 'idaho'),
   plot=F) epsg - make_EPSG()
  Error in make_EPSG() : Error opening epsg file
   pnw.spc - spTransform(pnw, CRS=CRS(+init=epsg:102749))
  Error in spTransform(pnw, CRS = CRS(+init=epsg:102749)) :
error in evaluating the argument 'CRSobj' in selecting a method 
  for function 'spTransform': Error in CRS(+init=epsg:102749) : no 
  system list, errno: 13
 
  --Scott
 
   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?
  
   On 17 September 2013 00:09, Waichler, Scott R 
   scott.waich...@pnnl.gov
   wrote:
   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?
   
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.
 
  ___
  R-sig-Geo mailing list
  R-sig-Geo@r-project.org
  https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] out-of-bounds error

2013-08-14 Thread Hodgess, Erin
Hello Geo-Rs!

I'm using the latest version of gstat and spacetime.  I'm trying to fit a 
variogramST, but I get the following:

  city1b.st - 
 STFDF(sp=tempb,time=liltime,data=data.frame(index=city1b.df$index))

 str(city1b.st)
Formal class 'STFDF' [package spacetime] with 4 slots
  ..@ data   :'data.frame': 253 obs. of  1 variable:
  .. ..$ index: num [1:253] 95.3 92.5 83.2 89.8 92 ...
  ..@ sp :Formal class 'SpatialPoints' [package sp] with 3 slots
  .. .. ..@ coords : num [1:23, 1:2] 1525044 1333239 1716737 2064910 
1751258 ...
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : NULL
  .. .. .. .. ..$ : chr [1:2] lon lat
  .. .. ..@ bbox   : num [1:2, 1:2] 887073 6868534 2064910 7901351
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : chr [1:2] lon lat
  .. .. .. .. ..$ : chr [1:2] min max
  .. .. ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. .. .. ..@ projargs: chr +proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 
+lon_0=-100 +x_0=150 +y_0=600 +ellps=GRS80 +datum=NAD83 +units=m 
+no_defs +to| __truncated__
  ..@ time   :An ‘xts’ object on 2001-01-01/2011-01-01 containing:
  Data: int [1:11, 1] 1 2 3 4 5 6 7 8 9 10 ...
 - attr(*, dimnames)=List of 2
  ..$ : NULL
  ..$ : chr timeIndex
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:
 NULL
  ..@ endTime: POSIXct[1:11], format: 2002-01-01 2003-01-01 ...
  vv - variogramST(index~1,city1b.st)

  |
  |  |   0%
  |
  |  |   6%
  |
  |= |  12%
  |
  |= |  19%
  |
  |==|  25%
  |
  |==|  31%
  |
  |==|  38%
  |
  |===   |  44%
  |
  |===   |  50%
  |
  |===   |  56%
  |
  |  |  62%
  |
  |  |  
69%Error in `[.xts`(x@time, j) : subscript out of bounds
In addition: Warning message:
In variogramST(index ~ 1, city1b.st) :
  strictly irregular time steps were assumed to be regular

Does this look familiar, please?

Thanks for any help.

Sincerely,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] Google Earth files on an iPad

2013-07-21 Thread Hodgess, Erin
Hi Geo People:

I have a quick question, please:  what is the best way to transfer a KML file 
from my computer to my iPad, please?

I want to show the file on Google Earth on the iPad.

Thanks,
Erin


[[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] Google Earth files on an iPad

2013-07-21 Thread Hodgess, Erin
I thought since we produce kml files for maps then perhaps someone may have 
done it


From: Michael Sumner [mdsum...@gmail.com]
Sent: Sunday, July 21, 2013 7:07 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] Google Earth files on an iPad

I would consult the manual for the iPad device. I don't see the
relevance of this question to this mailing list.

Cheers, Mike.

On Mon, Jul 22, 2013 at 8:43 AM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hi Geo People:

 I have a quick question, please:  what is the best way to transfer a KML file 
 from my computer to my iPad, please?

 I want to show the file on Google Earth on the iPad.

 Thanks,
 Erin


 [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
Michael Sumner
Hobart, Australia
e-mail: mdsum...@gmail.com

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] Plotting together Lucas County observations and map

2013-07-15 Thread Hodgess, Erin
Hi!

Use spTransform to get the spdep data into long/lat


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of ROMAN MINGUEZ SALIDO [roman.ming...@uclm.es]
Sent: Monday, July 15, 2013 6:02 AM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Plotting together Lucas County observations and map

Hi everyone:

I would like to plot the observations of housing prices included in the Lucas 
County data of spdep package. The problem is that I want to plot these 
observations in a map of Lucas County. I have found a map of Lucas County in an 
shp polygon file but the spatial coordinates are in longitude-latitude and the 
spatial coordinates of the housing data included in spdep are projected like 
CRS(+init=epsg:2834), the Ohio North State Plane. Anyone knows how can I mix 
both files in a single plot?.

Thanks in advance.

Regards,

Román

[[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] Problem Setting Projection of Rasters upon Import

2013-07-11 Thread Hodgess, Erin
Hi Michael:

Did you try this;

test-raster(us_ppt_1981_2010.02.asc, crs=+ellps=GRS80)

with the plus sign, please?

That might do it.

Thanks,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Michael Treglia [mtreg...@gmail.com]
Sent: Thursday, July 11, 2013 7:16 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Problem Setting Projection of Rasters upon Import

Hi All,

I am using he raster package, and in particular the raster function. I
am dealing with a number of layers, and it would be easiest to set the CRS
upon import. Looking through the documentation, it seems that it is doable,
and I have been using the following code to get started, though it is not
setting the CRS.

Here are my code, and the results of the import:
 test-raster(us_ppt_1981_2010.02.asc, crs=ellps=GRS80)
 test
class   : RasterLayer
dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
resolution  : 0.00833, 0.00833  (x, y)
extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin,
ymax)
*coord. ref. : NA *
data source : D:\GIS\PRISM\1981-2010\PPT\us_ppt_1981_2010.02.asc
names   : us_ppt_1981_2010.02
values  : -2147483648, 2147483647  (min, max)

If I use the projection command afterwards, it sets the projection
appropriately though.
 projection(test)-CRS(+proj=longlat +ellps=GRS80)
 test
class   : RasterLayer
dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
resolution  : 0.00833, 0.00833  (x, y)
extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin,
ymax)
*coord. ref. : +proj=longlat +ellps=GRS80 *
data source : D:\GIS\PRISM\1981-2010\PPT\us_ppt_1981_2010.02.asc
names   : us_ppt_1981_2010.02
values  : -2147483648, 2147483647  (min, max)

Any suggestions of why the first option is not working? I have a script in
which I import all files in a folder, and the simplest way to assign the
projection would be the first option (I'm using an 'lapply' command).
It would look something like this:
import - lapply(filenames ,raster, crs=) #where filenames is a
vector of filenames in the working directory.

In case it helps, these are PRISM Climate Data, and the header of my raster
file is this:
ncols 7025
nrows 3105
xllcorner -125.0208329
yllcorner 24.0625000
cellsize 0.008
NODATA_value -

Thanks for any suggestions!
Mike

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] Problem Setting Projection of Rasters upon Import

2013-07-11 Thread Hodgess, Erin
Hi again.

It looks like the crs argument no longer works when creating a raster from a 
file.  I've tried all kinds of variations on the theme also, but no luck.

Weird.

Thanks
Erin


From: Michael Treglia [mtreg...@gmail.com]
Sent: Thursday, July 11, 2013 8:21 PM
To: Michael Sumner
Cc: Hodgess, Erin; r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] Problem Setting Projection of Rasters upon Import

Hi,
I apologize - I must have mistakenly copied/pasted only the last t

Here is how it was run, and the results, in R 3.0.0 (64-bit):
 test-raster(us_ppt_1981_2010.02.asc, crs=+proj=longlat +ellps=GRS80)
 test
class   : RasterLayer
dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
resolution  : 0.00833, 0.00833  (x, y)
extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin, ymax)
coord. ref. : NA
data source : D:\GIS\PRISM\1981-2010\PPT\us_ppt_1981_2010.02.asc
names   : us_ppt_1981_2010.02
values  : -2147483648, 2147483647  (min, max)


and in R 2.13.0 (also 64-bit):
 test-raster(us_ppt_1981_2010.02.asc, crs=+proj=longlat +ellps=GRS80)
 test
class   : RasterLayer
dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
resolution  : 0.00833, 0.00833  (x, y)
extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=GRS80
values  : D:\GIS\PRISM\1981-2010\PPT\us_ppt_1981_2010.02.asc




On Thu, Jul 11, 2013 at 6:13 PM, Michael Sumner 
mdsum...@gmail.commailto:mdsum...@gmail.com wrote:
Please report on the actual code you ran, you've just sent two
messages, one with

test-raster(us_ppt_1981_2010.02.asc, crs=+ellps=GRS80)

this correctly cannot set the CRS and so it is NA

and the other with

t-raster(us_ppt_1981_2010.02.asc, crs=+proj=longlat +ellps=GRS80)
 test

We have no idea what you see in t now. In short you have to have a
+proj, not just a +ellps for this incantation. You can check with

library(rgdal)
CRS(+ellps=GRS80)
Error in CRS(+ellps=GRS80) : projection not named






On Fri, Jul 12, 2013 at 11:10 AM, Michael Treglia 
mtreg...@gmail.commailto:mtreg...@gmail.com wrote:
 I just tried running it in an older version of R, 2.13.0 (64-bit) and it
 ran with no problem... the exact same code run from Notepad++

 Anybody know what has changed/if I need to adjust my for R 3.x.x?

 t-raster(us_ppt_1981_2010.02.asc, crs=+proj=longlat +ellps=GRS80)
 test
 class   : RasterLayer
 dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
 resolution  : 0.00833, 0.00833  (x, y)
 extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin,
 ymax)
 coord. ref. : +proj=longlat +ellps=GRS80
 values  : D:\GIS\PRISM\1981-2010\PPT\us_ppt_1981_2010.02.asc

 Thanks again!
 Mike


 On Thu, Jul 11, 2013 at 5:59 PM, Michael Treglia 
 mtreg...@gmail.commailto:mtreg...@gmail.com wrote:

 Hi Erin,

 Thanks for the quick response - I did try it with the plus sign, and same
 result. (I also tried it with 'crs=+proj=longlat +ellps=GRS80' with the
 same result too.)


   test-raster(us_ppt_1981_2010.02.asc, crs=+ellps=GRS80)
   test
 class   : RasterLayer
 dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
 resolution  : 0.00833, 0.00833  (x, y)
 extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin,
 ymax)
 coord. ref. : NA
 data source : D:\GIS\PRISM\1981-2010\PPT\us_ppt_1981_2010.02.asc
 names   : us_ppt_1981_2010.02
 values  : -2147483648, 2147483647  (min, max)

 I'm running R Version 3.0.0, 64-bit, in case that helps at all...
 Cheers,
 Mike


 On Thu, Jul 11, 2013 at 5:50 PM, Hodgess, Erin 
 hodge...@uhd.edumailto:hodge...@uhd.edu wrote:

 Hi Michael:

 Did you try this;

 test-raster(us_ppt_1981_2010.02.asc, crs=+ellps=GRS80)

 with the plus sign, please?

 That might do it.

 Thanks,
 Erin

 
 From: 
 r-sig-geo-boun...@r-project.orgmailto:r-sig-geo-boun...@r-project.org 
 [r-sig-geo-boun...@r-project.orgmailto:r-sig-geo-boun...@r-project.org]
 on behalf of Michael Treglia [mtreg...@gmail.commailto:mtreg...@gmail.com]
 Sent: Thursday, July 11, 2013 7:16 PM
 To: r-sig-geo@r-project.orgmailto:r-sig-geo@r-project.org
 Subject: [R-sig-Geo] Problem Setting Projection of Rasters upon Import

 Hi All,

 I am using he raster package, and in particular the raster function. I
 am dealing with a number of layers, and it would be easiest to set the CRS
 upon import. Looking through the documentation, it seems that it is
 doable,
 and I have been using the following code to get started, though it is not
 setting the CRS.

 Here are my code, and the results of the import:
  test-raster(us_ppt_1981_2010.02.asc, crs=ellps=GRS80)
  test
 class   : RasterLayer
 dimensions  : 3105, 7025, 21812625  (nrow, ncol, ncell)
 resolution  : 0.00833, 0.00833  (x, y)
 extent  : -125.0208, -66.47917, 24.0625, 49.9375  (xmin, xmax, ymin,
 ymax)
 *coord. ref. : NA *
 data source : D:\GIS

Re: [R-sig-Geo] Question about LM test for residual autocorrelation in R

2013-07-09 Thread Hodgess, Erin
Hi Dongwoo:

I tried the following example:

 erin1 - summary(COL.mix.eig, correlation=TRUE, Nagelkerke=TRUE)
 names(erin1)
 [1] typerho coefficientsrest.se
 [5] LL  s2  SSE parameters 
 [9] logLik_lm.model AIC_lm.modelmethod  call   
[13] residuals   opt tarXtary   
[17] y   X   fitted.values   se.fit 
[21] similar ase rho.se  LMtest 
[25] resvar  zero.policy aliased listw_style
[29] intervalfdHess  optimHess   insert 
[33] trs LLNullLlm   timings f_calls
[37] hf_callsintern_classic  coeftitle   Coef   
[41] NK  Wald1   correlation correltext 
[45] LR1
 erin1$LMtest
  [,1]
[1,] 0.2891926
 

and it does indeed have the LMtest result.

Or were you looking for the formula, please?

Thanks,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Dongwoo Kang [dwkang1...@gmail.com]
Sent: Tuesday, July 09, 2013 3:47 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Question about LM test for residual autocorrelation in R

Dear list,

Hello, I am Dongwoo Kang. I am studying Spatial Econometric modeling.
I've faced one question while using *spdep* package in R.
 I want to ask your help for my qeustion.

While estimating my empirical models,
I want to test whether residuals of my spatial regression models (SEM, SAR,
SARAR, SDM estimated by maximum likelihood) still have spatial
autocorrelation pattern.

I think I have two options,
1) Moran's I test using *moran.mc* function in R,
2) Lagrange multiplier diagnostics with LMerr option using
*lm.LMtests* function
in R.

But I also find that for SAR, SDM, *summary.sarlm* function returns LM
test for residual autocorrelation by default.
However, this LM test is not given for SER and SARAR.

At first, I thought that Lagrange multiplier diagnostics and LM test for
residual autocorrelation in *summary.sarlm* function are same tests.
But in my empirical results, they give me different statistics (please see
below example).

- example
---
 summary.sarlm(sar2, Nagelkerke=T)
...
Log likelihood: -3533.378 for lag model
ML residual variance (sigma squared): 224.88, (sigma: 14.996)
Nagelkerke pseudo-R-squared: 0.76166
Number of observations: 853
Number of parameters estimated: 29
AIC: 7124.8, (AIC for lm: 7393.3)
LM test for residual autocorrelation
test value: 6.8391, p-value: 0.0089184


 lm.LMtests(sar2$residuals, listw=w100.listw, test=c(LMerr))

Lagrange multiplier diagnostics for spatial dependence

data:
residuals: sar2$residuals
weights: w100.listw

LMErr = 3.7108, df = 1, p-value = 0.05406
---

I try to find formulation of LM test for residual autocorrelation given
by *summary.sarlm* function but I couldn't.

Would you tell me where I can get some documents or explanations about LM
test for residual autocorrelation given by *summary.sarlm*?

I also want to know why LM test for residual autocorrelation is not
provided in SER and SARAR models.

Thank you very much for your time.

Best regards,

Dongwoo Kang

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] Question about LM test for residual autocorrelation in R

2013-07-09 Thread Hodgess, Erin
Sorry...answered the wrong question

How do you generate the SER models, please?


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Dongwoo Kang [dwkang1...@gmail.com]
Sent: Tuesday, July 09, 2013 3:47 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Question about LM test for residual autocorrelation in R

Dear list,

Hello, I am Dongwoo Kang. I am studying Spatial Econometric modeling.
I've faced one question while using *spdep* package in R.
 I want to ask your help for my qeustion.

While estimating my empirical models,
I want to test whether residuals of my spatial regression models (SEM, SAR,
SARAR, SDM estimated by maximum likelihood) still have spatial
autocorrelation pattern.

I think I have two options,
1) Moran's I test using *moran.mc* function in R,
2) Lagrange multiplier diagnostics with LMerr option using
*lm.LMtests* function
in R.

But I also find that for SAR, SDM, *summary.sarlm* function returns LM
test for residual autocorrelation by default.
However, this LM test is not given for SER and SARAR.

At first, I thought that Lagrange multiplier diagnostics and LM test for
residual autocorrelation in *summary.sarlm* function are same tests.
But in my empirical results, they give me different statistics (please see
below example).

- example
---
 summary.sarlm(sar2, Nagelkerke=T)
...
Log likelihood: -3533.378 for lag model
ML residual variance (sigma squared): 224.88, (sigma: 14.996)
Nagelkerke pseudo-R-squared: 0.76166
Number of observations: 853
Number of parameters estimated: 29
AIC: 7124.8, (AIC for lm: 7393.3)
LM test for residual autocorrelation
test value: 6.8391, p-value: 0.0089184


 lm.LMtests(sar2$residuals, listw=w100.listw, test=c(LMerr))

Lagrange multiplier diagnostics for spatial dependence

data:
residuals: sar2$residuals
weights: w100.listw

LMErr = 3.7108, df = 1, p-value = 0.05406
---

I try to find formulation of LM test for residual autocorrelation given
by *summary.sarlm* function but I couldn't.

Would you tell me where I can get some documents or explanations about LM
test for residual autocorrelation given by *summary.sarlm*?

I also want to know why LM test for residual autocorrelation is not
provided in SER and SARAR models.

Thank you very much for your time.

Best regards,

Dongwoo Kang

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] spatstat output

2013-07-07 Thread Hodgess, Erin
Hello!

For the first question, here is an example:

 E - alltypes(bramblecanes, Kest, nsim = 100, envelope =
+ TRUE,savepatterns=TRUE,correction=isotropic)
 E$fns[[1]]$r
 E$fns[[1]]$obs



From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of catalin roibu [catalinro...@gmail.com]
Sent: Sunday, July 07, 2013 5:12 AM
To: r-sig-...@stat.math.ethz.ch
Cc: r-h...@r-project.org
Subject: [R-sig-Geo] spatstat output

Dear R users,
Is there a possibility to extract only the r, CI's envelope and L function
from the output of spatstat?
I use this code
E - alltypes(df1, Kest, nsim = 100, envelope =
TRUE,savepatterns=TRUE,correction=isotropic)
And second question, is there a possibility to modify the margin of plot in
spatstat?

plot(E, sqrt(./pi) - r ~ r, ylab = L(r)-r,main=NULL,sub=NULL,las=1)

Thank you very much for your help!

CR

--
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
   +4 0766 71 76 58
FAX:+4 0230 52 16 64
silvic.usv.ro

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] pqR ?

2013-06-28 Thread Hodgess, Erin
bSomething interesting with pqR:  I was working through the ASDAR book in 
Chapter 2.  In the accompanying code, one of the chunks said, this takes a 
long time.  I timed it with R-3.0.1 and got 17.28 elapsed time.  In pqR, it 
only took 8.513 in elapsed time.

Not too shabby!

Thanks,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Barry Rowlingson [b.rowling...@lancaster.ac.uk]
Sent: Thursday, June 27, 2013 11:39 AM
To: Boulanger, Yan
Cc: St-Amant, Rémi; r-sig-geo@r-project.org; Guindon,   Luc; Villemaire,
Philippe
Subject: Re: [R-sig-Geo] pqR ?

Step 1 - write some spatial benchmarks.

 I would benchmark: spatial object creation from files (shapefiles,
typically, but this probably more an I/O benchmark), spatial object
creation from primitive objects (the
SpatialPolygons(list(Polygons(list(matrix) stuff), over, and
everything in rgeos, as many kriging packages as you can find, and as
much of raster as you can think of. Quite a bit of that is already in
C so might not get any faster in pqR. But a spatial benchmark suite
would be nice anyway.

I've just benchmarked my time and I have 0s to do this.



On Thu, Jun 27, 2013 at 4:09 PM, Boulanger, Yan
yan.boulan...@rncan-nrcan.gc.ca wrote:
 Dear forumities,

 Did anyone tried pqR for spatial analyses ? I don't know if the worth the 
 case (I will have to try myself) but it seems that pqR (which was released 
 last week) is able to perform operations in parallel, especially on matrices 
 so I guess it could substantially reduce the computation time when e.g., 
 doing simple mathematical operations on rasters.


 One notable improvement is that pqR is able to do some numeric computations 
 in parallel with each other, and with other operations of the interpreter, on 
 systems with multiple processors or processor cores 
 (http://radfordneal.wordpress.com/2013/06/22/announcing-pqr-a-faster-version-of-r/)
 The program is only available for the moment, for UNIX and Linux platforms 
 although it seems to run correctly on Mac.
 Any thoughts?
 Yan

 Yan Boulanger, Postdoctoral Visiting Fellow
 Ressources Naturelles Canada, Canadian Forest Service
 Centre de Foresterie des Laurentides
 1055, rue du P.E.P.S.
 C.P. 10380, succ. Sainte-Foy
 Québec (Québec) Canada
 G1V 4C7
 Tel. : +1 418 649-6859



 [[alternative HTML version deleted]]


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] citation for gstat

2013-06-24 Thread Hodgess, Erin
Hello everyone!

What is the correction citation for the gstat package, please?

Here is what I did:

 library(gstat)
 citation(gstat)
Error in match(x, table, nomatch = 0L) :
  'match' requires vector arguments


I would like to cite it correctly.

Thanks so much!
Sincerely,
Erin


Erin M. Hodgess, Ph.D.
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodge...@uhd.edumailto:hodge...@uhd.edu


[[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] trouble with rgdal and Rstudio

2013-06-21 Thread Hodgess, Erin
I've updated the $PATH via .bashrc and .Renviron.

I had trouble with compilation yesterday, but that was a problem with 
permissions on as.  It's fixed now.


From: skalp.oet...@gmail.com [skalp.oet...@gmail.com] on behalf of Pascal 
Oettli [kri...@ymail.com]
Sent: Friday, June 21, 2013 1:00 AM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] trouble with rgdal and Rstudio

Hello,

Problem of paths definition ($PATH) and permissions for your account?

Regards,
Pascal




2013/6/21 Hodgess, Erin hodge...@uhd.edumailto:hodge...@uhd.edu
Hi everyone!

I have set up Rstudio on a Centos 5 server.  When I try to bring in rgdal, this 
is what happens:

 library(rgdal)
Loading required package: sp
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object 
'/home/erin1/R/x86_64-unknown-linux-gnu-library/3.0/rgdal/libs/rgdal.so':
  libgdal.so.1: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘rgdal’

I have tried removing gdalplugins, have re-installed gdal, have put together an 
Renviron.site, and changed .Renviron.

It works fine when I'm not on Rstudio.

Any suggestions, please?

I did try the items mentioned in the google article from Drs. Bivand and 
Rowlingson


Thanks,
Erin


[[alternative HTML version deleted]]


___
R-sig-Geo mailing list
R-sig-Geo@r-project.orgmailto:R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] trouble with rgdal and Rstudio

2013-06-20 Thread Hodgess, Erin
Hi everyone!

I have set up Rstudio on a Centos 5 server.  When I try to bring in rgdal, this 
is what happens:

 library(rgdal)
Loading required package: sp
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object 
'/home/erin1/R/x86_64-unknown-linux-gnu-library/3.0/rgdal/libs/rgdal.so':
  libgdal.so.1: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘rgdal’

I have tried removing gdalplugins, have re-installed gdal, have put together an 
Renviron.site, and changed .Renviron.

It works fine when I'm not on Rstudio.

Any suggestions, please?

I did try the items mentioned in the google article from Drs. Bivand and 
Rowlingson


Thanks,
Erin


[[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] trend analyis/spatial modeling

2013-06-18 Thread Hodgess, Erin
Hello Moshood:

I am probably oversimplifying, but I think if you just do:  
krige(yield~easting+northing)
You should be ok.

Thanks,
Erin


-Original Message-
From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-boun...@r-project.org] 
On Behalf Of Moshood Agba Bakare
Sent: Tuesday, June 18, 2013 4:53 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] trend analyis/spatial modeling

Dear All,
I intend to fit spatial covariance structure to yield response georeferenced 
with geographical coordinates (latitude and longitude) using the model
Z(s) =u(s) +e(s). I have converted to projected coordinates i.e. easting and 
northing in meters.
I would like to find out if it is necessary to carry out trend surface analysis 
by regressing the yield on the coordinates before proceeding with fitting the 
spatial covariance models.
That is yield ~easting + northing

Thank you while looking forward to your response.

Best regards
Moshood

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] questions about STIDF objects

2013-03-12 Thread Hodgess, Erin
Hello!

Is there a way to do kriging on an STIDF object, please?  Probably not, but I 
thought that I'd check.

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] a possible extension to spatial/spatio-temporal?

2013-03-09 Thread Hodgess, Erin
Hello!

I have access to a set of EEG data.  There are 16 inputs and about 23000 time 
series  for each input.  The data locations are in symmetric pairs around the 
head.

Could you use spatial or spatio-temporal for that data set, please?  Or would 
it not since there are so few locations, please?

Thanks,
Erin


[[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] ground overlays in KML

2013-03-06 Thread Hodgess, Erin
The slider was exactly what I needed.  Thanks so much!

Erin


From: b.rowling...@gmail.com [b.rowling...@gmail.com] on behalf of Barry 
Rowlingson [b.rowling...@lancaster.ac.uk]
Sent: Wednesday, March 06, 2013 2:45 AM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] ground overlays in KML

On Wed, Mar 6, 2013 at 2:07 AM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hello again.

 I'm not sure if I should ask this here, but I thought it might be a place to
 start:

 I'm producing PNG files for ground overlays in Google Earth.  After some
 help from you this afternoon, my png files are ready.  However, the files do
 not run in sequence in Google Earth.  It shows the last file only.

 Here is a little bit of the code:

 This works for me, except..

 kml xmlns:xsd=http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd;
 xmlns:xmlns=http://www.opengis.net/kml/2.2/; version=1.0
...
 /Document
 kml

 that last tag should be a closing /kml - but google earth
complained until I changed it so maybe thats a typo that happened when
you chooped a data file up to put in the email! Take CARE!

 Now, you don't say exactly what you are doing. All we have is the
files do not run in sequence in Google Earth. It shows the last file
only.

 Well, yes, that's because the last one is on top of the others. You
are trying to do some kind of animation? So what have you done with
the animation controller?

 The animation controller has a start and end marker. Initially the
markers will be at the limits of the start and end of the timepoints
of your data. Hit the 'play' button (aka click to toggle time slider
animation) and it will animate the start point only. The end doesn't
change. Since your top image has an end point within the time range
for all times, it stays visible. What is happening is that the images
underneath it are being animated, but you don't see that because they
are hidden under the top one at all time points.

So... drag the time END point back so it nudges up to the start point
marker. Now that will put the top layers out of range, and just reveal
the earliest bottom layer. Hit play again

 That's what I do to get an animation. As time goes forward, I see the
blue area shrinking, in three steps.

Barry

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] stplot question

2013-03-05 Thread Hodgess, Erin
Thank you!

I have:

stplot(kr3, layout=c(0,11))

Now, of course, one more thing, please:  the plots run one after another.  Is 
there a way to do one at a time, please?  My ideal is to have 11 png files.

Thanks again,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Edzer Pebesma [edzer.pebe...@uni-muenster.de]
Sent: Tuesday, March 05, 2013 2:12 AM
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] stplot question

Erin, See the help of xyplot in package lattice, in particular argument
layout.

On 03/05/2013 08:21 AM, Hodgess, Erin wrote:
 Hello!

 I have a spatio-temporal data set with 23 cities and 11 years of annual data.

 I have made it through krigeST without any problem.

 I use stplot and it works fine.  It puts all of the plots on one page.

 My question:  is there a way to have each of the stplots on separate pages, 
 please?

 Thanks,
 Erin


   [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics  e.pebe...@wwu.de

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] question about image function

2013-03-05 Thread Hodgess, Erin
Hello again!

I'm running into a problem with the image function within a loop.  When I put 
it to the screen, it works fine, but when I put it to a PNG file, the picture 
doesn't change.

Here is the code:

for(i in 1:11) {
j1 - (i-1)*n2 + 1
j2 - i*n2

 predx - 
data.frame(pred=kr3$var1.pred[j1:j2],lon=kr3@sp@coords[,1],lat=kr3@sp@coords[,2])

 coordinates(predx) - ~lon+lat
 proj4string(predx) - proj4string(kr3)
 predx.wgs84 - spTransform(predx,CRS(+proj=longlat +datum=WGS84))
 llSPix - as(llSGDF, SpatialPixelsDataFrame)
 (st - system.time(llSPix$pred - idw(pred ~ 1,
 loc=predx.wgs84,newdata = llSPix, nmax = 16)$var1.pred))
 cat(stuff,i,\n)
f1 - paste(pred,i,a.png,sep=)
#Works fine
image(llSPix,pred,col=bpy.colors(),main=f1)


 assign(file1,f1)
 cat(filen,file1,\n)
 png(filename = file1, width = GRD.wgs84$width,
 height = GRD.wgs84$height,bg=transparent)
 par(mar = c(0, 0, 0, 0), xaxs = i, yaxs = i)
 image(llSPix, pred, col = bpy.colors())
 dev.off()
 kmlsetup(obj = GRD.wgs84, kmlfile =filename,
 imagefile = file1, name =as.character(2000+i))

}

Has anyone run into this before, please?

Thanks,
Erin


[[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] question about image function

2013-03-05 Thread Hodgess, Erin
It's the png file.  It seems to be writing the first data set over and over to 
the various png files.




From: Michael Sumner [mdsum...@gmail.com]
Sent: Tuesday, March 05, 2013 2:41 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] question about image function

I don't see filename defined, or any packages required. Is it the png files 
that are a problem or the 'kmlsetup' output? (whatever that is)

See the animation package for extremely simplifed image frame creation btw

On Wednesday, March 6, 2013, Hodgess, Erin wrote:
Hello again!

I'm running into a problem with the image function within a loop.  When I put 
it to the screen, it works fine, but when I put it to a PNG file, the picture 
doesn't change.

Here is the code:

for(i in 1:11) {
j1 - (i-1)*n2 + 1
j2 - i*n2

 predx - 
data.frame(pred=kr3$var1.pred[j1:j2],lon=kr3@sp@coords[,1],lat=kr3@sp@coords[,2])

 coordinates(predx) - ~lon+lat
 proj4string(predx) - proj4string(kr3)
 predx.wgs84 - spTransform(predx,CRS(+proj=longlat +datum=WGS84))
 llSPix - as(llSGDF, SpatialPixelsDataFrame)
 (st - system.time(llSPix$pred - idw(pred ~ 1,
 loc=predx.wgs84,newdata = llSPix, nmax = 16)$var1.pred))
 cat(stuff,i,\n)
f1 - paste(pred,i,a.png,sep=)
#Works fine
image(llSPix,pred,col=bpy.colors(),main=f1)


 assign(file1,f1)
 cat(filen,file1,\n)
 png(filename = file1, width = GRD.wgs84$width,
 height = GRD.wgs84$height,bg=transparent)
 par(mar = c(0, 0, 0, 0), xaxs = i, yaxs = i)
 image(llSPix, pred, col = bpy.colors())
 dev.off()
 kmlsetup(obj = GRD.wgs84, kmlfile =filename,
 imagefile = file1, name =as.character(2000+i))

}

Has anyone run into this before, please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.orgUrlBlockedError.aspx
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Michael Sumner
Hobart, Australia
e-mail: mdsum...@gmail.commailto:mdsum...@gmail.com

[[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] question about image function

2013-03-05 Thread Hodgess, Erin
That was it...thanks so much!


From: Clint Bowman [cl...@ecy.wa.gov]
Sent: Tuesday, March 05, 2013 2:46 PM
To: Michael Sumner
Cc: Hodgess, Erin; r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] question about image function

When using png in a loop, especially one where the loop index is an
integer, I usually make use of the %02d in the file name, e.g.,
png(pred_%02d_a.png,...)

Clint BowmanINTERNET:   cl...@ecy.wa.gov
Air Quality Modeler INTERNET:   cl...@math.utah.edu
Department of Ecology   VOICE:  (360) 407-6815
PO Box 47600FAX:(360) 407-7534
Olympia, WA 98504-7600

 USPS:   PO Box 47600, Olympia, WA 98504-7600
 Parcels:300 Desmond Drive, Lacey, WA 98503-1274

On Wed, 6 Mar 2013, Michael Sumner wrote:

 I don't see filename defined, or any packages required. Is it the png files
 that are a problem or the 'kmlsetup' output? (whatever that is)

 See the animation package for extremely simplifed image frame creation btw

 On Wednesday, March 6, 2013, Hodgess, Erin wrote:

 Hello again!

 I'm running into a problem with the image function within a loop.  When I
 put it to the screen, it works fine, but when I put it to a PNG file, the
 picture doesn't change.

 Here is the code:

 for(i in 1:11) {
 j1 - (i-1)*n2 + 1
 j2 - i*n2

  predx - data.frame(pred=kr3$var1.pred[j1:j2],lon=kr3@sp
 @coords[,1],lat=kr3@sp@coords[,2])

  coordinates(predx) - ~lon+lat
  proj4string(predx) - proj4string(kr3)
  predx.wgs84 - spTransform(predx,CRS(+proj=longlat +datum=WGS84))
  llSPix - as(llSGDF, SpatialPixelsDataFrame)
  (st - system.time(llSPix$pred - idw(pred ~ 1,
  loc=predx.wgs84,newdata = llSPix, nmax = 16)$var1.pred))
  cat(stuff,i,\n)
 f1 - paste(pred,i,a.png,sep=)
 #Works fine
 image(llSPix,pred,col=bpy.colors(),main=f1)


  assign(file1,f1)
  cat(filen,file1,\n)
  png(filename = file1, width = GRD.wgs84$width,
  height = GRD.wgs84$height,bg=transparent)
  par(mar = c(0, 0, 0, 0), xaxs = i, yaxs = i)
  image(llSPix, pred, col = bpy.colors())
  dev.off()
  kmlsetup(obj = GRD.wgs84, kmlfile =filename,
  imagefile = file1, name =as.character(2000+i))

 }

 Has anyone run into this before, please?

 Thanks,
 Erin


 [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org javascript:;
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo



 --
 Michael Sumner
 Hobart, Australia
 e-mail: mdsum...@gmail.com

   [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] ground overlays in KML

2013-03-05 Thread Hodgess, Erin
Hello again.

I'm not sure if I should ask this here, but I thought it might be a place to 
start:

I'm producing PNG files for ground overlays in Google Earth.  After some help 
from you this afternoon, my png files are ready.  However, the files do not run 
in sequence in Google Earth.  It shows the last file only.

Here is a little bit of the code:

kml xmlns:xsd=http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd; 
xmlns:xmlns=http://www.opengis.net/kml/2.2/; version=1.0
Document
Folder
GroundOverlay
name2001/name
TimeSpanbegin 2001-01-01 /begin
end 2001-12-31 /end/TimeSpan
Iconhrefpreda_01.png/hrefviewBoundScale0.75/viewBoundScale/Icon
LatLonBoxnorth36.48445398908/northsouth25.9875545196567/southeast-93.5186130430667/eastwest-106.704257739431/west/LatLonBox
/GroundOverlayGroundOverlay
name2002/name
TimeSpanbegin 2002-01-01 /begin
end 2002-12-31 /end/TimeSpan
Iconhrefpredb_01.png/hrefviewBoundScale0.75/viewBoundScale/Icon
LatLonBoxnorth36.48445398908/northsouth25.9875545196567/southeast-93.5186130430667/eastwest-106.704257739431/west/LatLonBox
/GroundOverlayGroundOverlay
name2003/name
TimeSpanbegin 2003-01-01 /begin
end 2003-12-31 /end/TimeSpan
Iconhrefpredc_01.png/hrefviewBoundScale0.75/viewBoundScale/Icon
LatLonBoxnorth36.48445398908/northsouth25.9875545196567/southeast-93.5186130430667/eastwest-106.704257739431/west/LatLonBox
/GroundOverlay
/Folder
/Document
kml



I'm also attaching the png files.

Thanks for any help.


attachment: preda_01.pngattachment: predb_01.pngattachment: predc_01.png___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] ground overlays in KML

2013-03-05 Thread Hodgess, Erin
I had seen this today too...it doesn't seem to work either?

Thanks though.
Erin


From: Chris English [sgl...@hotmail.com]
Sent: Tuesday, March 05, 2013 9:11 PM
To: Hodgess, Erin; Help R-Sig_Geo
Subject: RE: [R-sig-Geo] ground overlays in KML

I imagine the final image is the last written.

https://developers.google.com/kml/documentation/time
explores various methods and additional tags employed for rendering sequences
and controlling overlays.
Hope it is in the right direction.

Chris

From: hodge...@uhd.edu
To: r-sig-geo@r-project.org
Date: Wed, 6 Mar 2013 02:07:11 +
Subject: [R-sig-Geo] ground overlays in KML

Hello again.

I'm not sure if I should ask this here, but I thought it might be a place to 
start:

I'm producing PNG files for ground overlays in Google Earth.  After some help 
from you this afternoon, my png files are ready.  However, the files do not run 
in sequence in Google Earth.  It shows the last file only.

Here is a little bit of the code:

kml xmlns:xsd=http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd; 
xmlns:xmlns=http://www.opengis.net/kml/2.2/; version=1.0
Document
Folder
GroundOverlay
name2001/name
TimeSpanbegin 2001-01-01 /begin
end 2001-12-31 /end/TimeSpan
Iconhrefpreda_01.png/hrefviewBoundScale0.75/viewBoundScale/Icon
LatLonBoxnorth36.48445398908/northsouth25.9875545196567/southeast-93.5186130430667/eastwest-106.704257739431/west/LatLonBox
/GroundOverlayGroundOverlay
name2002/name
TimeSpanbegin 2002-01-01 /begin
end 2002-12-31 /end/TimeSpan
Iconhrefpredb_01.png/hrefviewBoundScale0.75/viewBoundScale/Icon
LatLonBoxnorth36.48445398908/northsouth25.9875545196567/southeast-93.5186130430667/eastwest-106.704257739431/west/LatLonBox
/GroundOverlayGroundOverlay
name2003/name
TimeSpanbegin 2003-01-01 /begin
end 2003-12-31 /end/TimeSpan
Iconhrefpredc_01.png/hrefviewBoundScale0.75/viewBoundScale/Icon
LatLonBoxnorth36.48445398908/northsouth25.9875545196567/southeast-93.5186130430667/eastwest-106.704257739431/west/LatLonBox
/GroundOverlay
/Folder
/Document
kml



I'm also attaching the png files.

Thanks for any help.



___ R-sig-Geo mailing list 
R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] stplot question

2013-03-04 Thread Hodgess, Erin
Hello!

I have a spatio-temporal data set with 23 cities and 11 years of annual data.

I have made it through krigeST without any problem.

I use stplot and it works fine.  It puts all of the plots on one page.

My question:  is there a way to have each of the stplots on separate pages, 
please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] crop and overlay question

2013-02-28 Thread Hodgess, Erin
Hello everyone:

I'm sure that this is a goofy question but here goes:

I am analyzing some spatio-temporal data on cities in Texas (over time).

I want to have a spatial grid for krigeST.  However, I want my grid to be in 
the shape of Texas.  Here is what I have done:


 tmp - map(state,Texas,fill=TRUE,plot=FALSE)
 texas.boundary - map2SpatialPolygons(tmp, IDs=tmp$names, 
 proj4string=CRS(+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0))
 plot(texas.boundary)
 str(texas.boundary)
Formal class 'SpatialPolygons' [package sp] with 4 slots
  ..@ polygons   :List of 1
  .. ..$ :Formal class 'Polygons' [package sp] with 5 slots
  .. .. .. ..@ Polygons :List of 1
  .. .. .. .. ..$ :Formal class 'Polygon' [package sp] with 5 slots
  .. .. .. .. .. .. ..@ labpt  : num [1:2] -99.4 31.5
  .. .. .. .. .. .. ..@ area   : num 64.9
  .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. ..@ coords : num [1:1088, 1:2] -94.5 -94.5 -94.5 -94.5 
-94.5 ...
  .. .. .. ..@ plotOrder: int 1
  .. .. .. ..@ labpt: num [1:2] -99.4 31.5
  .. .. .. ..@ ID   : chr texas
  .. .. .. ..@ area : num 64.9
  ..@ plotOrder  : int 1
  ..@ bbox   : num [1:2, 1:2] -106.7 25.9 -93.5 36.5
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : chr [1:2] x y
  .. .. ..$ : chr [1:2] min max
  ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. ..@ projargs: chr  +proj=longlat +datum=WGS84 +ellps=WGS84 
+towgs84=0,0,0
 texas1.boundary - spTransform(texas.boundary,CRS(+proj=aea +lat_1=27.5 
 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=150 +y_0=600 +ellps=GRS80 
 +datum=NAD83 +units=m +no_defs)
+ )
 plot(texas1.boundary)
 grd - SpatialPixels(SpatialPoints(makegrid(texas1.boundary,n=300)),
+ proj4string=proj4string(texas1.boundary))
 plot(grd)

I have tried all kinds of things with crop and overlay, but to no avail.

Any suggestions would be much appreciated.

Sincerely,
Erin


[[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] save output to excel;

2013-02-27 Thread Hodgess, Erin
What kind of output, please?

From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Lilis Husna [lily_frankn...@yahoo.com]
Sent: Wednesday, February 27, 2013 9:30 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] save output to excel;

How to save R Output into Ms.Excel ?


Best Regards,
Lilis Nurul Husna
Institute of Statistics

Jakarta




[[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] space time variogram

2013-02-26 Thread Hodgess, Erin
Hello!

I think it is showing days rather than years.



From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Jonesmus Wambua [jonesmus.mu...@gmail.com]
Sent: Tuesday, February 26, 2013 4:03 AM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] space time variogram

hi,
am specifying a variogram with 53 years by generating the time variable as 
follows:

time - as.POSIXct(paste0(1960:2012,-01-01), tz = GMT)

When i generate the map variagram, it comes with time in thousands (see 
attached map). how can i make sure that it gives time in years with a 
reasonable range?

[[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] converting from NAD83 datum to lat,lon

2013-02-25 Thread Hodgess, Erin
Hi!

Suppose your data set is called nc1.df.

Then you can do:
library(rgdal)
nc1.wgs84 - spTransform(nc1.df,CRS(+proj=longlat +datum=WGS84))



From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Migun Shakya [microbea...@gmail.com]
Sent: Monday, February 25, 2013 4:21 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] converting from NAD83 datum to lat,lon

Hi all,

Is there a way/package/trick to convert the NAD83 formatted file to
lat lon format?

I downloaded the Major Hydrography dataset from NC,USA to plot
rivers into a NC map. However, the dataset is in NAD83 or in state
plane projection, but i need it to be in lat/lon.


Any help would be great.


Thanks
Migee


dataset can be found in:
http://data.nconemap.com/geoportal/catalog/search/resource/details.page?uuid=%7B2515713B-2CA0-476F-863F-61441A9D6F70%7D


The downloaded dataset consist of
hydromaj_arc.dbf
hydromaj_arc.prj
hydromaj_arc.shp
hydromaj_arc.shx
hydromaj_arc.txt
hydromaj_poly.dbf
hydromaj_poly.prj
hydromaj_poly.shp
hydromaj_poly.shx

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] converting from NAD83 datum to lat,lon

2013-02-25 Thread Hodgess, Erin
Hi Migun:

Do an str(nc.river)

Is the proj4string string set, please?

Thanks,
Erin


From: Migun Shakya [microbea...@gmail.com]
Sent: Monday, February 25, 2013 7:45 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] converting from NAD83 datum to lat,lon

Hi Erin,
I tried that but ended up getting this error. Does the spTransform
function requires the data to be as data.frame?
Here is what i did to read the data

library(maptools)
library(rgdal)
nc.river-readShapeSpatial(~/hydromaj/hydromaj_arc.shp) #reading the
shape file

nc1.wgs84 - spTransform(nc.river,CRS(+proj=longlat +datum=WGS84))
Error in spTransform(xSP, CRSobj, ...) :
  No transformation possible from NA reference system


Thanks again
Migee

On Mon, Feb 25, 2013 at 5:47 PM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hi!

 Suppose your data set is called nc1.df.

 Then you can do:
 library(rgdal)
 nc1.wgs84 - spTransform(nc1.df,CRS(+proj=longlat +datum=WGS84))


 
 From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
 behalf of Migun Shakya [microbea...@gmail.com]
 Sent: Monday, February 25, 2013 4:21 PM
 To: r-sig-geo@r-project.org
 Subject: [R-sig-Geo] converting from NAD83 datum to lat,lon

 Hi all,

 Is there a way/package/trick to convert the NAD83 formatted file to
 lat lon format?

 I downloaded the Major Hydrography dataset from NC,USA to plot
 rivers into a NC map. However, the dataset is in NAD83 or in state
 plane projection, but i need it to be in lat/lon.


 Any help would be great.


 Thanks
 Migee


 dataset can be found in:
 http://data.nconemap.com/geoportal/catalog/search/resource/details.page?uuid=%7B2515713B-2CA0-476F-863F-61441A9D6F70%7D


 The downloaded dataset consist of
 hydromaj_arc.dbf
 hydromaj_arc.prj
 hydromaj_arc.shp
 hydromaj_arc.shx
 hydromaj_arc.txt
 hydromaj_poly.dbf
 hydromaj_poly.prj
 hydromaj_poly.shp
 hydromaj_poly.shx

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] converting from NAD83 datum to lat,lon

2013-02-25 Thread Hodgess, Erin
Try something like this:

proj4string(nc.river) - CRS(+proj=lcc +lat_1=36.16 
+lat_2=34.34 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 
+ellps=GRS80 +datum=NAD83 +units=m +no_defs)




From: Migun Shakya [microbea...@gmail.com]
Sent: Monday, February 25, 2013 8:14 PM
To: Michael Sumner
Cc: Hodgess, Erin; r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] converting from NAD83 datum to lat,lon

Hi Mike,

I tried the rgdal:readOGR, but got an error.

 nc.river-readOGR(~/hydromaj/hydromaj_arc.shp)
Error in readOGR(~/hydromaj/hydromaj_arc.shp) :
  missing layer

Sorry, I am not very familiar with the data structure, but i am
looking at the spatialreference.org. Lets see what i get.

Thanks,
Migun

Here is the .prj file content for hydromaj_arc.prj

PROJCS[NAD_1983_StatePlane_North_Carolina_FIPS_3200,GEOGCS[GCS_North_American_1983,DATUM[D_North_American_1983,SPHEROID[GRS_1980,6378137.0,298.257222101]],PRIMEM[Greenwich,0.0],UNIT[Degree,0.0174532925199433]],PROJECTION[Lambert_Conformal_Conic],PARAMETER[False_Easting,609601.22],PARAMETER[False_Northing,0.0],PARAMETER[Central_Meridian,-79.0],PARAMETER[Standard_Parallel_1,34.34],PARAMETER[Standard_Parallel_2,36.16],PARAMETER[Latitude_Of_Origin,33.75],UNIT[Meter,1.0]]

On Mon, Feb 25, 2013 at 9:01 PM, Michael Sumner mdsum...@gmail.com wrote:
 You need an input projection on the data, it doesn't know what you are
 transforming FROM.

 Did you read this with maptools::readShapePoly? Try with rgdal:readOGR
 so you get the projection automatically with the object.

 I cannot download the data from the link you provide, but if you post
 the text of the .prj files here someone will be able to give you R
 code to set it without re-reading.  (Explore for yourself on
 spatialreference.org).

 Also, lat,lon requires a datum like any map projection - you'll need
 to find out if you should stay with NAD83 or convert to WGS84 as in
 Erin's code.

 Cheers, Mike.



 On Tue, Feb 26, 2013 at 12:45 PM, Migun Shakya microbea...@gmail.com wrote:
 Hi Erin,
 I tried that but ended up getting this error. Does the spTransform
 function requires the data to be as data.frame?
 Here is what i did to read the data

 library(maptools)
 library(rgdal)
 nc.river-readShapeSpatial(~/hydromaj/hydromaj_arc.shp) #reading the
 shape file

 nc1.wgs84 - spTransform(nc.river,CRS(+proj=longlat +datum=WGS84))
 Error in spTransform(xSP, CRSobj, ...) :
   No transformation possible from NA reference system


 Thanks again
 Migee

 On Mon, Feb 25, 2013 at 5:47 PM, Hodgess, Erin hodge...@uhd.edu wrote:
 Hi!

 Suppose your data set is called nc1.df.

 Then you can do:
 library(rgdal)
 nc1.wgs84 - spTransform(nc1.df,CRS(+proj=longlat +datum=WGS84))


 
 From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
 behalf of Migun Shakya [microbea...@gmail.com]
 Sent: Monday, February 25, 2013 4:21 PM
 To: r-sig-geo@r-project.org
 Subject: [R-sig-Geo] converting from NAD83 datum to lat,lon

 Hi all,

 Is there a way/package/trick to convert the NAD83 formatted file to
 lat lon format?

 I downloaded the Major Hydrography dataset from NC,USA to plot
 rivers into a NC map. However, the dataset is in NAD83 or in state
 plane projection, but i need it to be in lat/lon.


 Any help would be great.


 Thanks
 Migee


 dataset can be found in:
 http://data.nconemap.com/geoportal/catalog/search/resource/details.page?uuid=%7B2515713B-2CA0-476F-863F-61441A9D6F70%7D


 The downloaded dataset consist of
 hydromaj_arc.dbf
 hydromaj_arc.prj
 hydromaj_arc.shp
 hydromaj_arc.shx
 hydromaj_arc.txt
 hydromaj_poly.dbf
 hydromaj_poly.prj
 hydromaj_poly.shp
 hydromaj_poly.shx

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo



 --
 Michael Sumner
 Hobart, Australia
 e-mail: mdsum...@gmail.com

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] question about variogramST

2013-02-22 Thread Hodgess, Erin
Hello everyone:

I have an STFDF object and I would like to produce a variogramST.  I'm using 
the version of spacetime from 2/19.

However, I'm getting a weird error message.  Here is the output:

 str(city4.st)
Formal class 'STFDF' [package spacetime] with 4 slots
  ..@ data   :'data.frame': 230 obs. of  1 variable:
  .. ..$ index: num [1:230] 100 100 100 100 100 100 100 100 100 100 ...
  ..@ sp :Formal class 'SpatialPoints' [package sp] with 3 slots
  .. .. ..@ coords : num [1:23, 1:2] -99.7 -101.8 -97.7 -94.1 -97.5 ...
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : NULL
  .. .. .. .. ..$ : chr [1:2] lon lat
  .. .. ..@ bbox   : num [1:2, 1:2] -106.5 25.9 -94 35.2
  .. .. .. ..- attr(*, dimnames)=List of 2
  .. .. .. .. ..$ : chr [1:2] lon lat
  .. .. .. .. ..$ : chr [1:2] min max
  .. .. ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. .. .. ..@ projargs: chr  +proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 
+lon_0=-100 +x_0=150 +y_0=500 +ellps=GRS80 +datum=NAD83 +units=m 
+no_defs +t| __truncated__
  ..@ time   :An ‘xts’ object on 2001-01-01/2010-01-01 containing:
  Data: int [1:10, 1] 1 2 3 4 5 6 7 8 9 10
 - attr(*, dimnames)=List of 2
  ..$ : NULL
  ..$ : chr timeIndex
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:
 NULL
  ..@ endTime: POSIXct[1:10], format: 2002-01-01 2003-01-01 2004-01-01 
2005-01-01 ...
 variogramST(index~1,city4.st)
Error in if (nrow(x)  nrow(y)) matrix(t(apply(x, 1, spDiN1, y = y, ll = 
longlat)),  :
  argument is of length zero


Any suggestions would be much appreciated.

Thanks,
Sincerely,
Erin


[[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] missing vgmST?

2013-02-19 Thread Hodgess, Erin
There's a new one...both spacetime and gstat.

That's what the problem was.

Thanks,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Piero Campalani [piero.ca...@gmail.com]
Sent: Wednesday, February 20, 2013 12:44 AM
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] missing vgmST?

Hi Erin,
...did you load the library?

Piero


On 20 February 2013 01:30, Hodgess, Erin hodge...@uhd.edu wrote:

 Hi!

 I'm working with some spatio-temporal data and was trying to use vgmST.

 However, it says that the function is not there.  I have the spacetime
 library running.

 Any suggestions, please?

  v - vgmST(separable,space=vgm(1,Nug),time=vgm(1,Nug))
 Error: could not find function vgmST
 

 Thanks,
 Sincerely,
 Erin


 [[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 R-sig-Geo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] Fwd: spatio temporal variogram

2013-02-13 Thread Hodgess, Erin
Hi!

When you make your shift from the first data set to the second, set it up such 
the the X1 - X4 are time series.

For instance, if your data frame is called d1.df,
d1.df$X1 - ts(d1.df$X1,start=1981,freq=12)
(for monthly data)

Hope this helps!

Sincerely,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Jonesmus Wambua [jonesmus.mu...@gmail.com]
Sent: Wednesday, February 13, 2013 3:25 AM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] Fwd: spatio temporal variogram

Hi everyone,
am trying to do temporal and cross correlation and also fit a
spatio-temporal variogram with data in this format.

 |   ID year   y  X_COORD  Y_COORD
1   1  1981   60  36.98203  2.042057
2   2  1982   40  37.12720  2.016312
3   2  1983   20  37.12720  2.016312
4   3  1980  165  35.38416  1.714100
5   3  1981   26  35.38416  1.714100
6   3  1982   50  35.38416  1.714100|

My challenge is getting the data in the right format. my years are only 5
but with over 500 cluster points. I have summarized the data by adding the
data for each cluster per year so that my data now looks like below

 year X1 X2 X3 X4
1 1980 NA NA  3 NA
2 1981  1 NA  2  5
3 1982 NA  0  0 NA
4 1983 NA  0 NA NA
5 1984 NA NA NA NA


where X1 are my clusters. when i tried to do a autocorrelation using the
following code,
acf(na.omit(som)) it works, but for cross-autocorrelation as follows

acf(na.omit(som), xts) , it gives the following error

Error in ts(x) : 'ts' object must have one or more observations


can anyone help?
thanks

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] question about STIDF objects

2013-02-09 Thread Hodgess, Erin
Dear R-sig Geo People:

I have a question about the space-time package, please.  I'm working through 
the worked examples  from the JRSS paper.

My question is:  can I make the wind.data object an STIDF instead of an STFDF, 
please?

I would like it in that form so I can use plotKML to produce those cool Google 
Earth KML files.

Thanks,
Erin


[[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] question about STIDF objects

2013-02-09 Thread Hodgess, Erin
I figured it out.  Please ignore the previous message.


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Hodgess, Erin
Sent: Saturday, February 09, 2013 10:10 PM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] question about STIDF objects

Dear R-sig Geo People:

I have a question about the space-time package, please.  I'm working through 
the worked examples  from the JRSS paper.

My question is:  can I make the wind.data object an STIDF instead of an STFDF, 
please?

I would like it in that form so I can use plotKML to produce those cool Google 
Earth KML files.

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] back to variogram

2012-12-29 Thread Hodgess, Erin
Hello yet again:

I have a little data set that I want to get a variogram for.  However, I keep 
getting an error.

 str(z1.df)
Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots
  ..@ data   :'data.frame':5 obs. of  1 variable:
  .. ..$ x: num [1:5] 1.4228 0.0275 -0.3738 0.2812 0.2328
  ..@ coords.nrs : int [1:2] 2 3
  ..@ coords : num [1:5, 1:2] 146.9 133.8 -85.8 -99.9 -91.1 ...
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] lon lat
  ..@ bbox   : num [1:2, 1:2] -99.9 -31.3 146.9 38.3
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : chr [1:2] lon lat
  .. .. ..$ : chr [1:2] min max
  ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. ..@ projargs: chr NA
 variogram(z1.df)
Error in variogram.default(z1.df) :
  argument object and locations should be lists


Does this make any sense, please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] calculating a variogram/semi-variogram

2012-12-28 Thread Hodgess, Erin
Hello Everyone!

Happy New Year (a bit early)!

I have a question about calculating a variogram or semi-variogram, please:  
does anyone have a toy example of how this is done, please?

(I like to see actual numbers from the start).

Thanks so much in advance,
Sincerely,
Erin



[[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] calculating a variogram/semi-variogram

2012-12-28 Thread Hodgess, Erin
thanks for your help.

I need to read more stuff...I'm confused on how it selects the numbers of 
pairs, for instance.

thanks,
Erin


From: romu...@gmail.com [romu...@gmail.com] on behalf of Roman Luštrik 
[roman.lust...@gmail.com]
Sent: Friday, December 28, 2012 5:56 PM
To: Hodgess, Erin
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] calculating a variogram/semi-variogram

Dear Erin,

if you load package `gstat`, there's an example in function `variogram`. Is 
this sufficient?

Cheers,
Roman



On Sat, Dec 29, 2012 at 12:30 AM, Hodgess, Erin 
hodge...@uhd.edumailto:hodge...@uhd.edu wrote:
Hello Everyone!

Happy New Year (a bit early)!

I have a question about calculating a variogram or semi-variogram, please:  
does anyone have a toy example of how this is done, please?

(I like to see actual numbers from the start).

Thanks so much in advance,
Sincerely,
Erin



[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.orgmailto:R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
In God we trust, all others bring data.

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] using rasterize

2012-12-28 Thread Hodgess, Erin
Hello again:

I'm trying to rasterize a spatial points data frame and I seem to be missing 
something, as seen below:



 str(loc3)
Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots
  ..@ data   :'data.frame':477 obs. of  6 variables:
  .. ..$ ID  : num [1:477] 1 2 3 5 6 8 9 10 10 13 ...
  .. ..$ lonmin  : num [1:477] 141 112.9 -85.9 -106.6 -91.2 ...
  .. ..$ lonmax  : num [1:477] 153.6 159.1 -85.4 -93.5 -91 ...
  .. ..$ latmin  : num [1:477] -37.5 -54.8 38 25.8 30.4 ...
  .. ..$ latmax  : num [1:477] -28.16 -9.22 38.38 36.5 30.56 ...
  .. ..$ location: Factor w/ 275 levels NSW,Australia,..: 1 2 3 5 6 8 9 10 
10 13 ...
  ..@ coords.nrs : int [1:2] 3 2
  ..@ coords : num [1:477, 1:2] -31.3 -25.3 38.3 32 30.5 ...
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] lat lon
  ..@ bbox   : num [1:2, 1:2] -37.8 -159.6 62.3 175.3
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : chr [1:2] lat lon
  .. .. ..$ : chr [1:2] min max
  ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. ..@ projargs: chr NA
 rasterize(loc3,field=location,fun=count,na.rm=TRUE)
Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘rasterize’ for signature 
‘SpatialPointsDataFrame, missing’


Do you have any ideas, please?  Could it be that the proj4string is NA, do you 
think, please?

Thanks,
Erin



[[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] using rasterize SOLVED

2012-12-28 Thread Hodgess, Erin
Sorry to cause trouble...I figured it out

From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Hodgess, Erin
Sent: Saturday, December 29, 2012 12:29 AM
To: r-sig-geo@r-project.org
Subject: [R-sig-Geo] using rasterize

Hello again:

I'm trying to rasterize a spatial points data frame and I seem to be missing 
something, as seen below:



 str(loc3)
Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots
  ..@ data   :'data.frame':477 obs. of  6 variables:
  .. ..$ ID  : num [1:477] 1 2 3 5 6 8 9 10 10 13 ...
  .. ..$ lonmin  : num [1:477] 141 112.9 -85.9 -106.6 -91.2 ...
  .. ..$ lonmax  : num [1:477] 153.6 159.1 -85.4 -93.5 -91 ...
  .. ..$ latmin  : num [1:477] -37.5 -54.8 38 25.8 30.4 ...
  .. ..$ latmax  : num [1:477] -28.16 -9.22 38.38 36.5 30.56 ...
  .. ..$ location: Factor w/ 275 levels NSW,Australia,..: 1 2 3 5 6 8 9 10 
10 13 ...
  ..@ coords.nrs : int [1:2] 3 2
  ..@ coords : num [1:477, 1:2] -31.3 -25.3 38.3 32 30.5 ...
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] lat lon
  ..@ bbox   : num [1:2, 1:2] -37.8 -159.6 62.3 175.3
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : chr [1:2] lat lon
  .. .. ..$ : chr [1:2] min max
  ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. ..@ projargs: chr NA
 rasterize(loc3,field=location,fun=count,na.rm=TRUE)
Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘rasterize’ for signature 
‘SpatialPointsDataFrame, missing’


Do you have any ideas, please?  Could it be that the proj4string is NA, do you 
think, please?

Thanks,
Erin



[[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] averaging X of specific Y (latitude)

2012-12-15 Thread Hodgess, Erin
Hi!

Is it a data frame, please?

Have you tried the table function or cut function?

Sincerely,
Erin


From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on 
behalf of Elaine Kuo [elaine.kuo...@gmail.com]
Sent: Saturday, December 15, 2012 10:15 PM
To: r-h...@r-project.org; r-sig-geo
Subject: [R-sig-Geo] averaging X of specific Y (latitude)

Hello



I have a table describing butterfly range traits.

It is composed of three columns as below



Species name  range size (X)latitude of range midpoint (Y)



There are 11 kinds of butterflies.

Each has its range size, and the latitude of each range midpoint ranges
from 9 to 19.

I would like to have the average range size of every degree of latitude.

For example, the average range size of latitude degree 10 (10.0-10.99:
Butterfly A2, B1, B2)

Please kindly help with R code to calculate the average values.

Thank you.


Elaine


The details are as followed.



Butterfly A1  130.5 9.45

Butterfly A2  450.68   10.2

Butterfly A3  1102.389.3

Butterfly A4893.34 16.4

Butterfly B1   820.2   10.54

Butterfly B2872.2   10.87

Butterfly B3488.2   16.79

Butterfly B4620.11 18.3

Butterfly B5982.78 12.98

Butterfly C1   720.32 12.67

Butterfly C2912.2   18.07

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


  1   2   >