Angel Ferrero | 24 Oct 17:12 2014

Error: identicalCRS(x, y) is not TRUE after using the over() command

Hi everyone, 

I am new to doing this kind of thing in R, but I have been trying to perform co-kriging for a set of datapoints in
relation to climate from the worldclim project based on a previous example I found using the meuse shp.

This is my code, and at the end of it, you can see the error I get: identicalCRS(x, y) is not TRUE after using the
over() command.

I would appreciate if anybody could help me out this this.



#Let's first create a prediction grid for the interpolation, starting from the shape file



proj4string(data)=CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")

border <- spTransform(border0, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))
proj4string(border)=CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")

bio <- getData("worldclim", var="bio", res=10)   # this will download global data on minimum temperature
at 10 min resolution
(Continue reading)

Andrew Vitale | 24 Oct 00:04 2014

spacetime EOF implementation - interpretation question


I'm performing an empirical orthogonal function analysis on sea level
pressure using the spacetime package, and I'm having trouble determining
which elements of the function output I should use to interpret the results.

It seems that most examples in the literature calculate empirical
orthogonal functions (EOFs) and their associated principle component (PC)
time series (e.g. ,
pp 11-12, Fig. 2, 3).  As far as I can tell, I should be able to extract
all of the relevant information using only the spatial mode in the
spacetime:::EOF function.  However, the ambiguous terminology in the
literature and the availability of the "temporal" mode in spacetime:::EOF
have me uncertain of my interpretation.

I have been treating the output of spacetime:::EOF with
returnPredictions=TRUE as the EOFs, and I have been treating the
spacetime:::EOF $rotation element with returnPredictions=FALSE as the PCs.

Am I extracting the proper information from the spacetime:::EOF results?
Are the results of the spatial and temporal modes of spacetime:::EOF both
required to perform an EOF analysis of a sea level pressure field, or are
these two separate analyses?

Below is a small example of how I am currently extracting the spatial EOFs
and their associated PCs.

Thanks for any comments,
Andrew Vitale

(Continue reading)

Ferra Xu | 23 Oct 19:51 2014

visualizing a 5D kernel density estimation

I have a question regarding kernel density estimation in R. I have a 5-dimensional data, which consists of
(x,y,z) locations, time of happening and size of some events (for example earthquake). I wrote the
following code in R in order to find the 5D kernel density estimation:

kern <- read.table(file.choose(), sep=",")
evpts <-,  lapply(kern,quantile, prob=c(.1,.15,.2,.25,.3,.35,.4,.45,.5,.55,.6,.65,.7,.75,.8,.85,.9,.95)))
hat <- kde(kern, eval.points= evpts)

Now, I'd like to visualize the kernel density estimation. I prefer to show the kernel regarding all 5
dimensions in one plot (by using different colors or sizes for point) or at least regarding three
dimensions separately. Do you have any suggestion for me?

Here is the dataset:

   x          y          z            time         size
422.697323  164.19886   2.457419    8.083796636  0.83367586
423.008236  163.32434   0.5551326   37.58477455  0.893893903
204.733908  218.36365   1.9397874   37.88324312  0.912809449
203.963056  218.4808    0.3723791   43.21775903  0.926406005
100.727581  46.60876    1.4022341   49.41510519  0.782807523
453.335182  244.25521   1.6292517   51.73779175  0.903910803
134.909462  210.96333   2.2389119   53.13433521  0.896529401
135.300562  212.02055   0.6739541   67.55073745  0.748783521
258.237117  134.29735   2.1205291   76.34032587  0.735699304
341.305271  149.26953   3.718958    94.33975483  0.849509216
307.138925  59.60571    0.6311074   106.9636715  0.987923188
307.76875   58.91453    2.6496741   113.8515307  0.802115718
(Continue reading)

Manuel Spínola | 23 Oct 16:10 2014

How to segment or split a spatial line in R

Dear list members,

How to segment or split a spatial line in shorter equal segments, and also,
how to get the mid point of ecah segment.



*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
mspinola <at>
mspinola10 <at>
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <>
Institutional website: ICOMVIS <>

	[[alternative HTML version deleted]]

R-sig-Geo mailing list
R-sig-Geo <at>
(Continue reading)

Anthony Damico | 23 Oct 15:01 2014

fattening certain portions of a city map in R with using projections

hi, i'm trying to map new york city and wondering if it's possible to pick
a projection that will have an effect that brings the map a bit closer to
the shapes seen in the nyc mta subway map  (

the bonne and azimuthal projections on this page ( really appear to
inflate africa the same way that i would like to inflate either manhattan
or perhaps manhattan + brooklyn.

i've posted reproducible code and some example images here--

i understand what i'm trying to do could be accomplished as a cartogram,
but i'm curious if - since i don't really care about population- or
count-based weighting - a smart projection selection might save me a lot of

thank you!!

	[[alternative HTML version deleted]]
Alessandra Carioli | 23 Oct 12:48 2014

distance between centroids

Dear all,

I am trying to compute the average distance between centroids and between neighbors, starting from a
spatial polygon shape file.
What I am doing is compute the average distance between all centroids and compute the average distance
between neighbors for different regions in order to better compare them. (Some are densely populated and
have more centroids, others are the opposite).
Does anyone have any ideas? I am sure it should be pretty simple.

So far I have used dist but does not give me what I want.


	[[alternative HTML version deleted]]
Navinder Singh | 22 Oct 23:57 2014

Overlaying time designated spatial points from a data frame to match the time of a raster image in a rasterStack


I have a level plot with a number of rasters (monthly rasters for a year- generated with kind help from
Oscar). Basically a raster stack.

I would like to overlay spatial points on this raster stack, but would like to overlay only those points that
belong to the month matching the raster stack. For e.g. The points form January should fall on the raster
from January, those from february should fall on February raster as so on. I am drowning in the lattice'
literature but have not succeeded till now.

I am running the following code but not sure how to assign an index which can delegate the points from
respective months to their rasters in the layer + sp. points argument from rasterVis package.

My data frame has the following columns:
df= X, Y, date (POSIXct), month (, id (animalID), SITE (a factor with origin area)

The rasters also have names in the format of

And the code i am using is:

rrMean is a raster stack of monthly means. dfSp is a SpatialPointDataFrame with above fields.

p<-levelplot(rrMean, main="Mean Monthly NDVI (2010-2014)", par.settings=myTheme)

# I understand that col argument just changes the colours but still plots all points on all rasters, but i
guess i need something specified
in sp.points(dfSp,col=dfSp$SITE).

Thanks for any suggestions.
(Continue reading)

Jefferson Ferreira-Ferreira | 22 Oct 22:29 2014

Loading Rasters in Revolution R

Hi all,

I'm wondering how to load rasters as xdf files using rxImport. I have a big
raster with 9 layers/bands and I need to do perform a logistic regression
for each pixel throughout bands. So It's a huge processing, and why I'm
testing Revolution R Enterprise.
However I don't know how to import as xdf files to perform parallel
processing inside it. Almost blogs and tutorials deals with ordinary csv

Could anybody give me any guidance?




*Jefferson Ferreira-Ferreira*

Geógrafo – GEOPROCESSAMENTO IDSM | Coordenadoria de TI

Jefferson.ferreira <at>

*Instituto de Desenvolvimento Sustentável Mamirauá*

Ministério da Ciência, Tecnologia e Inovação

Telefone: +55 97 3343-9710

*Google Maps* - Mapas deste e-mail:

(Continue reading)

Silvia Cordero-Sancho | 22 Oct 20:01 2014

Kest (spatstat) and "r" values


I am employing the Ripley's K function to evaluate my data and have some
concerns regarding the maximum distance reported.

My data was collected in 7 different sites. At each site we recorded the
location x-y of the events. The 7 sites were had *"similar conditions"
*but their
extent vary, and in addition, not all sites presented the same number of
events (number of events per site vary from 92 to up to 400 ).

Each site was evaluated independently, meaning that Site-1 had their on set
of events and own window of observation (W). I used the *ripras* function
to define *W, *(for all sites, W is an irregular shaped window).

I have run two first order exploratory  tools
(quadrat.test, clarkevans.test). The overall results is that my
observations are not random and show aggregation tendencies for all sites.

I applied the function* Kest* to all my seven sites to explore the second
order properties, I did not provide a *r* value (as recommended in the help
section) and here is the "curious" outcome. Indifferently of the area of W
or the number  of events per site, the maximum r-values reported for all
sites is very similar (between 5000 m to  6140 m). I am trying to
understand the reason behind these results. Is this an overall
characteristic of my pattern OR is a result of the algorithm that spatstat
employs to define r (e.g. it has a maximum threshold)

Here my code:

(Continue reading)

Mathieu Rajerison | 22 Oct 17:12 2014

Kernel Density Estimation with Border Bias Correction


Some people here might be interested by this :

"This page proposes some R codes to compute the kernel density estimates of
two-dimensional data points, using an extension of Ripley's circumference
method to correct for border bias"

Best regards,


	[[alternative HTML version deleted]]
Jue Lin-Ye | 22 Oct 14:33 2014

Re: pieSP: pie charts on map

Dear list members,

I am working on the following code.

(this might be erased after solution of problem)

 I am characterizing marine storms. There are four variables: slogE,
sloguE, slogT and slogD.

I would like to do the following

-draw a map for every return period (Tr) and every variable
 - have a pie chart for every WANA node (Here I have two nodes. The node
names are shown on the first column of Data.1.txt)
-Use the same colors for every variable. I mean, for Tr=1 through 50 years,
all the variables increase with return period, but I would like to have the
same colors for the same value ranges, in order to compare the maps. That
is, if return period 1year has slogE within the ranges (0,1] and (1,2] and
return period =2 years has slogE within the ranges (1,2] and (2,3], I would
like to take all (0,1]=blue, (1,2]=green and (2,3]=red and have two slices
of blue-green in Tr=1 year and two slices of green-red in Tr=2 years.

like this

(Continue reading)