Dear All, I would like to ask which might be the best manner to introduce a first order autocorrelation function in a GLMM model in order to account for temporal autocorrelation effects in a temporal series dataset, using package Lme4 (function lmer, Laplace approach) or glmmPQL functions (penalized quasi likelihood), Many thanks in advance My best Jofre --- El mié, 9/9/09, r-sig-geo-request@stat.math.ethz.ch escribió: De: r-sig-geo-request@stat.math.ethz.ch Asunto: R-sig-Geo Digest, Vol 73, Issue 9 Para: r-sig-geo@stat.math.ethz.ch Fecha: miércoles, 9 septiembre, 2009 12:00 Send R-sig-Geo mailing list submissions to     r-sig-geo@stat.math.ethz.ch To subscribe or unsubscribe via the World Wide Web, visit     https://stat.ethz.ch/mailman/listinfo/r-sig-geo or, via email, send a message with subject or body 'help' to     r-sig-geo-request@stat.math.ethz.ch You can reach the person managing the list at     r-sig-geo-owner@stat.math.ethz.ch When replying, please edit your Subject line so it is more specific than "Re: Contents of R-sig-Geo digest..." Today's Topics:    1. decimate points from a Lidar file (Michael Denslow)    2. Re: decimate points from a Lidar file (Dylan Beaudette)    3. Re: decimate points from a Lidar file (Kenneth Takagi)    4. Re: decimate points from a Lidar file (Roger Bivand)    5. Re: How to achieve the boundary of a polygon? (Shaofei Chen)    6. Re: decimate points from a Lidar file (Michael Denslow)    7. creating a grid from a contour vector shape (Alexandre VILLERS)    8. Re: Producing ENFA derived suitability maps with    adehabitat       (Tomislav Hengl) ---------------------------------------------------------------------- Message: 1 Date: Tue, 8 Sep 2009 11:25:51 -0400 From: Michael Denslow Subject: [R-sig-Geo] decimate points from a Lidar file To: r-sig-geo Message-ID:     Content-Type: text/plain; charset=ISO-8859-1 Dear R-sig-geo, I am posting the following question for one of my professors. I would appreciate it if you could help me point him in the right direction. He is looking for a function which could take a lidar point shapefile and decimate (remove) a selected number of points from the file. Below is what he asked me. The file of the merged LIDAR tiles contains roughly 350,000,000 points. "I am looking for some software to take a shapefile of lidar elevation points and remove a selected number of points. The shapefile (with fewer points) would then be used to generate a DEM. A calculation of the appropriate resolution for a DEM can be made based on a relationship between the number of points and extent of the study area. The goal is to create DEMs at a series of resolutions with the appropriate points to area relationship. So a software program with which you could remove a selected number of lidar points would be helpful." I imagine that one of the packages that deals with point data (e.g. sp, spatstat) can do this kind of thing but I am not sure how to get him started. Can anyone point me to a specify function or make a suggestion. Thanks in advance, Michael -- Michael Denslow Graduate Student I.W. Carpenter Jr. Herbarium [BOON] Department of Biology Appalachian State University Boone, North Carolina U.S.A. -- AND -- Communications Manager Southeast Regional Network of Expertise and Collections sernec.org ------------------------------ Message: 2 Date: Tue, 8 Sep 2009 09:06:12 -0700 From: Dylan Beaudette Subject: Re: [R-sig-Geo] decimate points from a Lidar file To: r-sig-geo@stat.math.ethz.ch Message-ID: <200909080906.12965.dylan.beaudette@gmail.com> Content-Type: text/plain;  charset="iso-8859-1" On Tuesday 08 September 2009, Michael Denslow wrote: > Dear R-sig-geo, > > I am posting the following question for one of my professors. I would > appreciate it if you could help me point him in the right direction. > > He is looking for a function which could take a lidar point shapefile > and decimate (remove) a selected number of points > from the file. Below is what he asked me. The file of the merged LIDAR > tiles contains roughly 350,000,000 points. > > "I am looking for some software to take a shapefile of lidar elevation > points and remove a selected number of points. The shapefile > (with fewer points) would then be used to generate a DEM. A > calculation of the appropriate resolution for a DEM can be made based > on a relationship between the > number of points and extent of the study area. The goal is to create > DEMs at a series of resolutions with the appropriate points to area > relationship. So a > software program with which you could remove a selected number of > lidar points would be helpful." > > I imagine that one of the packages that deals with point data (e.g. > sp, spatstat) can do this kind of thing but I am not sure how to get > him started. Can anyone point me to a specify function or make a > suggestion. > > Thanks in advance, > Michael Hi, I would recommend the r.in.xyz command within GRASS GIS. It can be used for operations very similar to what you are looking for. The resulting file is a raster, decimated to some set resolution. Some screen shots: http://hamish.bowman.googlepages.com/grassfiles#xyz Cheers, Dylan -- Dylan Beaudette Soil Resource Laboratory http://casoilresource.lawr.ucdavis.edu/ University of California at Davis 530.754.7341 ------------------------------ Message: 3 Date: Tue, 8 Sep 2009 13:17:26 -0400 From: Kenneth Takagi Subject: Re: [R-sig-Geo] decimate points from a Lidar file To: Message-ID: Content-Type: text/plain Dylan Beaudette ucdavis.edu> writes: > > On Tuesday 08 September 2009, Michael Denslow wrote: > > Dear R-sig-geo, > > > > I am posting the following question for one of my professors. I would > > appreciate it if you could help me point him in the right direction. > > > > He is looking for a function which could take a lidar point shapefile > > and decimate (remove) a selected number of points > > from the file. Below is what he asked me. The file of the merged LIDAR > > tiles contains roughly 350,000,000 points. > > > > "I am looking for some software to take a shapefile of lidar elevation > > points and remove a selected number of points. The shapefile > > (with fewer points) would then be used to generate a DEM. A > > calculation of the appropriate resolution for a DEM can be made based > > on a relationship between the > > number of points and extent of the study area. The goal is to create > > DEMs at a series of resolutions with the appropriate points to area > > relationship. So a > > software program with which you could remove a selected number of > > lidar points would be helpful." > > > > I imagine that one of the packages that deals with point data (e.g. > > sp, spatstat) can do this kind of thing but I am not sure how to get > > him started. Can anyone point me to a specify function or make a > > suggestion. > > > > Thanks in advance, > > Michael > > Hi, > > I would recommend the r.in.xyz command within GRASS GIS. It can be used for > operations very similar to what you are looking for. The resulting file is a > raster, decimated to some set resolution. Some screen shots: > > http://hamish.bowman.googlepages.com/grassfiles#xyz > > Cheers, > Dylan > hi, I did something similar (with a MUCH smaller LIDAR dataset) a while back to randomly remove data points, but it probably can be modified to remove specific points as well.  I didn't know about r.in.xyz, so you should check that out first.  Note: This method most likely will a very long time with the large dataset you have (mine was ~ 100,000 points). I first converted the raw .las file to a text file with data in columns. This can be done using las2txt on the following website (there are others out there as well): http://www.cs.unc.edu/~isenburg/lastools/ Or outputting the shapefile as an ascii (with each point as a row). Once in .txt format, I read in the points to R: dat <- read.table("lidarpts.txt", header=TRUE, sep="", na.strings = "NA") n.rm <- nrow(dat)*(0.5)  # Change multiplier to adjust number of points to # keep.  This will keep half the points. n.rand <- floor(runif(n.rm, 1, nrow(dat)))  # Vector of length n.rm containing # random numbers between 1  and the number of rows in the .txt file. newdat <- dat[n.rand,]  # Selects only the rows specified in n.rand.  This # matrix would contain half the data points of the original, chosen at random. # Save this as a .txt file, import into ArcGIS, and then interpolate surface. HTH, Ken _________________________________________________________________ Hotmail® is up to 70% faster. Now good news travels really fast. S:WM_HYGN_faster:082009     [[alternative HTML version deleted]] ------------------------------ Message: 4 Date: Tue, 8 Sep 2009 20:36:27 +0200 (CEST) From: Roger Bivand Subject: Re: [R-sig-Geo] decimate points from a Lidar file To: dylan.beaudette@gmail.com Cc: r-sig-geo@stat.math.ethz.ch Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 8 Sep 2009, Dylan Beaudette wrote: > On Tuesday 08 September 2009, Michael Denslow wrote: >> Dear R-sig-geo, >> >> I am posting the following question for one of my professors. I would >> appreciate it if you could help me point him in the right direction. >> >> He is looking for a function which could take a lidar point shapefile >> and decimate (remove) a selected number of points >> from the file. Below is what he asked me. The file of the merged LIDAR >> tiles contains roughly 350,000,000 points. >> >> "I am looking for some software to take a shapefile of lidar elevation >> points and remove a selected number of points. The shapefile >> (with fewer points) would then be used to generate a DEM. A >> calculation of the appropriate resolution for a DEM can be made based >> on a relationship between the >> number of points and extent of the study area. The goal is to create >> DEMs at a series of resolutions with the appropriate points to area >> relationship. So a >> software program with which you could remove a selected number of >> lidar points would be helpful." >> >> I imagine that one of the packages that deals with point data (e.g. >> sp, spatstat) can do this kind of thing but I am not sure how to get >> him started. Can anyone point me to a specify function or make a >> suggestion. >> >> Thanks in advance, >> Michael > > Hi, > > I would recommend the r.in.xyz command within GRASS GIS. It can be used for > operations very similar to what you are looking for. The resulting file is a > raster, decimated to some set resolution. Some screen shots: > > http://hamish.bowman.googlepages.com/grassfiles#xyz Right, it is not possible to read 350 M points into R and do anything with them. I would actually suggest using a database as a store directly, possibly with some spatial support, but not necessarily. If the data were, say, in a database, subsets could be read in by selecting, or sample inclusion fields could be added to a table for samples, giving the FID values to be chosen. I feel that this would give the flexibility needed. Both SQLite and PostgreSQL are supported by OGR, so may also be accessed from rgdal functions if the appropriate drivers are present, but dumping to CSV files for smaller samples ought to be OK. If you are on Windows, see OSGeo4W or FWTools for ideas. The advantage of a database over a flat text file is that selection is much easier. You could also look at the SQLiteMap package, which uses an alternative set of spatial extensions for SQLite. Import the data outside R, then select from inside (untried). Hope this helps, Roger > > Cheers, > Dylan > > -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand@nhh.no ------------------------------ Message: 5 Date: Tue, 8 Sep 2009 13:39:22 -0500 From: "Shaofei Chen" Subject: Re: [R-sig-Geo] How to achieve the boundary of a polygon? To: "'Edzer Pebesma'" Cc: r-sig-geo@stat.math.ethz.ch Message-ID: <000e01ca30b3$aeb09dd0$0c11d970$@chen@utdallas.edu> Content-Type: text/plain;    charset="ISO-8859-1" Thank you very much. It works for me now. Previously I only looked at the spatstat package. Shaofei -----Original Message----- From: Edzer Pebesma [mailto:edzer.pebesma@uni-muenster.de] Sent: Tuesday, September 08, 2009 1:09 AM To: Shaofei Chen Cc: r-sig-geo@stat.math.ethz.ch Subject: Re: [R-sig-Geo] How to achieve the boundary of a polygon? Have you had a look at spsample in package sp? Shaofei Chen wrote: > Hi, > > I want to randomly sample some points within a polygon. After reading the bounday file to the SpatialPolygonsDataFrame, I found that I can only sample them in the rectangular containing the polygon based on bbox. > > bound <- readShapePoly("bound.shp") > plot(bound) > rand.points=rpoint(100, win=as.owin(c(bound@bbox[1],bound@bbox[3],bound@bbox[2],bound@bbox[4]))) > > Can you help me sample them inside the boundary? > Thanks! > > Best, > Shaofei >     [[alternative HTML version deleted]] > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > 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.springer.com/978-0-387-78170-9 e.pebesma@wwu.de ------------------------------ Message: 6 Date: Tue, 8 Sep 2009 20:42:40 -0400 From: Michael Denslow Subject: Re: [R-sig-Geo] decimate points from a Lidar file To: r-sig-geo Message-ID:     Content-Type: text/plain; charset=ISO-8859-1 Dylan, Ken & Roger, Thank you for the suggestions and advice. This gives me a great place to start. Michael These are all On Tue, Sep 8, 2009 at 2:36 PM, Roger Bivand wrote: > On Tue, 8 Sep 2009, Dylan Beaudette wrote: > >> On Tuesday 08 September 2009, Michael Denslow wrote: >>> >>> Dear R-sig-geo, >>> >>> I am posting the following question for one of my professors. I would >>> appreciate it if you could help me point him in the right direction. >>> >>> He is looking for a function which could take a lidar point shapefile >>> and decimate (remove) a selected number of points >>> from the file. Below is what he asked me. The file of the merged LIDAR >>> tiles contains roughly 350,000,000 points. >>> >>> "I am looking for some software to take a shapefile of lidar elevation >>> points and remove a selected number of points. The shapefile >>> (with fewer points) would then be used to generate a DEM. A >>> calculation of the appropriate resolution for a DEM can be made based >>> on a relationship between the >>> number of points and extent of the study area. The goal is to create >>> DEMs at a series of resolutions with the appropriate points to area >>> relationship. So a >>> software program with which you could remove a selected number of >>> lidar points would be helpful." >>> >>> I imagine that one of the packages that deals with point data (e.g. >>> sp, spatstat) can do this kind of thing but I am not sure how to get >>> him started. Can anyone point me to a specify function or make a >>> suggestion. >>> >>> Thanks in advance, >>> Michael >> >> Hi, >> >> I would recommend the r.in.xyz command within GRASS GIS. It can be used >> for >> operations very similar to what you are looking for. The resulting file is >> a >> raster, decimated to some set resolution. Some screen shots: >> >> http://hamish.bowman.googlepages.com/grassfiles#xyz > > Right, it is not possible to read 350 M points into R and do anything with > them. I would actually suggest using a database as a store directly, > possibly with some spatial support, but not necessarily. If the data were, > say, in a database, subsets could be read in by selecting, or sample > inclusion fields could be added to a table for samples, giving the FID > values to be chosen. I feel that this would give the flexibility needed. > Both SQLite and PostgreSQL are supported by OGR, so may also be accessed > from rgdal functions if the appropriate drivers are present, but dumping to > CSV files for smaller samples ought to be OK. If you are on Windows, see > OSGeo4W or FWTools for ideas. The advantage of a database over a flat text > file is that selection is much easier. > > You could also look at the SQLiteMap package, which uses an alternative set > of spatial extensions for SQLite. Import the data outside R, then select > from inside (untried). > > Hope this helps, > > Roger > > > >> >> Cheers, >> Dylan >> >> > > -- > Roger Bivand > Economic Geography Section, Department of Economics, Norwegian School of > Economics and Business Administration, Helleveien 30, N-5045 Bergen, > Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 > e-mail: Roger.Bivand@nhh.no > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > -- Michael Denslow Graduate Student I.W. Carpenter Jr. Herbarium [BOON] Department of Biology Appalachian State University Boone, North Carolina U.S.A. -- AND -- Communications Manager Southeast Regional Network of Expertise and Collections sernec.org ------------------------------ Message: 7 Date: Wed, 09 Sep 2009 09:49:36 +0200 From: Alexandre VILLERS Subject: [R-sig-Geo] creating a grid from a contour vector shape To: Aide R SIG GEO ,     hzambran.newsgroups@gmail.com, Markus Neteler Message-ID: <4AA75E10.3070400@cebc.cnrs.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Thank you for your messages. I wasn't very clear in my post but both answers will be usefull... Best regards Alex -- Alexandre Villers PhD Student Team "Biodiversity" Centre d'Etudes Biologiques de Chiz?-CNRS UPR1934 79360 Beauvoir sur Niort Phone +33 (0)5 49 09 96 13 Fax   +33 (0)5 49 09 65 26 __________ Information from ESET Mail Security, version of virus signature database 4408 (20090908) __________ The message was checked by ESET Mail Security. http://www.eset.com ------------------------------ Message: 8 Date: Wed, 9 Sep 2009 10:27:31 +0200 From: "Tomislav Hengl" Subject: Re: [R-sig-Geo] Producing ENFA derived suitability maps with     adehabitat To: "'Alexandre VILLERS'" ,    "'Aide R     SIG GEO'" Message-ID: Content-Type: text/plain;    charset="windows-1250" Dear Alexandre, I think that this should be doable. Once you run the ENFA to estimate the habitat model, copy the values of new rasters (future habitat) and replace the original values in the "" object. Then simply re-run the predict.enfa method e.g.: # prepare the dataset for ENFA: > beidata <- data2enfa(as.kasc(list(dem=import.asc("dem.asc"), grad=import.asc("grad.asc"), twi=import.asc("twi.asc"), achan=import.asc("achan.asc"))), bei.sub.pnt@coords) # run ENFA: > enfa.bei <- enfa(dudi.pca(beidata$tab, scannf=FALSE), beidata$pr, scannf=FALSE, nf=2) # same area, new environmental conditions: > beidata.new <- data2enfa(as.kasc(list(dem=import.asc("dem_new.asc"), grad=import.asc("grad_new.asc"), twi=import.asc("twi_new.asc"), achan=import.asc("achan_new.asc"))), [[elided Yahoo spam]] > enfa.bei.new <- enfa(dudi.pca(beidata.new$tab, scannf=FALSE), beidata.new$pr, scannf=FALSE, nf=2) # copy the model parameters fitted previously: > enfa.bei.new$m <- enfa.bei$m > enfa.bei.new$s <- enfa.bei$s > enfa.bei.new$lw <- enfa.bei$lw > enfa.bei.new$li <- enfa.bei$li > enfa.bei.new$co <- enfa.bei$co > enfa.bei.new$mar <- enfa.bei$mar > bei.dist.new <- predict(enfa.bei.new, beidata.new$index, beidata.new$attr) ....something like this (I am not really sure which parameters do you have to copy, but the $tab data.frame certainly needs to be replaced with new predictors). Let me know if it works. cheers, T. Hengl http://spatial-analyst.net/wiki/index.php?title=Species_Distribution_Modelling > -----Original Message----- > From: r-sig-geo-bounces@stat.math.ethz.ch [mailto:r-sig-geo-bounces@stat.math.ethz.ch] On Behalf > Of Alexandre VILLERS > Sent: Monday, September 07, 2009 9:31 AM > To: Aide R SIG GEO; r-sig-ecology@r-project.org > Subject: [R-sig-Geo] Producing ENFA derived suitability maps with adehabitat > > Dear list(s) 'members, > > I have a dataset representing the position of a species over a large > region for 3 different years (2000, 2004 and 2008) and seven > ecogeographical variables. Given that the study takes place on an > agricultural region, the landscape changes every year at fine scale and > there is a long term trend in crops sowed, leading me to account for > between years variability. > I would like to use the niche determined by the landscape and location > of birds in 2000 and then, appply this niche over the landscape in 2004 > and 2008 (this would, I believe, give me a first answer on whether > changes in birds' location are due to a decrease in habitat suitability > or birds). > I have already computed ENFA with adehabitat (using the doc provided > with the package "adehabitat" and the www.spatial-analyst.net of T. > Hengl) but I don't see how exactly using the result of an ENFA on a > "new" landscape... > > Any link or help would be welcome. > > Alex > > -- > Alexandre Villers > PhD Student > Team "Biodiversity" > Centre d'Etudes Biologiques de Chiz?-CNRS UPR1934 > 79360 Beauvoir sur Niort > > Phone +33 (0)5 49 09 96 13 > Fax   +33 (0)5 49 09 65 26 > > > > > __________ Information from ESET Mail Security, version of virus signature database 4401 > (20090906) __________ > > The message was checked by ESET Mail Security. > http://www.eset.com > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo ------------------------------ _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo End of R-sig-Geo Digest, Vol 73, Issue 9 **************************************** [[alternative HTML version deleted]]