-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
terrainr: Retrieve Data from the USGS National Map and Transform it for 3D Landscape Visualizations #416
Comments
Hello @mikemahoney218, thanks for submitting your package. @ldecicco-USGS will be your Handling Editor. You will hear from her soon. |
Great news, we have our first reviewer @mikejohnson51. I may or may not try to find another Mike be reviewer 2 😬 |
I had a few people respond that if I didn't find someone by the new year, they'd volunteer, so I expect a 2nd reviewer any day. In the meantime, I ran a check and The
Which is not bad! If you want to work on the code coverage, that's always good. |
Fantastic! Thank you so much for the update :) One thing to mention -- a lot of the package tests are set to skip on CRAN, as they either take too long, require internet access, or require GDAL. They should still be able to run locally, however (and on CI) with
Thanks again for the update! 😄 |
Ah right! Thanks for the reminder, I just got a new computer and my old computer had NOT_CRAN=true set by default. |
Hi all! Just wanted to note here that I've changed the main branch from |
I believe I've spoken too soon! It appears that the I apologize for needing to make this update while the package is under review! The version originally submitted still exists as release v 0.2.0. Does it make sense to update the version under review to the version with this fix (would become version 0.2.1), or should I wait and roll this update in with any revisions requested after review? |
I'd vote to update the version under review to 0.2.1 with the fix. If that causes any confusion, I'm sure we can deal with it. |
Great! I've cut a release of 0.2.1 and split it into a release branch, both of which should hopefully remain even with Thanks! |
We've got a second reviewer @sfoks 🎉 |
Hi @mikemahoney218 @ldecicco-USGS , Please find my review of Overall this is a very nice package. I want to emphasize this as, by nature, the following comments are more critique then complimentary. The package functions well, is stable and installed without problems. I did not get to test any of the Unity functionality since I don't have it. Other then that here are some key points: Key Points:
Branding
Code Review:Below are my notes as I went through the files and package: Install
Great! 👍
|
Thanks so much @mikejohnson51 ! I heard back from @sfoks that the second review should be done sometime early next week. So @mikemahoney218 , feel free to start responding to this first review or wait for both to be submitted. |
Thank you Mike for the thorough review! Below I've attempted to go through your comments line-by-line; I've collapsed comments that were repeated into single items (mostly httr/sf related) and removed the complements (though they were much appreciated :) ) for length. All the changes below are now merged to main as version 0.3.0.
I fully agree that the API code overlaps slightly with a few other packages (particularly the FedData package, which uses two of the same services). As far as the API wrapper code is concerned, I see the primary differences as being:
With that said, I think the main differentiator of terrainr is the workflow it introduces for creating 3D terrain tiles with overlays in the Unity engine. There's a lot of buzz in visualization research about using game engines for interactive simulations of landscape dynamics, which is why I originally started working on terrainr; the I've clarified that most endpoints are returned as tiles. I've also attempted to rework documentation to emphasize that the data manipulation and export functionality are at least co-equal goals to the retrieval functions; unfortunately, as these functions need data to manipulate, the data retrieval functions have to before the manipulation functions in any given document. With that said, there are still a number of use cases for these image tiles within R -- see for instance this example with rayshader. I imagine the new
I've attempted to use Following last month's challenge with the transportation endpoint starting to return raw PNGs instead of base64 encoded images, I've changed the way
At the end of the day, I was able to drop
This comment actually took me by surprise originally! It had never even occurred to me that someone would see the name As a quick side note, I want to point out that
Added
I've adopted your suggestion about how to shift these to sf. The older behavior is preserved in order to manipulate latitude/longitude data (but still uses units and sf as suggested). Relevant commit.
These have been removed from all user-facing code. The classes still exist for communication between package functions, but are no longer the only accepted inputs for functions and are not returned by any function.
I personally am very persuaded by progressr's motto:
Letting users control how and why they're updated is the key goal of using progressr, so I'm reluctant to add always-on progress bars (which would trigger three separate times per tile downloaded, I believe) via httr at the moment.
Try setting
I changed the behavior so that now
I've adopted your suggested sf/gdal_warp code entirely, and cannot believe how much faster and cleaner it runs now. Thanks in particular for this suggestion! Relevant commit.
There's a comment in this file from about five months ago that I left as a warning to my future self: Unfortunately, this is still true.
Unfortunately, I'm yet to get this package to work on my laptop due to an issue with Python package dependencies.
Serves me right for not naming my arguments! Addressed both issues here.
I had to do a little bit of investigation into why this function works this way, myself! It turns out that while
I've swapped over to
Doh! Fixed, thank you. |
Package ReviewProvided Review Template
DocumentationThe package includes all the following forms of documentation:
Functionality
Estimated hours spent reviewing: 10 hours
Additional reviewer questions from guide
Review Comments
|
Thank you so much @sfoks and @mikejohnson51 !!!! |
Thank you so much @sfoks ! I've responded to your comments below.
Fixed, thank you! Relevant commit.
This should be resolved thanks to changes made for Mike's review (relevant commit). I've validated that this "works on my machine" without warnings thanks to the new and improved This used to happen when the National Map returned some image tiles with alpha bands and some without, due to a limitation in the workflow we were using; however, whether or not a given tile will have an alpha band seems to change over time (so that running the same query a day later might resolve the issue). I think this resulted in a tile not getting merged into your full raster, resulting in the
Thank you for flagging! Warning 1: -srcwin 0 8194 4097 4097 falls partially outside raster extent. Going on however: You're exactly right, this warning is related to the National Map endpoint not exactly respecting the requested bounding boxes. I've made this explicit in the vignette (relevant commit), but to explain here as well: Since Unity expects to import heightmaps as squares with side lengths that are powers of 2, this function will create tiles that are the right size for Unity; in order to make things easier for the user, those tiles will all be the same size (so users don't need to change sizes for each tile they import). That means that if the input raster isn't exactly divisible by side_length, this function will create tiles with no data past a certain point ("falls partially outside raster extent"). I've left this message as standard output (rather than an official R warning) because I believe it's useful for users to know to expect some no-data regions at the edges of their terrain tiles, but it's standard function behavior (so shouldn't interrupt users who have set In CPL_gdaltranslate(source, destination, options, oo, ... : GDAL Message 1: for band 1, nodata value has been clamped to 0, the original value being out of range.: I believe this is about the issue with mixed 3 & 4 band rasters as mentioned above, and should hopefully be fixed given the new
If you're willing, I'd love to hear what went wrong! I would love to make the unity_instructions vignette as comprehensive as possible for future users.
Thank you! I fully hope and intend to keep adding examples to the documentation moving forward.
Thank you so much for reviewing! |
@mikemahoney218 thanks for detailed response! @sfoks and @mikejohnson51 Could you please indicate whether you are happy with the authors' response? Template https://devguide.ropensci.org/approval2template.html |
Reviewer ResponseFinal approval (post-review)
My earlier comment:
Estimated hours spent reviewing: 11 hours total |
Reviewer ResponseKudos, great work @mikemahoney218 I am happy both as a reviewer and as a future user. The new ggplot tools seem great and all of the answers were well articulated with strong reasoning for keeping/rejecting changes. Figuring out the remaining gdal issue would be nice and, if you can provide a reprex, I am happy to take a look. But that is not needed for package acceptance. Final approval (post-review)
Estimated hours spent reviewing: 6 |
Approved! Thanks @mikemahoney218 for submitting and @sfoks and @mikejohnson51 for your reviews! To-dos:
Should you want to acknowledge your reviewers in your package DESCRIPTION, you can do so by making them Welcome aboard! We'd love to host a post about your package - either a short introduction to it with an example for a technical audience or a longer post with some narrative about its development or something you learned, and an example of its use for a broader readership. If you are interested, consult the blog guide, and tag @stefaniebutland in your reply. She will get in touch about timing and can answer any questions. We've put together an online book with our best practice and tips, this chapter starts the 3d section that's about guidance for after onboarding. Please tell us what could be improved, the corresponding repo is here. |
Thank you so much all! I'd like to include both of you as reviewers ("rev" role) in the DESCRIPTION; I see that @sfoks has specifically agreed to this, but would that be alright with you, @mikejohnson51 ? |
Also, @ldecicco-USGS , I received this error when trying to transfer the repo: Do you have any idea what might be going wrong here? Thank you! |
Ha sure enough... I think you should have an invitation now. Give it another try...and if THAT doesn't work let me know (this is always the step I manage to mess up). |
Second time's the charm! Transferred the repo over: https://github.com/ropensci/terrainr |
Alright, I believe I've done everything on that checklist now @ldecicco-USGS ! I haven't seen the docs build yet on docs.ropensci -- is there anything I need to do here other than wait for the repo to get picked up by CI? I would love to submit a blog for the site! I'll take a look at the guide over the weekend and would love to talk with @stefaniebutland about timing. Thanks again, everyone! |
@mikemahoney218 thanks for the offer, that would great. Congrats on your package! |
Congratulations on passing peer review @mikemahoney218. When you're ready, please submit a draft post by pull request, following instructions in https://blogguide.ropensci.org/. Then my colleague @steffilazerte will review it and suggest a publication date. Followup questions can move to Slack. Cheers! |
Submitting Author: Michael Mahoney (@mikemahoney218)
Repository: https://github.com/mikemahoney218/terrainr
Version submitted: 0.2.1
Editor: @ldecicco-USGS
Reviewer 1: @mikejohnson51
Reviewer 2: @sfoks
Archive: TBD
Version accepted: Feb. 19, 2021
Scope
Please indicate which category or categories from our package fit policies this package falls under: (Please check an appropriate box below. If you are unsure, we suggest you make a pre-submission inquiry.):
Explain how and why the package falls under these categories (briefly, 1-2 sentences):
terrainr
enables users to retrieve geospatial data from the USGS National Map family of APIs and process it into both generic rasters for use in analysis and a specialized format which may be imported into the Unity rendering engine.The data retrieval functions within terrainr are designed to be useful to any researcher interested in geospatial data for areas within the United States, particularly digital elevation models and orthoimagery. The data processing aspect of terrainr is designed to enable more users to use game engines as GIS, producing high-resolution 3D models from spatial data.
I am only aware of two packages which mention the USGS National Map API:
spacey
will move to usingterrainr
for data retrieval.The elevatr package also returns elevation data from the USGS Elevation Point Query Service and AWS Terrain Tiles, which are similar -- but not the same -- sources as used in this package.
This package provides access to 9 API endpoints which I do not believe are incorporated in any other R package. Transforming tiles to be imported into Unity as heightmaps depends on a newly-contributed feature to the magick package, which leads me to believe this package is the first to provide this functionality.
N/A
N/A
Technical checks
Confirm each of the following by checking the box.
This package:
Publication options
Do you intend for this package to go on CRAN?
Do you intend for this package to go on Bioconductor?
Do you wish to submit an Applications Article about your package to Methods in Ecology and Evolution? If so:
MEE Options
Code of conduct
The text was updated successfully, but these errors were encountered: