search for: proj4str

Displaying 20 results from an estimated 67 matches for "proj4str".

Did you mean: projstr
2007 Jan 17
1
sp: proj4string has no impact
Hi all, I'm faced with a problem applying the sp package: The projection argument in readShapePoly(Shapefile,proj4string="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) -...
2008 Jul 15
1
code reduction (if anyone feels like it)
...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) down.215 <- sunr...
2009 Oct 28
2
Re ading and Creating Shape Files
...ent by reviewing the results in GIS. A couple things. I cant seem to import a shape file correctly using the maptools package and the readShapeSpatial. I have tried Building=file("data/input/BuildingShape/Building.shp") Bldg<-readShapeSpatial(fn=data/input/BuildingShape/Building,proj4string=NAD83) #---------------------- Bldg<-readShapeSpatial(data/input/BuildingShape/Building,proj4string=NAD83) #--------------- Building=file("data/input/BuildingShape/Building.shp") Bldg<-readShapeSpatial(Building,proj4string=NAD83) I know i am mis interpreting the documentation bu...
2008 Jul 01
2
Are centre coordinates or upper left corners used of x, y for SpatialPixels?
...quot;] 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) nr <- 30 zaxis <- c(0.7, 1) plot(as(GRID, &quo...
2011 Jan 05
1
Prediction error for Ordinary Kriging
....131906111111112 +k=1 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs")) bb <- bbox(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,...
2007 Sep 06
1
write geotiff with projection - RGDAL package
...roduct) i get the warning that the file is missing spatial reference so it cannot be projected, but it is displayed correctly. I guess somewhere i am doing a mistake when i define the projection in R. My code follows: data.grid <- read.csv(x, header=TRUE) gridded(data.grid) = ~East.m.+North.m. proj4string(data.grid) = CRS("+proj=tmerc +lat_0=0.00000000000 +lon_0=-81.00000000000 +k=0.99960000 +x_0=500000.000000 +y_0=0.0000000 +ellps=GRS80 +units=m") tr <- "e:\\JELA_veg\\test_gtiff\\test.tif" writeGDAL(data.grid["class.pca"], tr) mg3 <- readGDAL(tr) proj4string...
2010 Oct 12
2
Memory limit problem
...?? 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 ? ..@ coords???? : num [1:15328, 1:2] 708746 710482 712218 713944 715681 ... ? .. ..- attr(*, "dimnames&quot...
2012 Apr 01
4
map and shapefile help
Hi, I want to use map("state") and have the ecoregion shape (please see link) file projected onto this. ftp://ftp.epa.gov/wed/ecoregions/cec_na/NA_CEC_Eco_Level3.zip ftp://ftp.epa.gov/wed/ecoregions/cec_na/NA_CEC_Eco_Level3.zip Could someone please show me how; I have never messed with this sort of thing. Thanks. -- View this message in context:
2009 Nov 06
4
map of a country and its different geographical levels
Hi R users I need the map of France?s ? communes ? (towns) to build a map Is there a way to get it? More generally: How to do to get the map of a country and its different geographical levels? Best regards -- View this message in context: http://old.nabble.com/map-of-a-country-and-its-different-geographical-levels-tp26225645p26225645.html Sent from the R help mailing list archive at
2012 Jun 05
2
Converiting longitude/latitude to utm
...nvert 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 coordinates of Australia so th...
2011 Nov 04
2
How to write a shapefile with projection
...5 610236.1 ???????? 3375747 ???????????? 8.217 6 610236.1 ???????? 3375746 ???????????? 8.196 ? #Get the projection from a raster ?named llev I have loaded before: crs <- projection(llev) ? # get a spatial point data frame from my data crest.sp <- SpatialPointsDataFrame(try[,1:2], try, proj4string=CRS(crs)) ? summary(crest.sp) Object of class SpatialPointsDataFrame Coordinates: ??????? min?????? ??????? max x? 610235.1? ?????? 610354.1 y 3374862.4 ?????? 3375751.4 Is projected: TRUE proj4string : [+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +towgs84=0,0,0] N...
2012 Oct 18
1
spTransform longlat to utm
...ckage 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. Well, after some deliberation I s...
2013 Mar 19
1
Cokriging
...e. It worked. But this technique not work for cokiriging it gives the same error message. require(gstat) require(automap) data_c <- read.csv("cu_s_data.csv", header=T) grid<- read.csv("grid.csv", header=T) coordinates(data_c) <- ~X+Y+Z coordinates(grid) <- ~x+y+z proj4string(grid)=CRS("+init=epsg:28992") proj4string(data_c)=CRS("+init=epsg:28992") g <- gstat(id = "Cu", formula =Cu~1,data = data_c) g <- gstat(g, id = "S", formula = S~1,data =data_c) g <- gstat(g, id = c("Cu", "S"), model = vgm(cov(d...
2011 Feb 11
1
Extract a slot value from a 'SpatialPolygons' class object
.....@ area : num 11542604 .. ..@ plotOrder : int 1 .. ..@ bbox : num [1:2, 1:2] 706657 -1509411 711710 -1506189 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots .. .. .. ..@ projargs: chr NA I’d like to extract the area value so as to be able to use this value for further analysis. Here’s below what I get when I only type the name of the object: >overlperc [[1]] An object of class...
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) down.215 <- sunr...
2017 Nov 13
2
Convert poly line to polygon in R
I have a shape file as poly line and I want to convert it to polygon.Is it possible to do that in R?lake <-readShapeLines("./lake_main_utm.shp")proj4string(lake) <- CRS("+proj=utm +zone=39 +datum=WGS84") Sincerely. [[alternative HTML version deleted]]
2012 May 19
3
converting csv to image file
...to get a 1km by lkm grid raster image using my csv data. If I call latitude=a, longitude=b and preciptation=c. a<-(1,2,3,4,5) b<-(6,7,8,9,10) c<-(10,20, 30,40, 50) Then I found an example in r help which goes like pts = read.table("file.csv",......) library(sp) library(rgdal) proj4string(pts)=CRS("+init=epsg:4326") # set it to lat-long pts = spTransform(pts,CRS("insert your proj4 string here")) gridded(pts) = TRUE r = raster(pts) projection(r) = CRS("insert your proj4 string here") Because I am new to R, I have no idea what to put into the proj4 st...
2008 Aug 01
1
bug in readRAST6 function in package spgrass6
Hi if I try to import a raster layer which consists only of NULL values from grass by using the readRAST6, I get an error message: > readRAST6("HSericea_seedsDisperse_2007") ERROR: Invalid value for null (integers only) Error in readBinGrid(rtmpfl11, colname = vname[i], proj4string = p4, integer = to_int) : no such file: /home/rkrug/Documents/Projects/AlienSpread/R/../grass/simulation/.tmp/ecolmod/HSericea_seedsDisperse_2007 Thanks Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence...
2013 Apr 24
2
How to make a raster image in R from my own data set
...y(rgeos) # geometry ops install.packages("spdep", dependencies=TRUE) library(spdep) # spatial dependence install.packages("pastecs", dependencies=TRUE) library(pastecs) pts<-read.table.url("https://www.betydb.org//miscanthusyield.csv", header=T, sep=",") proj4string(pts)=<- CRS("+proj=longlat +datum=WGS84") #--------------------------------------------------------------------------- Cheers, Kristi [[alternative HTML version deleted]]
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 nevada, but rather than being able to see the geographic features...