Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lwgeom: Imports rather than suggests #1594

Closed
andybeet opened this issue Feb 4, 2021 · 2 comments
Closed

lwgeom: Imports rather than suggests #1594

andybeet opened this issue Feb 4, 2021 · 2 comments

Comments

@andybeet
Copy link

andybeet commented Feb 4, 2021

Wondering if lwgeom should be listed under Imports in DESCRIPTION file rather than Suggests

areaPolygon <- sf::st_read(dsn = system.file("extdata", "strata.shp",package = "survdat"), quiet = T)
sf::st_area(areaPolygon)

returns an Error message:

Error in st_area.sfc(st_geometry(x), ...) :
package lwgeom required, please install it first

Maybe this is intended. If so, then feel free to close this.

I have since installed lwgeom and all is fine

@edzer
Copy link
Member

edzer commented Feb 5, 2021

Yes, this is intended.

@edzer edzer closed this as completed Feb 5, 2021
@dhersz
Copy link

dhersz commented Feb 10, 2021

Hello @edzer, I believe I have stumbled upon a small issue that arises from this as well.

I'm building a package that imports {sf}, and more specifically I use st_length() in one of my functions.

I initially added {sf} to my package "Imports", but when I checked it I got a few {lwgeom} related errors:

Running examples in 'gtfstools-Ex.R' failed
   The error most likely occurred in:
   
   > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
   > ### Name: get_trip_speed
   > ### Title: Get trip speed
   > ### Aliases: get_trip_speed
   > 
   > ### ** Examples
   > 
   > data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
   > 
   > gtfs <- read_gtfs(data_path)
   > 
   > trip_speed <- get_trip_speed(gtfs)
   Error in sf::st_length(trips_geometries) : 
     package lwgeom required, please install it first

This error happens when the examples are running, but some similar errors happen with the tests.

Then I added {lwgeom} to imports. The check runs fine, but in the end I got a note: NOTE: Namespaces in Imports field not imported from: 'lwgeom'

Perhaps you have an idea on how to deal with this? Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants