Re: [R] diffusing GIS data in maps

2007-08-14 Thread Paul Hiemstra
Hi Lawrence,

You could use the gstat (geostatistics) package to perform an 
interpolation, it also requires the package sp. It offers inverse 
distance interpolation and several forms of kriging. Making an 
interpolation would look something like:

library(gstat) # Also loads sp
coordinates(geocode) = ~LAT + LONG  # make a spatial object out of 
geocode
grid = spsample(geocode, type = "regular", n = 1000)   # make a map of 
target locations.
# Regular grid. n is the number 
of cells, increase this for more detail in the resulting map
gridded(grid) = TRUE # Identifying this object as a grid
interpolated = krige(VALUE ~ 1, geocode, grid)   # Do inverse distance 
interpolation, data is 'geocode', target locations are 'grid'.
spplot(interpolated, "var1.pred", sp.layout = list("sp.points", 
geocode))   # Plot the predictions (grid) and the points (geocode)

hope this helps,

Paul

Lawrence D. Brenninkmeyer schreef:
> Hi-
>
> I am trying to find a way to diffuse GIS data on a European map. I have a
> dataset consisting of particular locations scattered across Europe,
> along with magnitude and value information. I can plot these as discrete
> points with something like the following:
>
> "geocode" is a dataframe with four columns: LAT; LONG; MAGNITUDE;VALUE.
>
> library(maps)
> library(mapdata)
> map("worldHires", regions=c("Germany", "Belgium", "Netherlands"))
> points(geocode$LONG, geocode$LAT, cex=geocode$MAGNITUDE / 2500,
> col=rainbow(length(geocode$VALUE), start=0, end=.4)[rank(geocode$VALUE)])
>
> This gives me a map of Europe with my datapoints highlighted in two ways:
> magnitude is represented by the size of the point, and value is
> represented by the color.
>
> However, what I would really like is for there to be some sort of
> diffusion, such that instead of discrete points, the European map is
> covered in color so I can see more clearly whether there are regional
> patterns (something that will presumably look like this contour chart:
>   only
> on the European map).
>
> I have absolutely no idea where to start because I can't find a function
> that will allow me to diffuse the datapoints on a map.
>
> thank you for any help
> ldb
>
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +31302535773
Fax:+31302531145
http://intamap.geo.uu.nl/~paul

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] diffusing GIS data in maps

2007-08-14 Thread Felix Andrews
Package akima allows simple 2D interpolation from points to a grid.


On 8/14/07, Lawrence D. Brenninkmeyer <[EMAIL PROTECTED]> wrote:
> Hi-
>
> I am trying to find a way to diffuse GIS data on a European map. I have a
> dataset consisting of particular locations scattered across Europe,
> along with magnitude and value information. I can plot these as discrete
> points with something like the following:
>
> "geocode" is a dataframe with four columns: LAT; LONG; MAGNITUDE;VALUE.
>
> library(maps)
> library(mapdata)
> map("worldHires", regions=c("Germany", "Belgium", "Netherlands"))
> points(geocode$LONG, geocode$LAT, cex=geocode$MAGNITUDE / 2500,
> col=rainbow(length(geocode$VALUE), start=0, end=.4)[rank(geocode$VALUE)])
>
> This gives me a map of Europe with my datapoints highlighted in two ways:
> magnitude is represented by the size of the point, and value is
> represented by the color.
>
> However, what I would really like is for there to be some sort of
> diffusion, such that instead of discrete points, the European map is
> covered in color so I can see more clearly whether there are regional
> patterns (something that will presumably look like this contour chart:
>   only
> on the European map).
>
> I have absolutely no idea where to start because I can't find a function
> that will allow me to diffuse the datapoints on a map.
>
> thank you for any help
> ldb
>
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Felix Andrews / 安福立
PhD candidate
Integrated Catchment Assessment and Management Centre
The Fenner School of Environment and Society
The Australian National University (Building 48A), ACT 0200
Beijing Bag, Locked Bag 40, Kingston ACT 2604
http://www.neurofractal.org/felix/
voice:+86_1051404394 (in China)
mobile:+86_13522529265 (in China)
mobile:+61_410400963 (in Australia)
xmpp:[EMAIL PROTECTED]
3358 543D AAC6 22C2 D336  80D9 360B 72DD 3E4C F5D8

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] diffusing GIS data in maps

2007-08-14 Thread Vladimir Eremeev

Hi. 
You will find some useful information in the 
  http://r-spatial.sourceforge.net/ 

Particularly, Fig. 07 in the Graph gallery.

Package spmaps can be used to extract desired boundaries from the mapdata
and convert them to the format suitable for sp and others.


Lawrence D. Brenninkmeyer wrote:
> 
> Hi-
> 
> I am trying to find a way to diffuse GIS data on a European map. I have a
> dataset consisting of particular locations scattered across Europe,
> along with magnitude and value information. I can plot these as discrete
> points with something like the following:
> 
> "geocode" is a dataframe with four columns: LAT; LONG; MAGNITUDE;VALUE.
> 
> library(maps)
> library(mapdata)
> map("worldHires", regions=c("Germany", "Belgium", "Netherlands"))
> points(geocode$LONG, geocode$LAT, cex=geocode$MAGNITUDE / 2500,
> col=rainbow(length(geocode$VALUE), start=0, end=.4)[rank(geocode$VALUE)])
> 
> This gives me a map of Europe with my datapoints highlighted in two ways:
> magnitude is represented by the size of the point, and value is
> represented by the color.
> 
> However, what I would really like is for there to be some sort of
> diffusion, such that instead of discrete points, the European map is
> covered in color so I can see more clearly whether there are regional
> patterns (something that will presumably look like this contour chart:
>   only
> on the European map).
> 
> 

-- 
View this message in context: 
http://www.nabble.com/diffusing-GIS-data-in-maps-tf4265350.html#a12141809
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] diffusing GIS data in maps

2007-08-13 Thread Lawrence D. Brenninkmeyer
Hi-

I am trying to find a way to diffuse GIS data on a European map. I have a
dataset consisting of particular locations scattered across Europe,
along with magnitude and value information. I can plot these as discrete
points with something like the following:

"geocode" is a dataframe with four columns: LAT; LONG; MAGNITUDE;VALUE.

library(maps)
library(mapdata)
map("worldHires", regions=c("Germany", "Belgium", "Netherlands"))
points(geocode$LONG, geocode$LAT, cex=geocode$MAGNITUDE / 2500,
col=rainbow(length(geocode$VALUE), start=0, end=.4)[rank(geocode$VALUE)])

This gives me a map of Europe with my datapoints highlighted in two ways:
magnitude is represented by the size of the point, and value is
represented by the color.

However, what I would really like is for there to be some sort of
diffusion, such that instead of discrete points, the European map is
covered in color so I can see more clearly whether there are regional
patterns (something that will presumably look like this contour chart:
  only
on the European map).

I have absolutely no idea where to start because I can't find a function
that will allow me to diffuse the datapoints on a map.

thank you for any help
ldb

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.