Displaying 8 results from an estimated 8 matches for "spatialpixels".
2008 Jul 01
2
Are centre coordinates or upper left corners used of x, y for SpatialPixels?
...of the satellite
image pixels. I'm asking this because some software packages use the
upper left corner of a pixel as a reference.
require(sp)
# --> Create GRID and image in R
S <- SpatialPoints(cbind(spatial["x"], spatial["y"]), proj4string =
proj)
SP <- SpatialPixels(S, proj4string = proj, tolerance = 5e-07)
GRID <- SpatialPixelsDataFrame(points = SP , tolerance = 5e-07, data
= spatial[columnname])
proj4string(GRID) <- proj
gridded(GRID)
nr <- 30
zaxis <- c(0.7, 1)
plot(as(GRID, "Spatial"), axes=T)
title(ma...
2009 Aug 16
1
How to use your own data in gstat and sp?
This seems pretty basic, but I can't get any data to work except for the
documented examples. When the goal is to get to SpatialPixels, here is what
I see...
> x <- runif(10,1,10)
> y <- runif(10,1,10)
> z <- rnorm(10,0,1)
> MyData <- as.data.frame(cbind(x,y,z))
> library(gstat)
> coordinates(MyData) <- ~x + y
> gridded(MyData) <- TRUE
suggested tolerance minimum: 0.893182669294186
Error in...
2012 Feb 23
1
using shapefiles in adehabitat/ converting shapefile to spatial pixel data frame
...shapefile to a spatial pixel data frame using the sp package by exporting the data from the attribute table in my depth shapefile then importing it into R as a csv file (see my attempts below)
>depth<-read.csv("depthmap.csv")
>pts = depth[c("x", "y")]
>y = SpatialPixels(SpatialPoints(pts))
suggested tolerance minimum: 1
Error in points2grid(points, tolerance, round) :
dimension 1 : coordinate intervals are not constant
> depth<-read.csv("a.csv")
> coordinates(depth) <- c("x", "y")
> points2grid(depth)
suggested toler...
2008 Aug 07
0
3d kriging et al
...rface (I've made a 2-d grid of ground surface values), reverse the log-transformation, and ultimately estimate the total mass of hydrocarbons in the soil.
Here's what I've gathered from the supporting documentation:
- need to cast the 3-d expected concentration values into sp's SpatialPixelsDataFrame class in order to make any irregular subsets of the rectangular grid.
- subsetting the grid probably involves use of "[ ...]"
Here's my code so far:
library(RODBC)
library(gstat)
options(digits = 10)
channel = odbcDriverConnect("")
sqlTables(channel)
PAHdata &...
2012 Sep 22
0
timeIsInterval function not found
...;- reshape(ds, varying=list(1:4), v.names="ndv", direction="long",
times=dts, ids=1:dims[1])#traspone le misure in colonne separate dello
stesso record in misure ripeture in record diversi
library(spacetime)
timeIsInterval(dts) <- TRUE
stNDVF <- STFDF(as(ndv_gambia, "SpatialPixels"), dts, df)
library(RColorBrewer)
Grns <- brewer.pal(7, "Greens")
--
View this message in context: http://r.789695.n4.nabble.com/timeIsInterval-function-not-found-tp4643906.html
Sent from the R help mailing list archive at Nabble.com.
2007 Dec 12
1
How to plot the grid figure using R?
Now I have the forest plot data with x, y locations, and I measured the DBH for every indivicuals.
The data looks like that:
x=runif(100,0,100)
y=runif(100,0,100)
dbh=runif(100,1,100)
rdata=data.frame(x,y,dbh)
> rdata[1:5,]
x y dbh
1 99.5354145 1.412844 34.10112
2 0.8259361 87.737036 39.12914
3 6.5678613 65.699032 22.55990
4 67.2987881 72.053877 45.83978
5 2.2491372
2006 Mar 21
1
Getting polygons from contiguous grid cells having same value in sp
I have been using the sp package to deal with gridded data. I would
like to know how to extract the vertices (x,y) of polygons that outline
areas of like-valued cells in a grid. Here is a simple 3x3 grid:
2 2 1
1 2 1
1 1 3
x <- c(1,1,1,2,2,2,3,3,3) # define a 3 x 3 array of points
y <- c(1,2,3,1,2,3,1,2,3)
h <- SpatialPoints(cbind(x,y)) # make these an sp object of the points
2009 Jul 16
2
Problems generating image from tiff file
I imported the attached tiff file and converted the coordinate system to
long lat and graphed it:
californiatiff<- readGDAL("california1.tif")
proj4string(californiatiff)
> rasterprojection <- spTransform(californiatiff, CRS("+proj=longlat")
however, when using the plot command for rasterprojection, I get a blob. I
can see the outline of the state of california and