Freddy López | 1 Oct 05:25 2009
Picon

Creating borders.-

Hello folks,

I'm working with geostatistics data and I'm using mainly geoR library.
Now, in some examples, is useful to use the 'borders' to delimitate
our kriging process, e.g., in the krige.conv() function. To steal a
Ribeiro & Diggle's example
(http://leg.ufpr.br/geoR/tutorials/aula050819.R), we have some lines
such as

>Ksat.in <- krige.conv(Ksat, loc=grid0, borders=Ksat$borders,krige=krige.control(obj=Ksat.ef))
>image(Ksat.in, col=gray(seq(1, 0.1, l=21)))

in which is nice to have Ksat$borders because we can have our
prediction inside of these borders (and it looks better).

Now, suppose we have an object of the class geodata but it has not got borders.

We can visualisate I'm saying with a little modification of latter example

> Ksat.in <- krige.conv(coords=Ksat$coords,data=Ksat$data, loc=grid0,krige=krige.control(obj=Ksat.ef))
> image(Ksat.in, col=gray(seq(1, 0.1, l=21)))

which looks as an rectangle with no reference to something.

That's my problem: I have an object of the class geodata (indeed, is a
worked shapefile, because I'm treating with counties) and I have done
all good up to the kriging stage because I don't know how to extract
or create borders. I mean, I can get a rectangular kriging, but it is
not the aim.

(Continue reading)

Freddy López | 1 Oct 05:39 2009
Picon

Creating borders.-

Hello folks,

I'm working with geostatistics data and I'm using mainly geoR library.
Now, in some examples, is useful to use the 'borders' to delimitate
our kriging process, e.g., in the krige.conv() function. To steal a
Ribeiro & Diggle's example
(http://leg.ufpr.br/geoR/tutorials/aula050819.R), we have some lines
such as

>Ksat.in <- krige.conv(Ksat, loc=grid0, borders=Ksat$borders,krige=
krige.control(obj=Ksat.ef))
>image(Ksat.in, col=gray(seq(1, 0.1, l=21)))

in which is nice to have Ksat$borders because we can have our
prediction inside of these borders (and it looks better).

Now, suppose we have an object of the class geodata but it has not got
borders.

We can visualisate I'm saying with a little modification of latter example

> Ksat.in <- krige.conv(coords=Ksat$coords,data=Ksat$data,
loc=grid0,krige=krige.control(obj=Ksat.ef))
> image(Ksat.in, col=gray(seq(1, 0.1, l=21)))

which looks as an rectangle with no reference to something.

That's my problem: I have an object of the class geodata (indeed, is a
worked shapefile, because I'm treating with counties) and I have done
all good up to the kriging stage because I don't know how to extract
(Continue reading)

Tom Gottfried | 1 Oct 12:37 2009
Picon

Re: Creating borders.-

Hi Freddy,

to add borders to an object of class geodata just add them as an  
element to the list (class geodata basically is a list):

obj$borders <- border.polygon

border.polygon here must match coordinates as described in ?polygon,  
if I remember correctly.

regards,
Tom
Pilar Tugores Ferra | 1 Oct 17:32 2009
Picon

curious about 4D interpolations


Dear list,
I just was wondering about sofware to perform 4D interpolations.
I've never tried and I'm probably not going to try it in the short time or but I was asked to give (informal)
advice about it and also I was curious.
I have heard GRASS gis can do that and also I've heard about EONFUSION which is a Miriax software. I would like
to know if anybody has tried 4D interpolations with this or other softwares and what was your impression.
Is it user friendly? Is it flexible? Nice layouts? Is it really interpolating in 4D or it just allow 4D representations?
Thanks a lot!
Cheers,
Pilar

Mª Pilar Tugores Ferrà
PhD Student
Instituto Español de Oceanografía
Centro Oceanográfico de Baleares
Muelle de Poniente s/n
07015 Palma de Mallorca
Baleares, España
Telf.: (34) 971 133759

La información contenida en este e-mail y sus ficheros adjuntos es totalmente confidencial y no debería
ser usado si no fuera usted alguno de los destinatarios. Si ha recibido este e-mail por error, por favor
avise al remitente y bórrelo de su buzón o de cualquier otro medio de almacenamiento.   This email is
confidential and should not be used by anyone who is not the original intended  recipient. If you have
received this e-mail in  error please inform the sender and delete it from  your mailbox or any other storage mechanism.
Tom Gottfried | 1 Oct 21:25 2009
Picon

Re: Creating borders.-

Hi Freddy,

from where do you want to extract the information to which spatial  
extent you want to interpolate? A shapefile with field borders? You  
could also digitalize any polygon with locator(). Anyhow the borders  
are not a priori in your data.

regards,
Tom

Am 01.10.2009 um 20:20 schrieb Freddy López:

> Thanks for your answer, Tom.
>
> Yes, each geodata object is basically a list, and I can add the border
> as you mention but, I haven't got these borders. I just have got a
> geodata object with coordinates and data but with no borders. My
> question is if I can extract or create a border with a object with
> these features.
>
> Again, thanks you.
>
>
> On Thu, Oct 1, 2009 at 06:07, Tom Gottfried  
> <tom.gottfried <at> wzw.tum.de> wrote:
>> Hi Freddy,
>>
>> to add borders to an object of class geodata just add them as an  
>> element to
>> the list (class geodata basically is a list):
(Continue reading)

Henrique Dallazuanna | 1 Oct 21:41 2009
Picon

Re: Creating borders.-

Try the chull function to create a border.

On Thu, Oct 1, 2009 at 12:39 AM, Freddy López <freddy.vate01 <at> gmail.com> wrote:
> Hello folks,
>
> I'm working with geostatistics data and I'm using mainly geoR library.
> Now, in some examples, is useful to use the 'borders' to delimitate
> our kriging process, e.g., in the krige.conv() function. To steal a
> Ribeiro & Diggle's example
> (http://leg.ufpr.br/geoR/tutorials/aula050819.R), we have some lines
> such as
>
>
>>Ksat.in <- krige.conv(Ksat, loc=grid0, borders=Ksat$borders,krige=
> krige.control(obj=Ksat.ef))
>>image(Ksat.in, col=gray(seq(1, 0.1, l=21)))
>
>
> in which is nice to have Ksat$borders because we can have our
> prediction inside of these borders (and it looks better).
>
> Now, suppose we have an object of the class geodata but it has not got
> borders.
>
> We can visualisate I'm saying with a little modification of latter example
>
>
>> Ksat.in <- krige.conv(coords=Ksat$coords,data=Ksat$data,
> loc=grid0,krige=krige.control(obj=Ksat.ef))
>> image(Ksat.in, col=gray(seq(1, 0.1, l=21)))
(Continue reading)

Pierre Roudier | 2 Oct 01:39 2009
Picon

Re: Creating borders.-

Freddy,

You can also try the getpoly() function from the splancs package as a more
flexible way to do it.

library(sp)
library(splancs)

plot(meuse$x,meuse$y,type='p',pch='+')
bound <- getpoly()
bound <- rbind(bound,bound[1,]) # Closes the polygon coordinates
bound.bis.poly <- Polygon(bound.bis) # Creates a spatial polygon
class(bound.bis.poly)

In case anybody would be interested, I've slightly modified the getpoly()
function to have the choice of the width and colour of the polygon lines
when drawing the border, as I didn't get how to pass those options to the
getpoly() function:

my.getpoly <- function(
quiet = FALSE, # Verbose option
col='red', # Colour of the lines
lwd=2 # Width of the lines
){
  require(splancs)
  if (!quiet) {
    cat(" - Enter field boundary points with mouse button 1\n")
    cat(" - Finish with mouse button 2\n")
    cat(" - Don't try to join the polygon up, it is done for you.\n\n")
  }
(Continue reading)

Don MacQueen | 2 Oct 06:52 2009

Put polygon points in correct order

I have a set of points that form a polygon, except that they are in 
the wrong order. For example, source into R the object "tmpsub" given 
below. Then do

plot(tmpsub)
polygon(tmpsub)

You will see that although the points define a polygon, they are in 
the wrong order.

I need an algorithm to put them in the correct order. It's not 
obvious to me how to do this.
(They will then be used to build a SpatialPolygons object.)

Suggestions, or pointers to algorithms, would be much appreciated.

-Don

## defines a two column matrix
tmpsub <-
structure(c(-337.739799897238, 184.995108083333, 191.915187666667,
191.915187666667, 185.349158666667, 185.326133441305, -21.0945178333333,
-21.2232635, -132.491705916667, -132.620451583333, -339.418178666667,
-387.149289912409, -413.426281562044, -414.136470525547, -338.146251430657,
-337.739799897238, -338.613951361612, -283.102594633440, -283.102594633440,
-182.623434321894, -182.623434321894, -126.691537012447, -128.515403229060,
-40.3618694261276, -40.3618694261276, 42.9280211325047, 44.1439319435797,
129.865644124362, 129.865644124362, 185.815172793583, -338.613951361612,
126.309002505437, 107.131313166667, 107.195686, 87.8194631666667,
87.8194631666667, -172.925954755075, -173.0192575, -223.745050166667,
(Continue reading)

Barry Rowlingson | 2 Oct 09:27 2009
Picon

Re: Put polygon points in correct order

On Fri, Oct 2, 2009 at 5:52 AM, Don MacQueen <macq <at> llnl.gov> wrote:
> I have a set of points that form a polygon, except that they are in the
> wrong order. For example, source into R the object "tmpsub" given below.
> Then do
>
> plot(tmpsub)
> polygon(tmpsub)
>
> You will see that although the points define a polygon, they are in the
> wrong order.
>
> I need an algorithm to put them in the correct order. It's not obvious to me
> how to do this.
> (They will then be used to build a SpatialPolygons object.)
>
> Suggestions, or pointers to algorithms, would be much appreciated.

 For the points you gave us I can see several ways of making a
non-self-intersecting polygon. Along the top, for example, you could
either have squares or triangles. Do you have any other constraints?
It looks to me like you only want horizontal and vertical lines in
your polygons. Is that so? That might make a unique  solution
possible...

Barry
Breitbach, Nils | 2 Oct 09:44 2009
Picon
Picon

Determine the location of the actual R-file

Dear community,

this time my question has something to do with with spatial context but not in the sense we discuss it usually
here. I tried to find out if it is possible to ask R for the location (path) of the R-file from which I send the
code. What I want to ensure is, that the R code works, no matter where I move the folder with all the
necesssary files to. There are some ways to code the location relative to an environment variable (like
R.home) but I need the location independent of the directory where R is installed since this is not equal on
every users' maschine.

Is there a way to ask R for the path of the r-file from which the line is sent?

I hope that you have some ideas for me ...
Cheers,

Nils

Gmane