bmcgaughey1 / USGSlidar

A collection of functions to browse lidar data collections, query collections for coverage for specific locations, and retrieve data covering locations.
Creative Commons Zero v1.0 Universal
5 stars 1 forks source link

Modify buildPDALPipelineENTWINE() function to add an option specific the entwine data hosted by NOAA #13

Open bmcgaughey1 opened 2 years ago

bmcgaughey1 commented 2 years ago

NOAA has their own entwine data collection. It has data in various projections (unlike the USGS collection that is all web mercator). Paco Mauro suggested a change to reproject the sample polygon into the same projection as the lidar data before constructing the pipeline. It makes sense to add a NOAA = TRUE/FALSE option that would change the default pipelineScript and invoke code to project the sample polygon and then use the projected bounding box to construct the pipeline.

The change relies on inputPolygons having horiz_crs and vert_crs columns so some testing to make sure these are valid will be needed. Otherwise the change should be easy to implement.

this is from the note from Paco regarding the change:

get feature bounding box

                          #             CHANGED HERE
                          sp_thePoly<-polys[thePoly,]
                          out_crs<-paste("+init=epsg:",sp_thePoly@data[,"horiz_crs"],"+",
                                                        sp_thePoly@data[,"vert_crs"],sep="")
                          print(out_crs)
                          sp_thePoly<-spTransform(sp_thePoly,CRS(out_crs))
                          bb <- sf::st_bbox(sp_thePoly)

                          # make substitutions