zoonproject / zoon

The zoon R package
Other
61 stars 13 forks source link

SpOcc not respecting extent argument properly. #422

Open timcdlucas opened 6 years ago

timcdlucas commented 6 years ago
w_m <- workflow(Chain(SpOcc(species = 'Anopheles arabiensis', 
                           extent =   c(33.1, 37.8, -20, -17.2)),
                     SpOcc(species = 'Anopheles funestus', 
                           extent =   c(33.1, 37.8, -20, -17.2)),
                     SpOcc(species = 'Anopheles gambiae', 
                           extent =   c(33.1, 37.8, -20, -17.2))),
               Bioclim(extent = c(33.1, 37.8, -25.5, -17.2), resolution = 2.5, layers = c(1, 4, 12, 15)),
               Background(n = 100),
               LogisticRegression,
               Chain(PrintOccurrenceMap, 
                     PrintMap, 
                     PerformanceMeasures))

# Change as necessary
# load("/tmp/RtmpeNGXf4/file6789c23e5fb.rdata")

output$occurrence.output

Gives points all over the place.

[[1]]
    longitude  latitude value     type fold
1    47.11667 -18.31667     1 presence    1
2    23.41667 -20.00000     1 presence    1
3    25.15000 -17.81670     1 presence    1
4    15.80000 -17.78333     1 presence    1

I'll look into it a bit.

timcdlucas commented 6 years ago

OK, the error is in spocc somewhere (or in the gbif api) so I'm asking there.

timcdlucas commented 6 years ago

https://github.com/ropensci/spocc/issues/187#issuecomment-395273745

We (I) need to edit SpOcc so that it uses WKT.