[R-sig-Geo] Points2grid() from spatial points
Thomas Szegvary
t.szegvary at unibas.ch
Wed Jun 13 11:37:32 CEST 2007
Hello, I'm new to R and try to use the geostatistical packages.
I have a problem making grid from ESRI shapefiles. I imported the shapefile
(polygon) and projected the coordinates. Then I used spsample() to produce a
spatial points for the given regions resp. polygons. With points2grid I
wanted to produce the grid, which should be used for krige(), but a always
have an error message (see below).
Script:
>#prepare grid
>europe <- readShapePoly("R course/country/europePoly.shp")
>proj4string(europe) = CRS("+init=epsg:4326") europe.tr <-
spTransform(europe,CRS("+init=epsg:3035"))
>europe.points <- spsample(europe.tr,type="regular",cellsize=100000)
>points2grid(europe.points)
x1 x2
cellcentre.offset 2735004 1478310
cellsize 100000 100000
cells.dim 37 48
Warning message:
grid has empty column/rows in dimension 2 in: points2grid(europe.points)
Thanks a lot
Thomas
__
Thomas Szegvary
Institute of Environmental Geosciences
Department of Geosciences
University of Basel
Bernoullistrasse 30
CH - 4056 Basel
Tel. 41-61-267 04 82
Fax. 41-61-267 04 79
Email: t.szegvary at unibas.ch
www.radon.unibas.ch
www.unibas.ch/environment
More information about the R-sig-Geo
mailing list