Re: [R-sig-Geo] Extract vs Zonal: Efficient method to extract and averaging values from large raster datasets using polygons

2016-10-31 Thread ping yang
Have you think about whether if the result of the extract function in the raster library compare to the result from other GIS software? I found some weird result when I compared it to the result from Zonal Statistic from arcGIS and qGIS. I was wondering there were some wrong with the raster::extrac

Re: [R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread ping yang
I also found issues with the raster::extract function, for some reason, I got crazy values when I compared the resulting value with the one from QGIS(Zonal Statistics Plugin) and ArcGIS(zonal statistics), while the value from qgis and arcgis were close but the raster::extract has a lot of disturban

Re: [R-sig-Geo] Flow Accumulation Algorithm

2015-11-18 Thread ping yang
I used this code before and it works, see the link: http://hydrology.usu.edu/taudem/taudem5/TauDEMRScript.txt Also you may check this link ( http://gis.stackexchange.com/questions/84694/flow-accumulation-in-r) in stackexchange. Hope it helps. Peter On Wed, Nov 18, 2015 at 9:35 AM, André Bertonc

Re: [R-sig-Geo] mapView: basic interactive viewing of spatial data in R

2015-07-24 Thread ping yang
Hi Tim, I installed the packages with the hints (with devtools and leaflet library) successfully, however, when I tried to run the code from http://environmentalinformatics-marburg.github.io/web-presentations/20150723_mapView.html I got issues: First, the error came for meuse_rst <- stack(meuse.g

Re: [R-sig-Geo] rainfall interpolation using ANN

2014-12-02 Thread ping yang
Hi Nahm Lee and R-sig-geo, I am quite interested in the IDW interpolation comparing to other methods such as Krige, I have a code like this which I think also did the IDW: library(gstat) library(maptools) library(raster) dat71 <- readShapePoints("d:/FireDanger/IDW/71stations.shp") bubble(dat71,"V

Re: [R-sig-Geo] issue in using projectRaster in raster library

2014-04-14 Thread ping yang
ond for 10 files, almost 15 second/per file. This is significant! I appreciated your patience and effort for make R really powerful. Thanks to you all for the help. Cheers, Ping On Thu, Apr 10, 2014 at 5:20 PM, Jonathan Greenberg wrote: > Responses below: > > On Thu, Apr 10

Re: [R-sig-Geo] issue in using projectRaster in raster library

2014-04-10 Thread ping yang
UM_THREADS=ALL_CPUS to parallelize the operation -- in > gdalUtils, this would be: > > gdalwarp(...,multi=TRUE,wo="NUM_THREADS=ALL_CPUS") > > # See: http://lists.osgeo.org/pipermail/gdal-dev/2012-June/033084.html > > If you are trying to warp a LOT of images, you can also u

Re: [R-sig-Geo] issue in using projectRaster in raster library

2014-04-08 Thread ping yang
its default settings (1e+08 cells on my machine -- about 750mb > of RAM usage if each cell is 64 bits), and 2) adjust the chunk size to > maybe 250mb (3e+07 cells) If you leave your settings like that, > particularly on Windows, you'll end up with out-of-memory crashes > fairly

Re: [R-sig-Geo] issue in using projectRaster in raster library

2014-04-07 Thread ping yang
gt; --j > > On Mon, Apr 7, 2014 at 3:30 PM, Alex Zvoleff > wrote: > > On Mon, Apr 7, 2014 at 4:05 PM, ping yang > wrote: > > > >> Dear r-sig-geo, > >> > >> I plan to reproject from lonlat to UTM for a bunch of 10 meter NED files > >>

[R-sig-Geo] issue in using projectRaster in raster library

2014-04-07 Thread ping yang
Dear r-sig-geo, I plan to reproject from lonlat to UTM for a bunch of 10 meter NED files (large) using a R script(I did it successfully for the 30 meter DEM), I used the following code to run: rasterOptions(chunksize = 1e+10, maxmemory = 1e+12) #need to allow bigger chunksize for the processing!!

[R-sig-Geo] Extract time series value for a given coodinate from an unusual NetCDF file

2014-02-24 Thread ping yang
Hi r-sig-geo, previously I used following code to extract time series value for a given coodinate from a netcdf file: require(raster) require(ncdf) require(sp) X1 <- -90.5167 Y1 <- 33.45 MS <- cbind(X1,Y1) p <- SpatialPoints(MS) year <- 1981 setwd("e:/PRISM/NetCDF/") filename <

Re: [R-sig-Geo] How to parallize my code?

2014-02-03 Thread ping yang
to a rasterbrick > > object. > > c) Use the over function and do an overlay between the points and the > > rasterbrick. You will get a SpaitalPointsDataFrame object, with the > > data associated to each point. > > d) Save the data into a single file. > > > > This shou

Re: [R-sig-Geo] How to parallize my code?

2014-02-02 Thread ping yang
Hi, The purpose is to generate weather information(tmin,tmim,prcp) for every 4 KM (every 4KM there is a point represent that grid) for 32 years throughout Contingent U.S. I want to run several states simultaneously which I want it run them parallel. Thanks, Ping On Sun, Feb 2, 2014 at 1:45 PM,

[R-sig-Geo] How to parallize my code?

2014-02-02 Thread ping yang
Hi r-sig-geo, I am using the following script to extraction weather information for each point (from a rasterized shapefile for the COUS) which generate about 460,000 files: Originally I read the coordinates from a shapefile: Library(rgdal) pl <- readOGR(".","US_2_points") then I used the

Re: [R-sig-Geo] Small bug in raster reading a NetCDF?

2013-05-25 Thread ping yang
na, IL 61801 > > Phone: 217-300-1924 > > http://www.geog.illinois.edu/~jgrn/ > > AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307, Skype: jgrn3007 > > > > [[alternative HTML version deleted]] > > > > ___ > > R-sig-G

Re: [R-sig-Geo] Raster comparrison

2013-05-15 Thread ping yang
uot;),varname='tavg') a <-raster(paste("prcp.3MIN.1981-2010_yearmean_NE.nc ",set=""),varname='prcp') a <- as.matrix(a) b <- as.matrix(b) emd2d(a, b) This function runs forever to finish (and it used up the memory). Thanks, Ping -- Ping Yang, Ph.

Re: [R-sig-Geo] Raster comparrison

2013-05-14 Thread Ping Yang
...@krugs.de (Rainer M. Krug) wrote: > Ivailo writes: > >> On Mon, May 13, 2013 at 8:13 PM, ping yang wrote: >>> Dear Ivailo, >>> >>> Is this method can be used to quantify the spatial variability of two >>> raster grids? Or Is there other measurement

Re: [R-sig-Geo] Raster comparrison

2013-05-13 Thread ping yang
Dear Ivailo, Is this method can be used to quantify the spatial variability of two raster grids? Or Is there other measurement will be better to do this? Previously I posted a topic on how to compare two grids regarding to see the difference on spatial variabilities(e.g. two temperature grids). I

[R-sig-Geo] Spatial Variability Analyses on gridded climate data

2013-05-03 Thread Ping Yang
Dear r-sig-geo, I have gridded surface data for precipitation, temperature in the format of netcdf for different sources(different downscaling methods), and I want to know which one preserve the spatial variability of original data(at a coarser resolution) best. Is there a function or method can

[R-sig-Geo] R Package for Climatology particular for netCDF file

2013-03-26 Thread ping yang
generate a file and then use ncdf funcitons to read and then plot. Thanks, Ping -- Ping Yang, Ph.D. CUNY Environmental Crossroads Initiative The City College of New York - CUNY [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R

[R-sig-Geo] Plot several BoxPlots

2013-03-26 Thread ping yang
Hi R users, I saw a plot like this: [image: Inline image 1] I am wondering how to generate this plot (especially plotting the three items for each season), Can anyone here give me some hints/instructions on this plot? Thanks and Regards, -- Ping Yang, Ph.D. CUNY Environmental Crossroads

[R-sig-Geo] Spatiotemporal inquiry

2013-02-25 Thread ping yang
Dear R, I have a question for conducting a spatio-temporal inquiry, suppose I have a time series of air temperature data for 100 years for my domain, can I perform a inquiry like this " *How many days are there temperature above 40 degree *(CC) and get all these days", I noticed there are evolving

Re: [R-sig-Geo] SpatioTemporal CRAN task view

2013-01-28 Thread ping yang
Hi, The spatio-temporal tasks are spectacular! Can they bundled in a library or in one package? Actually, if the tasks can be imported into ncdf or Rnetcdf (which is natively a space-time data), that will be extremely useful. Thanks, Ping On Mon, Jan 28, 2013 at 2:45 PM, Edzer Pebesma < edzer

Re: [R-sig-Geo] Zonal Statistics as Table

2013-01-24 Thread ping yang
Hi, Is this zonal function works on NetCDF file? Ping [[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] Spatial Statistics for NetCDF files in R

2013-01-03 Thread ping yang
over all the spatial area like gridboxmean, monmean in cdo) 2) do some zonal statistics (like in the GIS Zonal statistics) together with a shape file or mask. Looking forward to your suggestions. Best Regards Ping -- Ping Yang, Ph.D. CUNY Environmental Crossroads Initiative Marshak Science Building

Re: [R-sig-Geo] "regridding" netCDF?

2012-10-23 Thread ping yang
ing for your input data (in the next version of raster, it is > attempted to automate that). > > Robert > > On Thu, Oct 18, 2012 at 7:47 PM, ping yang wrote: > >> Hi R user, >> >> I want to do a transform (re-projection) from a Lambert Conformal Conic >>

Re: [R-sig-Geo] "regridding" netCDF?

2012-10-18 Thread ping yang
gt; than willing to reuse :-) but am wondering where to look. > > Your coding recommendations are appreciated, as would be pointers to > helpful resources. Thanks in advance, and feel free to forward, > Tom Roche > > ___ > R-sig-Geo

[R-sig-Geo] Aggregate time series grid data temporally

2012-03-10 Thread ping yang
Hi, I am a newbie of R, I have time series (6 hours) weather data(represented as muti-layer grids), what I plan to do is to aggregate these grids temporally(from 6 hours to daily), Can I do it with R? some instructions or suggestions? Thanks, Ping -- Ping Yang, Ph.D. Postdoctoral