2

I am producing Kernel density estimates for animals from tracking data.

Location is input at x y data, I produce a spatial polygons dataframe from these coordinates.

xy<-id[c("X", "Y")]
id<-id[c("Individual")]
idsp <- data.frame(id)
coordinates(idsp) <- xy
proj4string(idsp)

I set the CRS

proj4string(idsp) <- CRS("+proj=utm +datum=WGS84 +units=m +no_defs")

I then use adehabitatHR to produce KDE95s for my individual animals using the kernelUD and getverticeshr.

cromKDE<- kernelUD(idsp, h = "href")
CromKDE95 <- getverticeshr(cromKDE, percent = 95)

I convert these outputs into the appropriate CRS for the package leaflet using

CromKDE95<- spTransform(CromKDE95, CRS('+init=epsg:4326'))

I then try to use the package leaflet to visualise the KDE95 polygons on a basemap

leaflet(CromKDE95) %>% addTiles() %>%
  addPolygons().

But the polygons are plotting in the Ocean south of San-Pedro rather than in Ireland as they should be.

I realise this is likely a simple fix adjusting the CRS but I have tried all the different formats I can think of.

1
  • 3
    Where are you getting CRS("+proj=utm +datum=WGS84 +units=m +no_defs") - that's an uncommon reference system and I'm wondering if someone has said "this is UTM" when in fact its in a UTM zone - which means you need the zone number...
    – Spacedman
    May 13, 2020 at 19:24

1 Answer 1

0
CromKDE95 <-sp::CRS("+init=epsg:29902")

Try this using the EPSG format for ireland (29902)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.