satishr | 9 Feb 21:19
Picon
Gravatar

unable to customize a plot produced from a shapefile

Hi, 
  I read ESRI shapefile and related files using readOGR, and was able to
plot successfully but am unable to customize the plot. The data is attached
and corresponds to US climate divisions.
  The below mentioned second command supposed to produce a plot of sub
region of the USA but it's not. I tried using readShapePoly but no success.
In addition, I found a lot of space on top of the picture and want to reduce
it, but not sure how to do it. I request you to provide suggestions. 
Thanks,
Satish

> climagdiv = readOGR("US102ClimateDivisions", "US102ClimateDivisions") 
OGR data source with driver: ESRI Shapefile 
Source: "US102ClimateDivisions", layer: "US102ClimateDivisions" 
with 102 features and 5 fields 
Feature type: wkbPolygon with 2 dimensions 
> plot(climagdiv)
> plot(climagdiv,ylim=c(20,40))

>climagdiv = readShapePoly("US102ClimateDivisions.shp") 
> plot(climagdiv)
> plot(climagdiv,ylim=c(20,40))

Data:
http://r-sig-geo.2731867.n2.nabble.com/file/n7270579/US102ClimateDivisions.zip
US102ClimateDivisions.zip 

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/unable-to-customize-a-plot-produced-from-a-shapefile-tp7270579p7270579.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
(Continue reading)

Jonathan Greenberg | 9 Feb 20:31
Favicon
Gravatar

GDALinfo to get hdf metadata

R-sig-geo'ers:

I'm trying to figure out how to "capture" metadata from the GDALinfo call
on an HDF file -- running GDALinfo("some.hdf") displays all the metadata,
but I can seem to figure out how to extract this data.  All I can see as
extractable variables are:

[1] "rows"      "columns"   "bands"     "ll.x"      "ll.y"      "res.x"
[7] "res.y"     "oblique.x" "oblique.y"

--j

--

-- 
Jonathan A. Greenberg, PhD
Assistant Professor
Department of Geography
University of Illinois at Urbana-Champaign
607 South Mathews Avenue, MC 150
Urbana, IL 61801
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn307 <at> hotmail.com, Gchat: jgrn307, Skype: jgrn3007
http://www.geog.illinois.edu/people/JonathanGreenberg.html

	[[alternative HTML version deleted]]
Etienne B. Racine | 9 Feb 17:02
Picon
Gravatar

Not so random sampleRandom in raster package

It seems that sampleRandom isn't so random.

# try this :
library(raster)
r <- raster(matrix(1:25, 5, 5))
sampleRandom(r, 25)
## 1 6 11 16 21 2 7 12 17 22 3 8 13 18 23 4 9 14 19 24 5 10 15
sampleRandom(r, 25)
## 1 6 11 16 21 2 7 12 17 22 3 8 13 18 23 4 9 14 19 24 5 10 15

I haven't seen any documentation about this behavior.

Etienne

	[[alternative HTML version deleted]]
Thiago Veloso | 9 Feb 16:29
Picon
Favicon

How to change raster cell value by coordinates?

  Dear list,

  I wonder if there is a way to change the values of a raster grid using the coordinates as a condition. Please
consider the raster below:

> library(raster)
> amz<-raster("/home/data/amz.img")
> amz
class       : RasterLayer
dimensions  : 47, 65, 3055  (nrow, ncol, ncell)
resolution  : 0.5, 0.5  (x, y)
extent      : -74, -41.5, -17.5, 6  (xmin, xmax, ymin, ymax)
coord. ref. : NA
values      : /home/data/amz.img
min value   : 0
max value   : 1

  This is what I would like to do:

>amz[-55,2]<-0.5

  Package "raster" offers a 'replacement' function that seemed promising, but its arguments are row and
column numbers, instead of coordinates.

  Could anyone please point out another option?
Picon
Favicon
Gravatar

[Fwd: gsoc 2012 officially announced!]

Dear all,

I believe that this could be of interest to some of you. We have had a
few projects on spatial data analysis in past years and it will be good
to have some this year too. We are looking for students and mentors.
Check the wiki for details (see below). 

Best,

Virgilio

--------- Mensaje reenviado --------
De: Toby Dylan Hocking <Toby.Hocking <at> inria.fr>
Reply-to: gsoc-r <at> googlegroups.com
Para: gsoc-r <at> googlegroups.com
Asunto: gsoc 2012 officially announced!
Fecha: Thu, 09 Feb 2012 15:27:17 +0100 (CET)

The GSOC 2012 has been announced

http://www.google-melange.com/gsoc/homepage/google/gsoc2012

and I have copied the relevant dates to the R wiki page

http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2012

Potential mentors, please add to the wiki page to give any interested
students some ideas for projects!

Potential students, look at the list of project proposals and email
(Continue reading)

Sandeep Patil | 8 Feb 23:29
Picon
Gravatar

AutoKrige.cv error

Hello everyone,

I have a spatial data frame with about 50 variables (precip and temp for
diff months).

I am using autokrige.cv to perform ordinary kriging cross validation for
each variable.

This works fine with most (~45 variables) but for about 5 variables i get a
weird error

saying that the no of locations (6076) and data (3037) do not match.

This is despite the fact that i am using the same data frame for all
variables and have same no of

rows for each variable.

Has anyone seen something like this before ? Any suggestion welcome.

Thanks in advance,

Sandeep

	[[alternative HTML version deleted]]
Jonathan Greenberg | 8 Feb 23:18
Favicon
Gravatar

rgdal loading problem...

R-sig-geo'ers:

I'm trying to get the Eclipse plugin for R ("Stat-et") working, but I've
run into a curious problem with rgdal I was hoping to get some help with.
 When loading rgdal from within the remote connection in Eclipse, I get
this error:

> require("rgdal")
Loading required package: rgdal
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object
'/usr/apps/oa/lib64/R/library/rgdal/libs/rgdal.so':
  libgdal.so.1: cannot open shared object file: No such file or directory

Other packages work fine via the remote "load", e.g.:
> require("raster")
Loading required package: raster
raster version 1.9-64 (16-January-2012)

Curiously, when launch of R via the command line (connecting to the same
server as above via SSH) I get the normal, no-problem load:
> require("rgdal")
Loading required package: rgdal
Loading required package: sp
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.9.0, released 2011/12/29
Path to GDAL shared files: /usr/apps/oa/share/gdal
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files: (autodetected)

(Continue reading)

Thiago Veloso | 8 Feb 20:41
Picon
Favicon

Combine two rasters with different spatial coverage

  Dear list,

  I am trying to combine two rasters. One raster has global coverage, while other covers only Amazon.

  Let me show in pratice. First I create an emtpy structure with the intended domain (global) and resolution
(0.5 degree):

> library(raster)
> glb<-raster(nrows=360,ncols=720,xmn=-180,xmx=180,ymn=-90,ymx=90)
> glb[]<-NA
> glb
class       : RasterLayer 
dimensions  : 360, 720, 259200  (nrow, ncol, ncell)
resolution  : 0.5, 0.5  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
values      : in memory
min value   : NA 
max value   : NA 

  On the other hand, I load a Amazon deforestation file which contains values between 0 and 1:

> amz<-raster("/home/data/amz.img")
> amz
class       : RasterLayer
dimensions  : 47, 65, 3055  (nrow, ncol, ncell)
resolution  : 0.5, 0.5  (x, y)
extent      : -74, -41.5, -17.5, 6  (xmin, xmax, ymin, ymax)
coord. ref. : NA
values      : /home/data/amz.img
(Continue reading)

gianni lavaredo | 8 Feb 19:25
Picon
Gravatar

help to create a raster BRICK from a list

Dear Researches,

sorry for disturbing you. I wish to create a raster brick from same rater
layers because i wish to compute the X range and Y range of all entire area
and save in shapefile format.
My idea was create a first list where i store the raster layer

> fileNames <- Sys.glob("*.asc")
> fileNames
[1] "72500_DEM.asc" "72750_DEM.asc" "72975_DEM.asc"

my.Area.tot <- list()

for(m in 1:length(fileNames)){

        r  <-  raster(fileNames[[m]])
        my.Area.tot[[m]] <- r
    }

# create a raster brick
b <- lapply(my.Area.tot,brick)
> b[[1]]
class       : RasterBrick
filename    : C:/R_works/AATimeAnalysis/NORTH/DEM/09G001/72500_DEM.asc
nlayers     : 1
nrow        : 1250
ncol        : 12500
ncell       : 15625000
projection  : NA
min value   : ?
(Continue reading)

Nathan Odgers | 8 Feb 19:16
Picon
Gravatar

Error in .local(.Object, ...) : Dataset copy failed

Hi,

I'm having trouble using writeGDAL() to save a SpatialPixelsDataFrame to
disk as a GeoTIFF.

> class(abs0to501)
[1] "SpatialPixelsDataFrame"
attr(,"package")
[1] "sp"

> names(abs0to501)
 [1] "z"          "regression" "res"        "variancek"  "variance1"
"variance2"
 [7] "variance"   "p1"         "p2"         "p3"         "b0"
"b1"
[13] "b2"         "b3"         "b4"         "b5"         "b6"
"b7"
[19] "b8"         "b9"         "b10"

For now, I just want to write the "z" attribute as a GeoTIFF. So I call
writeGDAL() as follows:

> writeGDAL(abs0to501["z"],"f:\temp\abs0to501_z.tif")

then it thinks for a few seconds, and I get the error message:

Error in .local(.Object, ...) : Dataset copy failed

Is my file too large for R to cope with? The csv file that it originates
from is about 470 Mb in size. Or am I doing something else wrong?
(Continue reading)

Picon

simulate correlated random walks within boundaries

Dear all,

 

Does anyone know an R function to simulate correlated random walks within the boundaries of a polygon.

 

Sorry everyone if this question was in the archives, but I couldn't find it.

 

Thanks

 

Javier

 

 

Dr. Javier Perez-Barberia

Senior scientist

The James Hutton Institute

Craigiebuckler

Aberdeen AB15 8QH

Scotland UK

 

Tel: +44 (0) 1224 395 221 (direct)

Tel: +44 (0) 844 928 5428 (switchboard)

Fax: +44 (0) 844 928 5429


www.hutton.ac.uk

 

 


________________________________________________________

This email is from The James Hutton Institute (JHI), however the views
expressed by the sender are not necessarily the views of JHI and its
subsidiaries. This email and any attachments are confidential and are
intended solely for the use of the recipient(s) to whom they are addressed.
If you are not the intended recipient, you should not read, copy,
disclose or rely on any information contained in this email, and we would
ask you to contact the sender immediately and delete the email from your
system. Although JHI has taken reasonable precautions to ensure no
viruses are present in this email, neither the Institute nor the sender
accepts any responsibility for any viruses, and it is your responsibility to
scan the email and any attachments.

The James Hutton Institute is a Scottish charitable company limited by
guarantee.
Registered in Edinburgh No. SC374831
Registered Office: The James Hutton Institute, Invergowrie Dundee DD2 5DA.
Charity No. SC041796
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo <at> r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Gmane