pfrater / arcpullr

21 stars 9 forks source link

get_image_layer not accepting bbox as input #7

Closed bchileen closed 1 year ago

bchileen commented 1 year ago

Hello, thank you for this helpful package package!

Im currently working on extracting elevation data (from https://elevation.nationalmap.gov/arcgis/rest/services/3DEPElevation/ImageServer) based on the bounding box of a multiline sf object. When I input the multiline sf object, the tool does as expected and extracts the elevation data for each line feature. While this is useful, want to use a bounding box to get the elevation profile for the entire area surrounding our multiline feature to use as a basemap in tmap which seems possible given the option to use a bbox as input for this function.

However, in lines 374-378 it looks like the function doesn't accept a bbox as an input object. Whenever I run the code with a bbox input in place of an sf object, I get the following error "Error in body_config(body, match.arg(encode)) : object 'bbox_coords' not found". When looking at the code behind the function (lines 334:447 in arcpullr/R/retrieve_layers), I see that the function creates a bbox from the input sf object and then passes that into bbox_coords, but I dont see where the function passes the bbox input to bbox coords. Am I misunderstanding how to pass in the bbox as in input or is the get_image_layer unable to accept bbox as an input in place of an sf?

Thanks for the assistance!

pfrater commented 1 year ago

@bchileen Thanks for catching that!!! Fix should be pushed up to github and will make it's way to CRAN eventually

bchileen commented 1 year ago

Thanks for the speedy response!