[R-sig-Geo] CRS for the European Biogeographical Regions in R
Roland Kaiser
kardinal.eros at gmail.com
Sat Feb 7 17:53:00 CET 2015
Hi Barbara,
the data set projection is EPSG:3035 - ETRS89 / ETRS-LAEA.
llibrary(sp)
library(rgdal)
# the projection information is given in the *.qpj file
# unfortunately, it is not read from the dataset by the OGR driver
# we have do define it manually by specifing argument p4s
pg <- readOGR(dsn = "BiogeoRegions2011_shapefile",
layer = "BiogeoRegions2011", p4s = "+init=epsg:3035")
proj4string(pg)
# example points
pt <- data.frame(x = c(14,28), y = c(41, 59), id = 1:2)
coordinates(pt) <- ~x+y
proj4string(pt) <- CRS("+init=epsg:4326")
proj4string(pt)
# project to CRS of pg
pt <- spTransform(pt, CRS("+init=epsg:3035"))
over(pt, pg)
Cheers, Roli
> Am 07.02.2015 um 16:55 schrieb Barbara Szabó <barbara.szabo.elte at gmail.com>:
>
> Hi,
> i`d be interested if somebody would help me in the CRS for the European
> Biogeographical Regions data base.
>
> I have coordinates, already saved as SpatialPolygon in lat-long
>
> sp_poly at bbox
>
> min max
>
> x 40.933 59.30397
>
> y 13.633 27.53300
> I have to check in which polygons this coordinates belong to. The function
> over() should do the job, if both data sets are in the same CRS.
>
>
> The shape file of the biogeographical regions can be downloaded at
> http://www.eea.europa.eu/data-and-maps/data/biogeographical-regions-europe
>
> The CRS is NA when reading it with
> library(maptoos)
> eea <- readShapeLines("BiogeoRegions2011")
> The data lays in the bbox of 943619 489768 8663038 7880872
> On the website there is an information on the CRS:
> urn:ogc:def:crs:EPSG:6.11:4326
>
> The problem seems to be to specify the correct CRS in eea. First I do not
> know the CRS and second if I assume one, I get an error:
> proj4string(eea) <- CRS("+proj=longlat +ellps=WGS84")
> Error in proj4string. Geographical CRS given to non-conformance data:
> 8663038.09057 ....
>
> Any ideas which bringing me nearer to a solution are very welcome - thanks
> a lot in advance.
>
> Best,
> Barbara
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list