Bachiller Eneko | 1 Oct 11:12 2014

FW: Re: Load a map png in ggplot2 (workaround for missing world map support in ggmap)

Dear Markus,

I have found the same problem and I would like to know if you found out any solution...
I mean, I have some maps (from Surfer) that I would like to import to ggmap. The point would be to be able to
import the basemap and georeference that (adjust x/y axes) in order to plot my spatial data there.
I guess this is the same question you made in this blog in Oct 2013 but I ignore if you solved that...

I would be very grateful if you could help me with some ideas and/or possible alternative options.
Thank you very much ended.
Kindest regards,

Dr. Eneko Bachiller
Institute of Marine Research
Bergen, Norway

	[[alternative HTML version deleted]]
Thiago V. dos Santos | 1 Oct 00:16 2014

Fill levelplot with pattern instead of color

Dear all,
I am using level plots from the R rasterVis package to plot land use classes as categorical data. The example
from the function help can be used to create some categorical data:
r <- raster(nrow=10, ncol=10)
r[] = 1
r[51:100] = 3
r[3:6, 1:5] = 5
r <- ratify(r)
rat <- levels(r)[[1]]

rat$landcover <- c('Pine', 'Oak', 'Meadow')
rat$class <- c('A1', 'B2', 'C3')
levels(r) <- rat
levelplot(r, col.regions=c('white', 'grey', 'black'))

My problem is that the classes in my dataset are more subtle, and therefore grey levels do not properly show
some of them (it lacks contrast). As an alternative, I wonder if there is some way to fill a specific class
(in the example above, let's say 'Meadow') with patterns (say, hatched) instead of colors.

A good example of what I mean by pattern is this map:
Thanks in advance for any direction. 
Thiago V. dos Santos
PhD student
Land and Atmospheric Science
University of Minnesota
Phone: (612) 323 9898
	[[alternative HTML version deleted]]
(Continue reading)

Feichtinger, Paul | 30 Sep 22:50 2014

Specification tests in spatial models

Dear mailing list members,

we estimate a general spatial model to investigate the determinants of agricultural land prices. The
functional form is a log-log specification. In testing we perform, among others, "spatial-tests" like
Moran's I and LM tests. Our question is, are there any possibilities to test for misspecification  of the
functional form (log-log) 1) which make sense in this circumstances and 2) which are available in R
packages like sphet?

Any comments would be of great help!

Thank you,


Technische Universitt Mnchen - TUM
Paul Feichtinger
Lehrstuhl fr Volkswirtschaftslehre, Umweltkonomie und Agrarpolitik

Alte Akademie 14
85354 Freising
Tel: +49.8161.71.3574
Fax: +49.8161.71.3408
e-mail: Paul.Feichtinger <at>

	[[alternative HTML version deleted]]

(Continue reading)

Swagath Navin Manohar | 30 Sep 08:51 2014

Re-projection with project raster results in rotated plot

Hello all,

I have a problem concerning re-projecting a raster from EPSG:3035 to 
sr-org: 29, wrf-lambert-conformal-conic which results in a rotated plot.

Here is the code I used:

raster1=rasterFromXYZ(radon[, c("x", "y", "rn")])


crs(raster1)='+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 
+ellps=GRS80 +units=m +no_defs'

####to this new projection

newproj <- "+proj=lcc +lat_1=33 +lat_2=45 +lat_0=40 +lon_0=-97 +x_0=0 
+y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"

raster2 <- projectRaster(raster2, crs=newproj, res=5000, method='bilinear')

Here is the output:

I hope someone can give me a hint about what I am doing wrong here.
Thanks a lot for your time.
Anna-Marie Corman | 29 Sep 12:40 2014

Calculating distance to nest with spDistsN1

Dear list,

I have a question regarding the spDistsN1 function. I want to calculate 
the distance of each flight position to the relevant nest position. My 
dataset consists of several birds with a differing number of trips. 
There is a unique trip_id with the first number regarding to the bird 
and the second number regarding to the trip.

          coordinates       Date     Time Speed Direction col_lat col_long dist_col
1 (7.87248, 54.1866) 04.07.2014 09:25:00  0.02    314.57 54.1866   7.8724      0.0
2 (7.87148, 54.1869) 04.07.2014 09:30:00 19.11      1.31 54.1866   7.8724      0.1
3  (7.87166, 54.185) 04.07.2014 09:35:00 14.98    224.79 54.1866   7.8724      0.2
4 (7.88635, 54.1569) 04.07.2014 09:40:00 11.44    136.97 54.1866   7.8724      3.4
5 (7.92096, 54.1363) 04.07.2014 09:45:00  0.28    262.14 54.1866   7.8724      6.4
6  (7.91931, 54.136) 04.07.2014 09:50:00  0.42    218.89 54.1866   7.8724      6.4
   trip_no bird_id trip_id                  DT           date_time
1       1       1     1.1 04.07.2014 09:25:00 2014-07-04 09:25:00
2       1       1     1.1 04.07.2014 09:30:00 2014-07-04 09:30:00
3       1       1     1.1 04.07.2014 09:35:00 2014-07-04 09:35:00
4       1       1     1.1 04.07.2014 09:40:00 2014-07-04 09:40:00
5       1       1     1.1 04.07.2014 09:45:00 2014-07-04 09:45:00
6       1       1     1.1 04.07.2014 09:50:00 2014-07-04 09:50:00

Formerly, when I only had one bird and so only one nest position (here 
col_lat & col_long), I did the following:

spDistsN1(coordinates(dat <at> coords), matrix(c(8.3495235,54.7042698), nrow 
= 1), longlat = T)

and this worked fine.
(Continue reading)

Leigh Kroeger | 29 Sep 10:22 2014

Shapefiles and occurrence data


I am new to SDMs and spatial modelling. I have downloaded and subsetting
data from one species in the Mediterranean from GBIF. I have changed the
lat and lon to x and y spatial coordinates and now wish to marry them on
top of a gridded shapefile which has been uploaded successfully into R.

any tips for direction?


*Leigh A. Kroeger*

*PhD Candidate - Marine Ecology*
המחלקה למדעי החיים
אוניברסיטת תל אביב

	[[alternative HTML version deleted]]

R-sig-Geo mailing list
R-sig-Geo <at>
Bernie Kruger | 29 Sep 00:48 2014

R Basic Spatial Interpolation

I am a bit lost at the moment trying to find an R package/method to solve my
very basic problem. I think this might be the right forum to help me out. I
have a very simple dataset with Lat/Lon, Temp and Time as observations of
temperature at specific weather stations. 

All I want to do is to “predict” missing temperatures at specific Lat/Lon
locations not covered by the weather stations. This need not to be highly
accurate, but purely indicative of what the temperature could be. 

I suspect I am after Spatial Interpolation, but I also read about Kriging

I have played around with various methods/packages (Akima/Kriging) and it
does my head in - no success. Any suggestions/help please? 


View this message in context:
Sent from the R-sig-geo mailing list archive at

R-sig-Geo mailing list
R-sig-Geo <at>
Kenny Bell | 29 Sep 00:09 2014

Accessing the ids of neighbours in spdep


I am trying to get an actual list of neighbour ids out of an nb object. For
example, I have

xx <- poly2nb(columbus)

What would be my command to get the list of neighbours as a list of
character vectors?

Thanks so much for any help,

	[[alternative HTML version deleted]]
Stephen Roecker | 26 Sep 16:34 2014

gdal --config options

I'm using the gdaUtils and raster packages and was wondering if it's
possible to specify --config options, using any of their functions
(e.g. gdalwarp, writeRaster, etc)? I've tried accomplishing this using
the additional_commands arguement in gdawarp with no success. Can
someone provide an example?

	[[alternative HTML version deleted]]
Zhou, Yuhong | 26 Sep 02:51 2014

use quadtree idea to create densified grids containing maximum number points

The goal is to divide a bounding square into nonuniform grids, constraining
that each grid does not contain maximum number points.

The origins (lower-left corner) and the side length of the square are given
to define the bounding square. A point threshold, for example, a value of 50
is chosen. The points shapefile is available, from which the projection can
be determined. The points shapefile has a variable called Obs, describing
how many observations are attached to that point.

The quadtree idea is employed to do this. If the number of original data
points/observations in the bounding square is larger than the size of the
threshold, we split the study space into four separate, equal-area
rectangles. Then the number of points/observations within each rectangle is
counted. If the value exceeds the threshold, that rectangle is further
subdivided. This is repeated for all rectangles, at all levels of
subdivision, until no rectangle has a number of original data points in
excess of the threshold.

I have written a function to try to achieve this. The current code run
recursively, but never ends the recursion.  Either something is wrong with
the return(), or with the structure of the function. I also want to record
the XY coordinates of grids that are leaves, and trace their
grid-parents/grandparents/...., but not know how to get it coded correctly.

Here is the code:
## origin, delta -> bounding square
## points (shapefile)
## threshold
##  xy_df to record the XY of child/leaf grids
## id - indexing the classes of leaf/parent
(Continue reading)

Moshood Agba Bakare | 25 Sep 22:24 2014

guide to interpretation of kriged maps

Hi All,
I am yet to get response on tips to guide me in interpreting the
interpolated surface and kriging variance maps obtained from spatial
interpolation into regular grids.

Thank you.

	[[alternative HTML version deleted]]