USEPA / lakemorpho

Calculate metrics about a lake using just its shape
25 stars 10 forks source link

calc metrics without a raster #26

Closed jsta closed 3 years ago

jsta commented 7 years ago

I think it would be useful to be able to calcLakeMetrics without supplying a raster. I was only interested in width and length in a recent analysis so I used the following non-ideal solution:

lake_outline_sp <- as(spark_outline, "Spatial")
r <- rasterize(lake_outline_sp, raster(lake_outline_sp))

lake_outline_sp <- spTransform(lake_outline_sp, CRS("+proj=utm +zone=10 +datum=WGS84"))
r <- projectRaster(r, crs = "+proj=utm +zone=10 +datum=WGS84")

lake_lm <- lakeSurroundTopo(lake_outline_sp, r)

calcLakeMetrics(lake_lm, bearing = 45, pointDens = 250)
jhollist commented 3 years ago

Issue busting - distant past version!

Have this now dealt with. Warns when this happens and returns NA for those metrics where elevation or depth is required.