search for: spatialpoints

Displaying 20 results from an estimated 37 matches for "spatialpoints".

2008 Jul 15
1
code reduction (if anyone feels like it)
...89, 33.373043), nrow=1) RM185 <- matrix(c(-81.941, 33.3453), nrow=1) RM179 <- matrix(c(-81.890929, 33.317914), nrow=1) RM148 <- matrix(c(-81.7547337, 33.1514072), nrow=1) RM119 <- matrix(c(-81.501919, 32.94038), nrow=1) RM61 <- matrix(c(-81.262388, 32.524739), nrow=1) RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat +datum=WGS84")) d060101 <- as.POSIXct("2006-01-01", tz="EST") study_seq <- seq(from=d060101, length.out=761, by="days") up.215 <- sunriset(RM215.sp, study_seq, direction="sunrise", POSIXct.out=TRUE) dow...
2007 Jan 17
1
sp: proj4string has no impact
...t;CRS class argument") e.g.: CRS("+proj=aea +lat_1=46 +lat_2=73 +lat_0=60 +lon_0=84 +x_0=0 +y_0=0 +ellps=clrk66 +units=m +no_defs") doesn't have any impact on the plotted object. I also tested the simple example: xy = cbind(x = 2 * runif(100) - 1, y = 2 * runif(100) - 1) plot(SpatialPoints(xy, proj4string = CRS("+proj=longlat")),xlim=c(-1,1),ylim=c(-1,1)) looks exactly like plot(SpatialPoints(xy, proj4string =CRS("+proj=stere +lon_0=98 +over")) or plot(SpatialPoints(xy)) without any projection. What I'm doing wrong? I use the latest versions of sp and...
2017 Jun 30
0
Unit of cellsize in 'ascgen' from adehabitatMR? Spatialpoints unit?
Hello dear all, A simple understanding question but I cannot find the answer anywhere. I use coordiates (longitude, latitude) in my study. I created a SpatialPoints class from those data and then I created a grid using the 'ascgen' command in the package 'adehabitatMR' like: ascgen(xy,cellsize=40). It worked out fine and my analysis is doing great. But I don't know what unit the 'cellsize' is. Is it the area (squaremeter), or th...
2012 Jun 05
2
Converiting longitude/latitude to utm
Dear all, I have been trying to convert coordinates from longitude/latitude to utm but I got an error. As soon as the longitude coordinate is greater than 90, I get the folloowing error message: "error in pj_transform: latitude or longitude exceeded limits" Here is what I did: SP<-SpatialPoints(cbind(126.59,-14.30),proj4string=CRS("+proj=longlat")) coordinatesUTM<-spTransform(SP,CRS("+proj=utm")) Error in spTransform(SP, CRS("+proj=utm")) : error in pj_transform: latitude or longitude exceeded limits Can someone explain me what I did wrong? I am using...
2008 Aug 19
4
converting coordinates from utm to longitude / latitude
Hi, is there a function in R to convert data read with read.shape and which is originally in UTM coordinates into longitude / latitude coordinates? I found the convUL() function from the PBSmapping package but I have no idea how I could apply that to the read.shape object. Many thanks, Werner __________________________________________________ Do sragenden Schutz gegen Massenmails.
2012 Oct 18
1
spTransform longlat to utm
...in km. I am applying spTransform (package rgdal) and it gives my some curious results. An example. Let's take a point lying somewhere in Germany, zone=32U x <- 8.968735 y <- 49.454735 After conversion I sould get something like Easting: 426858 (km) Northing: 5427937 (km) sp1 <- SpatialPoints(matrix(c(x,y), ncol=2), proj4string = CRS("+proj=longlat +datum=WGS84")) sp1Transformed <- spTransform(sp1, CRS("+proj=merc +zone=32u +datum=WGS84")) coordinates(sp1Transformed) coords.x1 coords.x2 [1,] 998395.0133 6319888.068 The result is an obvious nonsense....
2005 Jun 09
1
Using transform on spproj package.
Hi, I'm trying to use transform my mercator locations into utm but I'm doing something wrong because only x is transformed ... see > xy.sp SpatialPoints: loni lati [1,] -8.85 38.16 [2,] -9.19 37.99 [3,] -9.11 37.97 [4,] -9.06 38.15 [5,] -9.03 37.87 [6,] -9.14 37.81 [7,] -9.09 37.70 [8,] -8.95 37.45 [9,] -9.17 37.37 [10,] -9.00 37.34 Coordinate Reference System (CRS) arguments: +proj=merc +datum=WGS84 > transform(xy.sp...
2010 Oct 12
2
Memory limit problem
...ws XP.? I have pasted the error message and summaries of the objects below.? Thanks for your help.? Tim >???? xyz<-cbind(hi.to.utm,z=b.depth$z) Error: cannot allocate vector of size 240 Kb > memory.limit() [1] 4000 > memory.size() [1] 1971.68 > summary(hi.to.utm) Object of class SpatialPoints Coordinates: ??????? min?????? max x? 708745.5? 923406.7 y 2046153.1 2327910.9 Is projected: TRUE proj4string : [+proj=utm +zone=4 +datum=NAD83 +ellps=GRS80 +towgs84=0,0,0] Number of points: 15328 > str(hi.to.utm) Formal class 'SpatialPoints' [package "sp"] with 3 slots ? ..@...
2010 Jul 20
2
data from SpatialGridDataFrame
Dear All, I have a raster map of the class 'SpatialPointsDataFrame' and coordinates of the class 'SpatialPoints'. I would like to retrieve the values that are contained in the raster map at the specific locations given by the coordinates. Can anyone help me out? Kind regards, Katrin Fleischer
2008 Jul 15
2
POSIXct extract time
RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat +datum=WGS84")) d060101 <- as.POSIXct("2006-01-01", tz="EST") study_seq <- seq(from=d060101, length.out=761, by="days") up.215 <- sunriset(RM215.sp, study_seq, direction="sunrise", POSIXct.out=TRUE) dow...
2006 Mar 21
1
Getting polygons from contiguous grid cells having same value in sp
...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 class h$z<- c(1,1,2,1,2,2,1,1,3) # add field values gridded(h) <- T # make it a grid How could I get the vertices for the region of value=2 cells? Here is what they would be, in clockwise order from the upper left corner: (0,3) (2,3) (2,...
2008 Jul 01
2
Are centre coordinates or upper left corners used of x, y for SpatialPixels?
...e GRID? In this script; spatial["x"] & spatial["y"] are the centre coordinates 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)...
2010 Jul 02
2
S4 classes and debugging - Is there a summary?
...: 0x04daf14c> Methods may be defined for arguments: object, xy Use showMethods("xyValues") for currently available ones. > showMethods("xyValues") Function: xyValues (package raster) object="Raster", xy="data.frame" object="Raster", xy="SpatialPoints" object="Raster", xy="vector" object="RasterLayer", xy="matrix" object="RasterStackBrick", xy="matrix" And now...? Is there an overview that actually explains how you get the information you're looking for without strolling thro...
2017 May 12
1
spTransform
...wever, keeps giving me the wrong results. For what it's worth, it only seems to be messing up the latitude. My final line of code looks like this: pointsTransformed <- spTransform(pointsutm, CRS("+proj=longlat +datum=WGS84 +zone=36S")) The line before looks like: pointsutm <- SpatialPoints(cbind(pointsmapspatial$Point_Y, pointsmapspatial$Point_X), proj4string = CRS("+proj=utm +zone=36S +ellps=GRS80") Can you see what I did wrong? [[alternative HTML version deleted]]
2013 Apr 24
1
extract function extracting only NA values
...and there are no NA values where I am extracting. I have also plotted the spatial point class on top of the raster in R and it does correspond to the correct locations. These are some of the commands I am using, and as I already pointed out that works perfectly with other raster files. sp<-SpatialPoints(xysp) xy$rasterimg<-extract(rasterimg,sp) Can anyone help? At this point I am rather clueless about this. Thanks
2011 Jan 05
1
Prediction error for Ordinary Kriging
...box(rsa2) cs <- c(1, 1) cc <- bb[, 1] + (cs/2) cd <- ceiling(diff(t(bb))/cs) rsa2_grd <- GridTopology(cellcentre.offset = cc,cellsize = cs, cells.dim = cd) getClass("SpatialGrid") p4s <- CRS(proj4string(rsa2)) x2_SG <- SpatialGrid(rsa2_grd, proj4string = p4s) x2_SP <- SpatialPoints(cbind(x2$X, x2$Y)) v <- variogram(log1p(tsport_ace) ~ 1, x2, cutoff=100, width=9) te<- fit.variogram(v,vgm(0.0437, "Exp", 26, 0)) y <- krige(tsport_ace~1, x2, x2_SG, model = ve.fit) spplot(y, 1, col.regions = bpy.colors(100), sp.layout = list("sp.lines",as(rsa2, "...
2006 Apr 25
3
persp plot increasing 'x' and 'y' values expected
hello, i do the following in order to get an persp-plot x<-c(2,2,2,2,2,2,3,3,3,3) y<-c(41,41,83,83,124,166,208,208,208,208) z<-c(90366,90366,92240,92240,92240,96473,100995,100995,100995,100995) x<-data$x y<-data$y z<-matrix(data$z,length(y),length(x)) persp(x,y,z, col="gray") but i always get the error message increasing 'x' and 'y' values expected,
2010 Jun 21
2
Return value associated with a factor
...county=double(0), tract=double(0)) dbs.in <- cbind(dbs.in,more.columns) #fiure out how many times to loop j <- nrow(dbs.in) #loop through each lab/long and assign census tract for (i in 1:j) { index<-overlay(SpatialPoints(cbind(dbs.in$Lon[i],dbs.in$Lat[i])),florida.tract) save.tract<-florida.tract[index,] dbs.in$state[i] <- save.tract$state #this is returning the position in the list instead of the value dbs.in$county[i] <- save.tract$county #this is returning the position in the...
2012 Feb 23
1
using shapefiles in adehabitat/ converting shapefile to spatial pixel data frame
...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 tolerance minimum:...
2012 Sep 02
1
why variations in accuracy between R to ARCGIS for the same point reprojection?
...e can be up to 40 km in the poles. Basically, I have a database of points equally separated by one degree over the globe. In ARCGIS, I am projecting the data in GCS-WGS-1984 and then reprojected it to Berhmann to ensure equal area distribution of the points. In R, I am using: spPoint <- SpatialPoints(coords=coordinates(Data),proj4string=CRS("+proj=longlat +datum=WGS84")) and then reprojecting it to Berhmann with: spPointReprj=spTransform(Data,CRS("+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +ellps=WGS84")) If I put the two outputs of the reprojections in the same map, t...