Re: [R-sig-Geo] Making web-repository of gridded maps: NetCDF or WKT Raster?

2009-12-13 Thread Edzer J. Pebesma
Dear Tom, as your grids are spatial grids, you may want to look into the web service standards of the OGC (www.opengeospatial.org) for them, WCS (for reading) and WCS-T (for writing) in particular. We're experimenting with this currently, using the recently open sourced rasdaman software (www

Re: [R-sig-Geo] R packages to performs geospatial analisys.

2009-09-17 Thread Edzer J. Pebesma
Massimo, I would at least include those on the Spatial task view, at http://cran.r-project.org/web/views/Spatial.html and merge the full list there with your list. In your list, for instance, geoR and geoRglm are missing. -- Edzer Massimo Di Stefano wrote: Hi, i'm working on a live-dvd linux

Re: [R-sig-Geo] spplot(), SpatialGridDataFrame

2007-11-19 Thread Edzer J. Pebesma
Ingo Holz wrote: > Hi, > > I have a SpatialGridDataFrame and want to plot it with spplot(). > > Is it possible to plot only the grids that have a special value (eg. 312)? > fullgrid(x) = FALSE spplot(x[x$value == 312,"value"] Note that if fullgrid(x) is TRUE, x[rows,cols] would select on row

Re: [R-sig-Geo] semi-transparent layer with image()

2007-11-16 Thread Edzer J. Pebesma
Although not specifically related to r-sig-geo, I'll comment a bit - I wouldn't delete part of the cells, but rather define the transparency bit in the color. You can do that, e.g. by > rgb(1,0,0,0.5) [1] "#FF80" you'll get half transparent red. Note that you need a device that supports t

Re: [R-sig-Geo] SpatialGridDataFrame to netcdf grid

2007-11-13 Thread Edzer J. Pebesma
Sebastian P. Luque wrote: > On Mon, 12 Nov 2007 23:29:59 +0100 (CET), > Roger Bivand <[EMAIL PROTECTED]> wrote: > > [...] > > >> Then the fallback is to write a GTiff, and use gdal_translate to convert >> it (one of the gdal utilities that build with the GDAL shared >> object). If the same probl

Re: [R-sig-Geo] SpatialGridDataFrame to netcdf grid

2007-11-12 Thread Edzer J. Pebesma
On linux, you should have the netCDF driver istalled; from gdalDrivers() I see (on debian etch): name long_name create copy 42netCDF Network Common Data Format FALSE TRUE Then, reading the documentation of writeGDAL: 'create2GDAL' c

Re: [R-sig-Geo] spplot -> sp.layout -> sp.text - only one "text" at the same time?

2007-11-11 Thread Edzer J. Pebesma
Ingo, that makes sense. I committed a change to sp (in cvs), such that something like spplot(meuse["zinc"],sp.layout=list("sp.text",coordinates(meuse),1:155)) works (although the plot of course does not make much sense) It will be in the next release. -- Edzer Ingo Holz wrote: > Hi, > > I am

Re: [R-sig-Geo] spplot legends for each subplot

2007-11-11 Thread Edzer J. Pebesma
... and I can't reproduce it under Linux, where "Ingo's title" happily appears. I guess r-help would be the right place to ask this question. Remove the ".../" before outfile.png, so it might run straight away. -- Edzer Ingo Holz wrote: > Hi, > > it only happens using png(). It does not if I *.

Re: [R-sig-Geo] spplot legends for each subplot

2007-11-09 Thread Edzer J. Pebesma
> after saving this figures with png(). > > Ingo > > > Message: 3 > Date: Thu, 08 Nov 2007 15:00:42 +0100 > From: "Edzer J. Pebesma" <[EMAIL PROTECTED]> > Subject: Re: [R-sig-Geo] spplot legends for each subplot > To: [EMAIL PROTECTED] > Cc: Ingo Ho

Re: [R-sig-Geo] spplot legends for each subplot

2007-11-08 Thread Edzer J. Pebesma
I fully agree with Roger's comment, but you may also want to check the help of ?print.trellis (library lattice), especially its more=, split= and position= arguments. It lets you combine trellis plots on a single page. -- Edzer Roger Bivand wrote: > On Thu, 8 Nov 2007, Ingo Holz wrote: > > >>

Re: [R-sig-Geo] GSTAT - measurement vs microscale variation

2007-10-31 Thread Edzer J. Pebesma
n: > > krige(formula=no2.ppb~traffic, mydata, newdata=mynewdata,model=vgmRaw) > > I'd like to get the WLS or GLS estimate of traffic. > > This back and forth is asking a lot of your time, I really appreciate > your quick replies. Thanks! > > Zev > > Edzer J. Pebe

Re: [R-sig-Geo] GSTAT - measurement vs microscale variation

2007-10-31 Thread Edzer J. Pebesma
et=0.05, add.to=vgm(.05,"Err",0)) > > fit.variogram(variogram(log(zinc)~1,meuse),model=myvgmA) > model psillrange > 1 Nug 0.000 0. > 2 Exp 0.7186526 449.7581 > > > fit.variogram(variogram(log(zinc)~1,meuse),model=myvgmB) > model psill range

Re: [R-sig-Geo] GSTAT - measurement vs microscale variation

2007-10-31 Thread Edzer J. Pebesma
Zev, you can use the "Err" variogram model to denote micro variation as opposed to nugget. The only effect it has is that for a new prediction on an observation location the measurement error-free process is predicted, and not the observation process itself. Semivariance of an observation with

Re: [R-sig-Geo] coordinate precision using rgdal [solved]

2007-10-26 Thread Edzer J. Pebesma
Dylan Beaudette wrote: > On Friday 26 October 2007, Roger Bivand wrote: > >> On Fri, 26 Oct 2007, Dylan Beaudette wrote: >> >>> On Friday 26 October 2007, Roger Bivand wrote: >>> On Fri, 26 Oct 2007, Dylan Beaudette wrote: > Hi, > > noticed that when I

Re: [R-sig-Geo] Barry Rowlingson's "Arlat" on FOSS4G 2007

2007-10-12 Thread Edzer J. Pebesma
I'm sorry I missed this talk Barry, but the slides were a pleasure to go through! What was the argument not to go with OpenEV with communication through Rserve? Thanks, -- Edzer Barry Rowlingson wrote: > Agustin Lobo wrote: > >> Any way of getting the pdf of the talk? I'm interested >> both

Re: [R-sig-Geo] upper bounds for values in color scale in spplot

2007-10-12 Thread Edzer J. Pebesma
Brad, you might want to try to construct one spplot per column, having the scale perhaps horizontally on the bottom, and combing them using the print(..., more = T) on trellis objects (see ?print.trellis in package lattice). An issue might be to get the maps at exactly the same scale, as the pr

Re: [R-sig-Geo] interpolating presence absence data with external drift

2007-10-09 Thread Edzer J. Pebesma
Dear Klaus, there's broadly 2 approaches; one builds on the so-called model-based geostatistics (MBG) approach by Diggle et al 1998 (and in the book by Ribeiro and Diggle), the other uses Pearson residual variogram and covariance matrices that use the variance function for the mean dependent (

Re: [R-sig-Geo] directional semivariograms on the same graph

2007-10-09 Thread Edzer J. Pebesma
Mauricio, it's easier than you think; try Zn.vgm1 <- variogram(Zn~1, jura.pred.xy, alpha=c(22.5, 67.5), cutoff=2, boundaries=c(0.1, 0.2*(1:10)), tol.hor=22.5) plot(Zn.vgm1) # with 2 panels plot(Zn.vgm1, multipanel=FALSE) # in a single panel the add=TRUE does not work as the plot methods for gs

Re: [R-sig-Geo] Monitoring network design optimization

2007-09-21 Thread Edzer J. Pebesma
Zev, package fields contains some optimization codes written by Eric Gilleland. I think it's mainly about optimizing an existent network. -- Edzer Zev Ross wrote: > Hi All, > > Just wondering if anyone knows of any good R scripts/methods for > monitoring network design optimization. I'm interest

Re: [R-sig-Geo] memory Usage setting

2007-09-13 Thread Edzer J. Pebesma
icular advice for setting up the kernel > (or other things) for such a machine (i.e., the PAE kernel)? > > Agus > > Edzer J. Pebesma escribió: >> I think R will never do it's own memory swapping, as that is a >> typical OS task. There are however several developments (p

Re: [R-sig-Geo] memory Usage setting

2007-09-13 Thread Edzer J. Pebesma
I think R will never do it's own memory swapping, as that is a typical OS task. There are however several developments (provided in add-on packages) that will not load all data in memory at start-up, but instead call some data base whenever a data element is needed. You might search r-help for

Re: [R-sig-Geo] Positive Definite Covariance Matrix for Grid Sampled Data

2007-09-12 Thread Edzer J. Pebesma
acing the zero with positive numbers up to 5, with no > luck. > > Anyone have any other ideas? > > Keith > > -----Original Message- > From: Edzer J. Pebesma [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 11, 2007 2:30 PM > To: Keith Dunnigan > Cc: r-

Re: [R-sig-Geo] Positive Definite Covariance Matrix for Grid Sampled Data

2007-09-11 Thread Edzer J. Pebesma
Keith, indeed kriging usually fails when one or more point pairs have zero distance. One solution in terms of distances would be to shift these points a bit, such that no zero distances occur anymore. In terms of the covariances, the solution would be to lower the corresponding off-diagonal en

Re: [R-sig-Geo] geoR Beta Estimates Not Equal to lm Coefficients: Why?

2007-09-02 Thread Edzer J. Pebesma
Joshua, My guess is that to estimate beta geoR uses generalized least squares and lm and SAS ordinary least squares. If you use a pure nugget model, or some other model with a range parameter sufficiently close to zero, i.e. model the observations as independent, the estimates should be the s

Re: [R-sig-Geo] reading spatial coordinates from a database

2007-08-31 Thread Edzer J. Pebesma
Sebastien, a possible way to get your data in R is through the readOGR function in package rgdal that can read from a PostGIS data base. Not being an expert, from your example below it seems that the polygon data are in some PostGIS form, WKT or something like that. You'll find some examples on

Re: [R-sig-Geo] Non-symmetric variogram map in gstat

2007-07-18 Thread Edzer J. Pebesma
David, you may also notice that the map produced does not have a cell centre or cell 'crossing' at (0,0). Of course you'd assume enough cleverness that this would be enforced automatically, but too bad. Try v <- variogram(Ni ~ 1, jura.pred, cutoff=1.8, width=0.18, map=T) (making sure that the

Re: [R-sig-Geo] map algebra with ascii grid

2007-07-16 Thread Edzer J. Pebesma
As Roger mentioned, we did try to make the Spatial*DataFrame objects behave like a data.frame but indeed not with respect to applying direct arithmetric on them. I do agree with Tim that if a is a single-band SpatialGridDataFrame, then a = a + 1 is more straightforward than a$band1 = a$band1

[R-sig-Geo] [R] Plot SpatialLinesDataFrame with xlim & ylim

2007-07-11 Thread Edzer J. Pebesma
Michael, The plot method for SpatialLinesDataFrame objects resides in package sp, and questions regarding it are easier noticed on the r-sig-geo mailing list. The reason why they are plotted with aspect ratio 1 is that they are assumed to be spatial (geographical) data, and assume that 1 m nor

Re: [R-sig-Geo] Cell Declustering

2007-07-10 Thread Edzer J. Pebesma
ugh... :-P > > Have a nice evening! > > stefano > > > Edzer J. Pebesma ha scritto: >> Stefano, >> >> I thought cell declustering meant finding the size of the region of >> influence for an observation and using that as weight in further >>

Re: [R-sig-Geo] Cell Declustering

2007-07-10 Thread Edzer J. Pebesma
Stefano, I thought cell declustering meant finding the size of the region of influence for an observation and using that as weight in further analysis. An approach would be using voronoi diagrams (package deldir, and read the list archives), another using the number of nearest cells based on a

Re: [R-sig-Geo] problem with writeGDAL, its reading as black box in ARcGIS

2007-07-09 Thread Edzer J. Pebesma
Debs, what does gdalinfo sayl about the .tif map? I wouldn't trust Arcmap as the ultimate referee to judge whether a geotiff is sound or not. It may dislike your floating point values, for example. -- Edzer Debarchana Ghosh wrote: > Hello, > > I'm using Windows with 2 GB ram. > > I have created

Re: [R-sig-Geo] [Fwd: SpatialPolygons: Problems with cross overs?]

2007-07-05 Thread Edzer J Pebesma
Agustin, I didn't look at the cross overs, but spplot inside a loop needs an explicit print(spplot(...)) around it to get the result printed (actually plotted); this is a lattice FAQ, spplot wraps xyplot or levelplot in lattice. -- Edzer Agustin Lobo wrote: Dear rsiggeos, After importin

Re: [R-sig-Geo] vector to raster

2007-07-05 Thread Edzer J. Pebesma
Agustin Lobo wrote: > Dear sig-geos, > > is there any way of converting from vector > (imported with rgdal from a shp) to raster > within R? > > Thanks! > > Agus > > Yes, using the classes and methods in sp -- you'd first have to create a grid e.g. with spsample, sampling type regular or makegr

Re: [R-sig-Geo] Best approach to implement Spatial Interpolations

2007-06-27 Thread Edzer J. Pebesma
Cesar Martinez Izquierdo wrote: > Hello list, > we are trying to implement spatial interpolations (IDW and several types > of Kriging) in our open source GIS application, which is written in Java. > > We plan to use JRI to connect with R from Java, and then use the > features of "gstat" R-packag

Re: [R-sig-Geo] Simple and Efficient way to Divide Study Area?

2007-06-26 Thread Edzer J. Pebesma
Kitty Lee wrote: > Hi Roger, I forgot to mention I did try tripack and did go through your > previous post. > > But I'm doing a simulation and I have to repeat the process >1000 times. > > > I feel using the voronoi method to divide up the study area may not be the > most efficient way. I thoug

Re: [R-sig-Geo] distmap

2007-06-25 Thread Edzer J. Pebesma
Roger Bivand wrote: > On Mon, 25 Jun 2007, Agustin Lobo wrote: > >> I've tried (among other things): >>> limit1 <- read.shape("limit_PNSN2000.shp") >> Shapefile type: Polygon, (5), # of Shapes: 2 >>> limit1poly <- Map2poly(limit1) >>> limit1owin <- as(limit1poly,"owin") >> Error in .classEnv(thi

Re: [R-sig-Geo] ODP: ODP: spsample and NA

2007-06-25 Thread Edzer J. Pebesma
0 > NA's :119.0 > > > Y <- SpatialPixels(X) > > summary(Y) > Object of class SpatialPixels > Coordinates: > min max > x 410649.7 415399.7 > y 4607910.5 4610910.5 > Is projected: TRUE > proj4string : [ +proj=utm +zone=31 +ellps=intl +uni

Re: [R-sig-Geo] newbie sp question

2007-06-25 Thread Edzer J. Pebesma
Roger Bivand wrote: > It may also be worth asking on the PostGIS list whether you could upload > your geometries to PostGIS and have GEOS do the measurement - if you have > access to the software and experience with it. It may be that it can > handle geographical coordinates. > I have to be

Re: [R-sig-Geo] ODP: ODP: spsample and NA

2007-06-25 Thread Edzer J. Pebesma
Not only to avoid NAs, but also to get approximately right sample size. Stratified sampling does not take place based on strata defined by attributes (map layers), but rather by dividing the area into square blocks (strata) and randomly sample (n=1) from each block. That is why the resulting sa

Re: [R-sig-Geo] krige.bayes output

2007-06-25 Thread Edzer J. Pebesma
Is it possible to compute them experimentally, by computing the variance of the back-transformed simulations for each prediction location? -- Edzer Paulo Justiniano Ribeiro Jr wrote: > Dear Giovanna > > For certain values of the Box-Cox transformation it is not possible to > compute kriging varia

Re: [R-sig-Geo] Dissolve grids

2007-06-07 Thread Edzer J. Pebesma
If they're SpatialPoints* or SpatialPixels*, use rbind on them. If they're in a SpatialGridDataFrame, first convert to pixels by fullgrid(x) = FALSE then rbind, then back with fullgrid(x) = TRUE hth, -- Edzer Kitty Lee wrote: > Thanks to Terry and Virgilio, I used both suggestions in creating

Re: [R-sig-Geo] gridding

2007-06-05 Thread Edzer J. Pebesma
Thomas, I have seen this error from package gstat before but find it hard to guess what caused it without looking over your shoulder. Please send the script that led to the error. -- Edzer Thomas Szegvary wrote: > Hi there > > I have problems using krige(). I want to do ordinary kriging, but al

Re: [R-sig-Geo] Optimize image plot of a grid with legend - colors - and extras ?

2007-06-04 Thread Edzer J. Pebesma
Jan, I have a clue why this happened. Indeed, > image(input, col=rev(bpy.colors(10)), axes=T) reproduces the example, but > image(input, col=rev(bpy.colors(10))) > axis(1) > axis(2) > box() doesn't. It seems like the col argument is passed to axis, try > axis(1, col = rev(bpy.colors(10))

Re: [R-sig-Geo] [R] Connecting to PostgreSQL/PostGIS from R (rgdal?)

2007-06-02 Thread Edzer J. Pebesma
Mike, my experience with linking R with PostGIS are documented here: http://wiki.intamap.org/index.php/PostGIS which I may have mentioned before on r-sig-geo. Indeed, as Tim confirms, besides the (r)gdal link, (R)ODBC is another working link for transferring table information. I doubt whether i

Re: [R-sig-Geo] Clipping a large image without reading in the entire image

2007-06-02 Thread Edzer J. Pebesma
Andrew Niccolai wrote: > Therefore, does anyone have any solutions for reading in an image >that would work in theory like the following: > >setwd(anypathway) >tif.image <- "VERY_LARGE_IMAGE.tif" >Bounded.tif <- GDAL.open(tif.image, bbox=c(UpL.X, LwR.X, UpL.Y, LwR.Y)) > >By the way, I am not set

Re: [R-sig-Geo] graphical doubts: lines colour, order objects and print in only one graph

2007-05-15 Thread Edzer J. Pebesma
Marta Rufino wrote: > Dear list members, > > > I have three doubts: :-) > > 1. How to colour the lines from a shape file (which has been inserted > into a spplot, through sp.layout): > > #For example > nc <- readShapeLines("costa.shp", proj4string=CRS("+proj=longlat > +datum=WGS84")) > spplot(gr

Re: [R-sig-Geo] variograms do not satisfy a legal model

2007-05-08 Thread Edzer J. Pebesma
m W. Watt > A statistical analysis, properly conducted, is a delicate dissection of > uncertainties, a surgery of suppositions. ~M.J.Moroney > > > > >> -Oorspronkelijk bericht- >> Van: Edzer J. Pebesma [mailto:[EMAIL PROTECTED] >> Verzonden

Re: [R-sig-Geo] variograms do not satisfy a legal model

2007-05-07 Thread Edzer J. Pebesma
Thierry, you'll have to find out what the linear model of regionalization or intrinsic correlation mean; they are legal models, meaning that they lead to predictions with guaranteed non-negative prediction variances. There's a way to override the check (meaning it will not stop on error) but no

Re: [R-sig-Geo] Simulating raster or spatialgriddataframe images

2007-05-03 Thread Edzer J. Pebesma
Andrew, If you want to simulate particular random fields that are Gaussian or binary, described by a second order properties (mean, variogram), then you may want to look into the simulation capabilities of packages RandomFields or gstat. If you want to simulate objects (circles, ellipses, star

Re: [R-sig-Geo] Several gstat variograms on a single page

2007-05-03 Thread Edzer J. Pebesma
Michal, I think (and hope for you) it is not necessary to search the solution at the level of grid. The plot function for variograms in package gstat is a rather (?) thin wrapper around xyplot, so if you carefully read how to control the main and sub arguments of ?xyplot, then you're done: lib

Re: [R-sig-Geo] nkreg in the "fields"

2007-04-27 Thread Edzer J. Pebesma
Please use the on-line documentation that comes with downloaded package; the documentation you used may very well be out of sync with the package fields. If you have questions about the docs in the package, you might want to ask the package developer. -- Edzer Juan Du wrote: > Dear R-helpers, >

Re: [R-sig-Geo] which variogram's sill , nugget and range

2007-04-13 Thread Edzer J. Pebesma
temiz wrote: > hello > > when I create a directional variogram, it usually gives different > shaped variograms according to its direction. > (like this cvgm <- variogram(z ~1, data=el4 ,boundaries = seq(0,2000, by > = 50), alpha=c(0,45,90,135,180,225,270)) ) > > In these cases, which variog

Re: [R-sig-Geo] universal kriging gives error

2007-04-13 Thread Edzer J. Pebesma
temiz wrote: > hello > > when I try universal kriging, it gives this error: > > > v.trend <- variogram(z~x+y,el4) > > new.fit <- fit.variogram(v.trend, vgm(1,"Exp",300,1)) > > krige(el4$z~el4$x+el4$y,el4, model=new.fit, newdata=mask_SG) > Error in gstat.formula.predict(d$formula, newdata, na.act

Re: [R-sig-Geo] (no subject)

2007-04-12 Thread Edzer J. Pebesma
Yong Li wrote: > require(maptools) > > #read in shape file > pts <- readShapePoints(system.file("shapes/baltim.shp", > package="maptools")[1]) > > #define the dimension of grids > x.min <- summary(pts)$bbox[1] > y.min <- summary(pts)$bbox[2] > x.max <- summary(pts)$bbox[3] > y.max <- summary(pts)

Re: [R-sig-Geo] How to randomly select points in a polygon

2007-04-12 Thread Edzer J. Pebesma
You may want to use spsample, or, if you selected the points in the polygon with overlay and want to sample from them, use function sample. It is hard for us to see what you're trying and cannot get without (reproducible) example code. -- Edzer Yong Li wrote: > I want to overlay points with a p

Re: [R-sig-Geo] levelplot gives an error

2007-04-09 Thread Edzer J. Pebesma
perhaps use spplot(OK_pred[1], ...) which would be more or less short for levelplot(var1.pred~x+y, as.data.frame(OK_pred), aspect = "iso", ...) -- Edzer temiz wrote: >hello > >why does levelplot function give an error > >OK_pred <- krige(z~1,el4, newdata=mask_SG, model=efitted) >levelplot(var

Re: [R-sig-Geo] problem in krige function

2007-04-06 Thread Edzer J. Pebesma
large memory footprint -- I moved the zerodist code from R to C. (I needed it myself for a 30.000 point data set this morning.) -- Edzer --- Begin Message --- >>>>> Edzer J Pebesma writes: > This new sp version has a better rbind CRS checking and re-implements > zerodist in C.

Re: [R-sig-Geo] problem in krige function

2007-04-06 Thread Edzer J. Pebesma
it in parts. -- Edzer temiz wrote: > Edzer J. Pebesma wrote: >> temiz wrote: >>> ... >>> I regarded some modifications in >>> http://grass.gdf-hannover.de/wiki/GRASS_6_Tutorial#GRASS_and_R_kriging_interpolation >>> >>> >>> >>&

Re: [R-sig-Geo] [R] how to image.plot a XY grid file into a lat-lon map

2007-04-06 Thread Edzer J. Pebesma
May I suggest you take a look at the Spatial Task View? r-project.org -> CRAN -> Select Mirror -> Task Views -> Spatial. -- Edzer Linda Smith wrote: > Could you please let me know more details about rgval package? I have never > used it before. I only tried image.plot() where if you have regular

Re: [R-sig-Geo] problem in krige function

2007-04-06 Thread Edzer J. Pebesma
temiz wrote: > ... > I regarded some modifications in > http://grass.gdf-hannover.de/wiki/GRASS_6_Tutorial#GRASS_and_R_kriging_interpolation > > I encountered a new problem : > > OK_pred <- krige(z ~ 1, el3, newdata=mask_SG, model=efitted) > [using ordinary kriging] > > "memory.c", line 57: can't

Re: [R-sig-Geo] spplot

2007-04-05 Thread Edzer J. Pebesma
Tim Keitt wrote: >>spplot(beta, "1") >> >> >Error in `[.data.frame`(as(obj, "data.frame"), zcol) : >undefined columns selected > >I can't seem to fix this. Version: 0.9-10 > > > Thought I fixed this -- how about sp 0.9-11 current CRAN version? -- Edzer

Re: [R-sig-Geo] problem in krige function

2007-04-05 Thread Edzer J. Pebesma
temiz wrote: > following the topic GRASS and R kriging interpolation from grass6 tutorial > > I came here without problems > > But here: > > zz <- krige(z ~ 1, locations = el1 , newdata = mask_SG , model = efitted) > Error in predict.gstat(g, newdata = newdata, block = block, nsim = nsim, : >

Re: [R-sig-Geo] error in krig interpolation

2007-04-05 Thread Edzer J. Pebesma
el1 is already a SpatialPointsDataFrame, so omit the locations argument. You may try something as simple as zz <- krige(log(z) ~ 1, el1, mask_SG, efitted) -- Edzer temiz wrote: > when does this error occur ? > > > zz <- krige(formula = log(el1$z) ~ 1, locations = ~x+y , data = el1 > ,newdata

Re: [R-sig-Geo] error in SpatialGridDataFrame

2007-04-05 Thread Edzer J. Pebesma
temiz wrote: > hello > > when I followed the steps of ORDINARY KRIGING IN R WITH GRASS6 DATA in > GRASS 6 Tutorial. > > I encountered this error: > > > mask_SG <- > SpatialGridDataFrame(grd,data=list(k=rep(1,G$cols3*G$rows3)),proj4string=CRS(G$proj4)) > Error in validObject(.Object) : invalid c

[R-sig-Geo] R - PostGIS connectivity

2007-04-03 Thread Edzer J. Pebesma
Dear list members, I've been exploring a bit the possibilities of PostGIS, and accessing its functionality (the GEOS geometry library really) from R. I used writeOGR and readOGR from rgdal to move sp objects in and out the data base, and used sqlQuery from RODBC to do a spatial query on the dat

Re: [R-sig-Geo] spplot: main title layout

2007-03-27 Thread Edzer J. Pebesma
Raffaele, try spplot(x, ..., main=list(label="title",cex=3)) I found this by library(lattice) ?xyplot # search for argument main -- Edzer Raffaele Morelli wrote: > Hi you all, > > probably this is a silly question (I mean I apologize for that in advance :) > ) > > I am using spplot in order to

Re: [R-sig-Geo] spTransform, gridded

2007-03-24 Thread Edzer J. Pebesma
Patrick, the problem is that if you reproject points on a grid, the result is not on a grid anymore, so I think it is correct that spTransform does return a SpatialPointsDataFrame rather than a SpatialGridDataFrame. You would have to shift points to centers on the new grid. The creator function

Re: [R-sig-Geo] agenda for R's Geo capabilities?

2007-03-16 Thread Edzer J. Pebesma
Although I'm interested many of the issues below, and also feel the attraction of the develop-it-ourself, my personal agenda is a bit more modest. Once we start with GEOS support (an idea mentioned every 6 months on this list), the next thing we need for dealing with huge or massive data sets i

Re: [R-sig-Geo] Plotting data with multiple symbols and colours

2007-03-14 Thread Edzer J. Pebesma
I would try the alternative, bubble(Error,maxsize=1.5) bubble(Error,maxsize=1.5, key.entries=-10:10) Doing what you want with spplot, you're basically thrown back at xyplot with asp="iso"; look at how key is formed there; with spplot(Error, pch = ifelse(Error$error < 0, 95, 3), key.space = "rig

[R-sig-Geo] line segments of boundaries

2007-03-14 Thread Edzer J. Pebesma
Hi, Is there an R package/function that, given a set of polygons (say country boundaries) finds the line set of lines that defines the boundary for each pair of neighbouring countries? -- Edzer ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch ht

Re: [R-sig-Geo] converting dataframe to rasterformate

2007-03-08 Thread Edzer J. Pebesma
Paul, that is hard to see from here. Perhaps you could make the points available? Is the grid aligned with x and y? Did something happen with (re)projection inbetween? -- Edzer Paul Magdon wrote: >First of all thank you very much for this comments. > >As you already stated the points have to be

Re: [R-sig-Geo] comparing raster and vector data with Grass/R

2007-03-07 Thread Edzer J. Pebesma
Roger Bivand wrote: > On Wed, 7 Mar 2007, Schmitt Thierry wrote: > > >> I am struggling to overlay spatialLinesDataFrame and >> SpatialGridDataFrame. The overlay method doesn't allow me to do so. >> >> > > There is no overlay method, you would need to write one, or interpolate > points alo

Re: [R-sig-Geo] Drawing circular contours

2007-03-06 Thread Edzer J. Pebesma
Gabor, sp provides a contour method for objects of class SpatialGridDataFrame. I don't know how you should create a grid such that contours are circles -- simplest to generate distances from specific points. I don't know if there is easy way to do this right now; a rather indirect way is to use

Re: [R-sig-Geo] comparing raster and vector data with Grass/R

2007-03-06 Thread Edzer J. Pebesma
Using the classes and methods for spatial data in package sp, typically the dem would be stored in a grid (SpatialGridDataFrame) and the vector data in a SpatialPointsDataFrame. Then you can use the overlay method to retrieve the dem values at point locations, to look at their relationship. -- E

Re: [R-sig-Geo] Which organizations use R for geographic processing?

2007-03-06 Thread Edzer J. Pebesma
All of the partners in the intamap project (http://www.intamap.org/) do, for example. -- Edzer Gabor Grothendieck wrote: > Not sure if this will become an issue but in case I need > it to justify my toolset does anyone have a list of > recognizable organizations that use R for geographic > proces

Re: [R-sig-Geo] LL to UTM

2007-03-06 Thread Edzer J. Pebesma
Gabor, package rgdal provides an interface to the PROJ.4 library for projection of geographical data. Look for the function (or rather method) spTransform. It takes any of the spatial classes provided by package sp, and afaik any of the known projection systems, including UTM and ellipsoids (L

Re: [R-sig-Geo] krige error message: dimensions do not match

2007-03-03 Thread Edzer J. Pebesma
Dagmar, this is hard to tell from here without having something that I can reproduce; my first suggestion would be NA's in the values or coordinates, but you say it is not. Also hard to read your code: is crossvalid a global logical? How can you pass the character vector location.xvalid to the

Re: [R-sig-Geo] search,grids,SA significance test

2007-02-27 Thread Edzer J. Pebesma
Trevor, a few notes in addition to Roger's answer: Trevor Doerksen wrote: > I have two specific questions: > 1) ... > Also, I don't know > how to mask a specific area (like the nice grid in the meuse data set) > of interest within that grid. Depends on where you start. Suppose you have a Spati

Re: [R-sig-Geo] variogram on 3D points with gstat ?

2007-02-23 Thread Edzer J. Pebesma
Matthew, try library(gstat) demo(gstat3D) It doesn't use the sp classes, and in the next version it will be like this: # $Id: gstat3D.R,v 1.4 2006-02-10 19:05:02 edzer Exp $ # simple demo of 3D interpolation of 50 points with random normal values, # randomly located in the unit cube n <- 50 dat

Re: [R-sig-Geo] R vs GSLIB

2007-02-16 Thread Edzer J. Pebesma
Hi Thierry, I think spatstat covers point pattern analysis, which is mostly not covered by gslib. I have seen either no or small differences between gstat and gslib, but never differences that I could not explain. They may for instance relate to how you integrate covariances over a block; ther

Re: [R-sig-Geo] Subsetting a spatial polygon dataframe with a for loop

2007-02-14 Thread Edzer J. Pebesma
I'm not a 100% sure, but it might be that you are using c(sub.cb.poly, i) which creates a list when the arguments are complicated structures. You may wish to use rbind on two (or more!) SpatialPolygonsDataFrame objects instead. Provided you have the latest sp from CRAN... Hth, -- Edzer Andrew

Re: [R-sig-Geo] Map2points() substitute for class "map"

2007-02-12 Thread Edzer J. Pebesma
Roger Bivand wrote: > Would it be sensible to include ProportionalSymbolMap() in maptools? In > fact, it is the legend that is the tough problem, so in fact using the > bubble-plot method in sp may be an easier way forward: > > SPDF <- SpatialPointsDataFrame(coordinates(ill), data=data.frame(x=x)

Re: [R-sig-Geo] facing the bad move: how to retrieve old (sp) data after an upgrade...?

2007-02-07 Thread Edzer J. Pebesma
Perhaps try > [EMAIL PROTECTED]@att[[1]] etc. -- Edzer Horacio Samaniego wrote: > I first need to apologize as I have made a mistake, I know that I > should have read the Breaking News before (http://www.sal.uiuc.edu/ > tools/tools-sum/rgeo/r-spatial-projects) > > Now I am trying to step ba

Re: [R-sig-Geo] Marginless plot output for georegistration of output graphics

2007-01-18 Thread Edzer J Pebesma
David Forrest wrote: >On Wed, 17 Jan 2007, Roger Bivand wrote: >... > > >>>What do I need to to do turn the key off for spplot(SpatialPointsData) ? >>> >>> >>I can't see it, I thought it might be auto.ket=FALSE, but it doesn't seem >>to be that. To be honest, I would feel more comfortable

Re: [R-sig-Geo] sp for R V2.1.0

2007-01-09 Thread Edzer J. Pebesma
David Forrest wrote: > Hi All, > > Does the install.packages('sp') on my R V2.1.0 (Debian Stable) report: > > no package 'sp' at the repositories in: download.packages(pkgs, destdir > = tmpd, available = available > > ... because sp from CRAN depends on "R (>= 2.4.0), methods" ? > > The mac

Re: [R-sig-Geo] random samples of a grid

2007-01-05 Thread Edzer J. Pebesma
Jeff, you may want to have a look at function spsample in package sp. -- Edzer Jeffrey Stratford wrote: > Hi, is there a way to sample an ESRI grid using random sample points? > In the past I used ESRI's spatial analyst but I would like to switch all > my analyses to R if possible. The grid is

Re: [R-sig-Geo] plot methods in sp

2007-01-01 Thread Edzer J. Pebesma
Patrick, I can see this is confusing. Besides methods(plot), try after library(sp) a showMethods(plot) to get an overview of the S4-style plot methods; methods(plot) only shows the S3-style plot methods. Then, class?SpatialPolygons gives methods available for this class, among which plot, and

Re: [R-sig-Geo] Can you query points with a polygon?

2006-12-13 Thread Edzer J. Pebesma
Christoph Hofer wrote: > Hello Kenneth > > In the sp package you find the function "point.in.polygon". > Yes, and a convenient wrapper method, called "overlay" which basically overlays a polygon coverage (SpatialPolygonsDataFrame) with a point coverage (SpatialPointsDataFrame). Try > library

Re: [R-sig-Geo] Can you krige with a nominal response variable

2006-12-07 Thread Edzer J. Pebesma
Ken, The indicator kriging idea does not stop at a single binary variable. The "standard" (or "Stanford"?) way of getting non-negative predictions, and possibly predictions that sum to one is rather pragmatic--simply postprocessing predictions. There is a cleaner solution, called compositional

Re: [R-sig-Geo] krige{gstat} error with new data prediction

2006-11-28 Thread Edzer J. Pebesma
statistical analyst > CSIRO, Sustainable Ecosystems > Davies Laboratory, > University Drive, Douglas, QLD 4814 > Private Mail Bag, Aitkenvale, QLD 4814 > > Phone/www > (07) 4753 8510; 4753 8650(fax) > Home: http://herry.ausbats.org.au > Webadmin ABS: http://ausbats.or

Re: [R-sig-Geo] plot() and Jpeg() increase font size and resolution

2006-11-28 Thread Edzer J. Pebesma
0.9-4" > "0.8-17" > spatial > "7.2-29" > > > Thanks > Herry > > > Dr Alexander Herr > Spatial and statistical analyst > CSIRO, Sustainable Ecosystems > Davies Laboratory, > University Drive, Douglas, QLD 4814 > Private Mail Bag, Aitkenvale, QLD 4814 > > Phone/www >

Re: [R-sig-Geo] plot() and Jpeg() increase font size and resolution

2006-11-26 Thread Edzer J. Pebesma
> > Phone/www > (07) 4753 8510; 4753 8650(fax) > Home: http://herry.ausbats.org.au > Webadmin ABS: http://ausbats.org.au > Sustainable Ecosystems: http://www.cse.csiro.au/ > ------------ > > > -Original Message- > From: Edzer J. Pebesma

Re: [R-sig-Geo] plot() and Jpeg() increase font size and resolution

2006-11-23 Thread Edzer J. Pebesma
plotting variograms in gstat is done through xyplot in lattice; you'll find where it gets it's defaults by library(lattice) trellis.par.get() ?trellis.par.set -- Edzer [EMAIL PROTECTED] wrote: > > Dear list, > > I am having troubles increasing the fontize when plotting a > variogram{gstat} and

Re: [R-sig-Geo] krige{gstat} error with new data prediction

2006-11-23 Thread Edzer J. Pebesma
Herry, in k1<-krige(z ~ x+y, ~x+y, data=shp1, newdata=a1000, model=m2, nmax=40) shpl is alread a SpatialPointsDataFrame object, so you shouldn't specify it's coordinates, ~x+y. Rather, use k1<-krige(z ~ x+y, shp1, a1000, model=m2, nmax=40) I must admit that a more helpful error message would

Re: [R-sig-Geo] Variogram does not plot correctly when using layout()

2006-10-24 Thread Edzer J. Pebesma
Paul, please note that at least 5 R packages calculate variograms, and not everyone can see from your email address which one you are using (gstat). plot is a generic method; to find which instance is called try class(plot(rad_data_vgm,rad_data_mod$sph)) [1] "trellis" so the plot returns is ac

[R-sig-Geo] sp: spplot bug in sp 0.9-2

2006-10-17 Thread Edzer J. Pebesma
Dear spplot users, When spplot is used with the names.attr argument for label placement in the strips, and the names of the variables in zcol are not in alphabetic order, strips will receive the wrong name. I found out only now because apparently I tend to use names in alphabetic order, or just

[R-sig-Geo] complex dependency of gstat on sp, R 2.4.0

2006-10-05 Thread Edzer J. Pebesma
Roger, install.packages("gstat") with 2.4 over a 2.3 library gives me the following: ... ufctr.o sprow.o spswap.o stat.o submat.o userio.o utils.o vario.o vario_fn.o vario_io.o vecop.o version.o writecmd.o xvalid.o -L/usr/lib/R/lib -lR ** R ** data ** demo ** inst ** preparing package for la

Re: [R-sig-Geo] spatial averaging of interpolation data

2006-10-02 Thread Edzer J. Pebesma
Wouter, you could resort to simulation, i.e. generate conditional simulations, compute the catchment aggregated value and obtain their distribution experimentally. If you're after the catchment mean, you better use block kriging for irregular blocks (the catchment). R package gstat provides this.

Re: [R-sig-Geo] Error with krige.cv

2006-10-02 Thread Edzer J. Pebesma
Bertrand, Several causes can lead to a singular covariance matrix; the most common is that you have duplicate observations (i.e. two or more observations on the same location). Use zerodist to find out. -- Edzer bertrand toupin wrote: > Hi everyone, another obstacle towards the achievement :) > >

Re: [R-sig-Geo] (no subject)

2006-09-27 Thread Edzer J. Pebesma
Jacques, the projection functions are now in package rgdal which is on CRAN so should have Mac binaries. Look for the function spTransform. Also, an email I sent to you last night answering a question related to sp bounced; please resend the question to this list. -- Edzer pir2.jv wrote: > I t

  1   2   >