Categorical raster not displaying properly when using MoveVis package

34 views Asked by At

I am trying to animate gps data over a categorical raster of land cover data using the moveVis package in R, but for some reason the raster isn't displaying properly. The x-axis appears to be condensed. If I display it as a continuous raster instead, it displays properly. Any ideas on how to fix this?. Here is my code, as well as a screenshot of the actual raster not displaying as it should. enter image description here

frames <- frames_spatial(test,

                         r_list=habitat,r_times = starttime,r_type = "discrete",

                         path_colours = c("red", "green", "yellow", "black"), path_legend = T,

                         trace_show = T, trace_colour = "gray38", equidistant = FALSE, ext=ext2

)%>%

  add_gg(gg = expr(geom_path(data = watercourse,

                             aes(x = long, y = lat, group = group),

                             color = 'blue', size = 1)), data = watercourse)%>% # add watercourses (Harper and Lambert creeks)

  add_gg(expr(list(guides(colour = guide_legend(title = "Device ID")),(scale_colour_manual(values = c("red",    "green", "yellow", "black"), labels = c("86131", "86132","86133","86134"))))))%>%

  add_labels(title ="Wabasca Bison Early Winter Movements (2020-2023)",x = "Longitude", y = "Latitude") %>% # add some customization, such as axis labels, legend

  add_northarrow(colour = "black") %>%

  add_scalebar(colour = "black") %>%

  add_timestamps(test, type = "label") %>%

  add_progress(colour = "grey", size = 0.5, verbose = TRUE)%>%

  #add_gg(gg=expr(layer_spatial(habitat,aes(fill=as.factor(after_stat(band1)))))) %>%

  add_gg(gg=expr(scale_fill_manual(values = c("#309143","#8ace73","#39737c","#2c69b0","#6ba3d6","skyblue","#b5dffd","#B6992D","#d5bb21","yellow","grey"), name= "Habitat Classes",  labels=c("Evergreen Forest", "Woodland", "Emergent Marsh",  "Graminoid Poor Fen", "Graminoid Rich Fen", "Meadow Marsh", "Fen", "Herbaceous", "Open Shrubs", "Tall Shrubs", "Other"))))
                                                               
 frames[[50]] ```

I've tried changing the extent using the "ext" argument, as well as the projection but neither of these options have worked. 
0

There are 0 answers