Geographic Information Systems Asked by user167470 on August 24, 2021
I am trying to estimate the home range of wolves and would like to use LoCoH to do that. However I am running into a orphaned hole problem that I really do not know how to solve.
var <- read.csv("Varåa1708_2018.csv", sep = ";")
str(var)
IndividId : Factor w/ 1 level "M17-08": 1 1 1 1 1 1 1 1 1 1 ...
$ ProjectCode : int 12950000 12950000 12950000 12950000 12950000 12950000 12950000 12950000 12950000 12950000 ...
$ SpeciesCode : int 5 5 5 5 5 5 5 5 5 5 ...
$ SexCode : int 1 1 1 1 1 1 1 1 1 1 ...
$ AgeInMonths : Factor w/ 12 levels "Minst 34","Minst 35",..: 1 1 1 1 1 1 1 1 1 1 ...
$ DateTime : Factor w/ 4265 levels "01.01.2019 00:00",..: 2018 2019 2020 2021 2022 2023 2121 2122 2123 2124 ...
$ Latitude : num 61.1 61.1 61.1 61.1 61.1 ...
$ Longitude : num 12.4 12.4 12.4 12.4 12.4 ...
$ Northing : int 6780152 6780160 6779922 6779893 6779899 6779904 6779904 6779905 6779917 6779912 ...
$ Easting : int 360914 360893 360426 360492 360489 360480 360491 360475 360432 360426 ...
$ UTMZone : int 33 33 33 33 33 33 33 33 33 33 ...
$ UTMX : int 360914 360893 360426 360492 360489 360480 360491 360475 360432 360426 ...
$ UTMY : int 6780152 6780160 6779922 6779893 6779899 6779904 6
v18data.xy = var[c("Longitude","Latitude")]
v18xysp <- SpatialPoints(v18data.xy)
proj4string(v18xysp) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0")
Create a Spatial Data Frame from relocations
spptv18<-data.frame(v18xysp)
idspv18 <- data.frame(vara18$IndividId)
Add ID
coordinates(idspv18)<-spptv18
proj4string(idspv18) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0")
locsdf <-as.data.frame(idspv18)
head(locsdf)
vara18.IndividId Longitude Latitude
1 M17-08 12.41730 61.13125
2 M17-08 12.41691 61.13132
3 M17-08 12.40842 61.12901
4 M17-08 12.40966 61.12877
5 M17-08 12.40960 61.12883
6 M17-08 12.40944 61.12887
LoCoH
var1 <- LoCoH.k.area(idspv18, k=c(16:25))
var2<- LoCoH.k(idspv18, k=24)
Error message I get:
Error in rgeos::createPolygonsComment(oobj) :
rgeos_PolyCreateComment: orphaned hole, cannot find containing polygon
for hole at index 81
In addition:
Warning messages:
1: In proj4string(xy) : CRS object has comment, which is lost in
output 2: In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
Discarded datum Unknown based on WGS84 ellipsoid in CRS definition,
but +towgs84= values preserved 3: In proj4string(xy) : CRS object has
comment, which is lost in output
I have tried using UTM instead of LatLong, tried to clean the orphaned holes using cleangeo but that showed that I had no issues with my data. I am a bit of a newbie with R.
Consider using the newer t-locoh (https://tlocoh.r-forge.r-project.org/), which functions identically to LoCoH.k when time is ignored.
Answered by user169901 on August 24, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP