cran / movecost

:exclamation: This is a read-only mirror of the CRAN R package repository. movecost — Calculation of Slope-Dependant Accumulated Cost Surface, Least-Cost Paths, Least-Cost Corridors, Least-Cost Networks Related to Human Movement Across the Landscape
3 stars 0 forks source link

Unable to find an inherited method for function ‘coordinates’ for signature ‘obj = "sf" on RStudio, and for automatic conversion of "ddiMatrix" in "dgTMatrix" on QGIS #2

Closed ThomasAndreArchgeo closed 2 months ago

ThomasAndreArchgeo commented 2 months ago

Hello,

First of all, thanks for your work and your library/package. The number of functions and ways of using them are really very practical, and have helped me on several occasions during the first year of my master's degree in archaeology.

The problem is that I haven't used it for several months, and when I try to test it again with data that worked last year, an error message appears, either with the QGIS extension or with the library on R. I suspect it has something to do with all the QGIS and R updates, but I wanted to know what I could do to use it again. Just to be sure after several tests on QGIS, I also tried a test using RStudio directly, but a different error message appears, leaving me puzzled. With the error messages, I realized that it might be a problem linked to the DTM used, so I tried to use the studyplot parameter with a SpatialPolygonDataFrame of the area, as presented in the library documentation (section Acquiring online elevation data). However, the same error message was displayed...

I'm sure my problem isn't a big one, and it's probably something I haven't thought of, but I confess I have no idea how to fix it. Can you tell me if my problem comes from my raster, from the way I call it in RStudio or from the version of one of the components I'm using (QGIS, R, etc...)?

Thank you in advance for your attention to my message and for your answer. I can send you further information or data if necessary. With my sincere appreciation,

Thomas ANDRE French master in a master's degree in archaeology


Information on my the setup : Running under : Windows 11 QGIS : 3.34.7 -Prizren Qt : 5.15.13 Python : 3.12.3 GDAL : 3.8.5 GEOS : 3.12.1-CAPI-1.18.1 Proj : Rel. 9.4.0, March 1st, 2024 PDAL : 2.6.3 (git-version: 816ce1) R : QGIS R Provider version 4.1.0


Error messages (translated from French, trying to retain the key words) :


1) QGIS " R execution console output Please note that rgdal will be retired during 2023, plan transition to sf/stars/terra functions using GDAL and PROJ at your earliest convenience. See https://r-spatial.org/r/2022/04/12/evolution.html and https://github.com/r-spatial/evolution rgdal: version: 1.6-5, (SVN revision 1199) Geospatial Data Abstraction Library extensions to R successfully loaded Loaded GDAL runtime: GDAL 3.5.2, released 2022/09/02 Path to GDAL shared files: C:/Users/MyName/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/rlibs/rgdal/gdal GDAL binary built with GEOS: TRUE Loaded PROJ runtime: Rel. 8.2.1, January 1st, 2022, [PJ_VERSION: 821] Path to PROJ shared files: C:\PROGRA~1\QGIS 3.34.7\share\proj PROJ CDN enabled: FALSE Linking to sp version:1.6-0 To mute warnings of possible GDAL/OSR exportToProj4() degradation, use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal. Notification message : In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) : PROJ/GDAL PROJ string degradation in workflow repeated warnings suppressed Discarded datum Unknown based on GRS80 ellipsoid in Proj4 definition Warning : package 'movecost' is currently in use and will not be installed Error in as(x, "dgTMatrix") : Unable to find an inherited method for function for automatic conversion of "ddiMatrix" in "dgTMatrix" Calls : movecost ... geoCorrection -> .local -> adjacencyFromTransition -> as Execution stopped "


2) RStudio r = raster ("C:\Users\MyName\Desktop\Raster.tif") shp1 <- st_read(dsn = 'C:\Users\MyName\Desktop\Start.shp',layer = 'Start') shp2 <- st_read(dsn = 'C:\Users\MyName\Desktop\Goal.shp',layer = 'Goal') result <- movecost(origin=shp1, destin=shp2, studyplot=r,return.base=TRUE)

" Accessing raster elevation [=========================] 100% Mosaicing & Projecting Erreur in h(simpleError(msg, call)) : Erorr in argument 'fromCoords' evaluation when selecting a method for the function 'accCost' : unable to find an inherited method for function ‘coordinates’ for signature ‘obj = "sf"’ "

gaborcsardi commented 2 months ago

Hi, this is a read only mirror of CRAN, please see the package authors in the DESCRIPTION file. Look for Maintainer, BugReports and URL. Thanks!