Issues Combining Bathymetric and Elevation Data The 2019 Stack Overflow Developer Survey...

Getting crown tickets for Statue of Liberty

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

The phrase "to the numbers born"?

Is it possible for absolutely everyone to attain enlightenment?

What information about me do stores get via my credit card?

Does HR tell a hiring manager about salary negotiations?

How to translate "being like"?

Pokemon Turn Based battle (Python)

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Can an undergraduate be advised by a professor who is very far away?

How can I define good in a religion that claims no moral authority?

How to notate time signature switching consistently every measure

Mathematics of imaging the black hole

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Is an up-to-date browser secure on an out-of-date OS?

Geography at the pixel level

Is it safe to harvest rainwater that fell on solar panels?

Kerning for subscripts of sigma?

How do I free up internal storage if I don't have any apps downloaded?

The difference between dialogue marks

How to support a colleague who finds meetings extremely tiring?

How do you keep chess fun when your opponent constantly beats you?

How did passengers keep warm on sail ships?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?



Issues Combining Bathymetric and Elevation Data



The 2019 Stack Overflow Developer Survey Results Are InOverlaying elevation data and bathymetry data in RHardware and software for capturing bathymetric lake elevations?How to correlate raster map and elevation data?Detailed Bathymetric/Bathymetry contour data (0-200M)Elevation and point dataSeeking data source for worldwide cross-sections of topographic and bathymetric for woodworking art project?Lake Victoria bathymetric dataCreating bathymetric contours using shoreline point data and transect point data in ArcGIS Desktop?Downloading bathymetric data for free?Plotting and analyzing extracted elevation data in R?Overlaying elevation data and bathymetry data in R





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Here is some elevation data of some islands.



Land Only



I wish to add depth info to the water. With the generous help of @Spacedman here I get:



Water and Land I



To resolve the blockyness of the lower resolution water data I tried, resample(to_harbour, to_island, method = "bilinear") yielding:



enter image description here



I'm not sure if that is correct. Note that I have lost some of the water around the islands. I'm not sure why this is nor am I sure how I should identify the water in to_island. Currently I am just looking at the data and guessing that values less than 75.109m are water and should be looked up from the bathymetric raster layer.



Dropbox:



to_island



to_harbour



Code



library(sp)
library(raster)

library(tidyverse)
library(rayshader)

to_island <- readRDS(file = "to_island.RDS") # https://www.dropbox.com/s/hc86gzdt6nm4j4w/to_island.RDS?dl=0
to_harbour <- readRDS(file = "to_harbour.RDS") # https://www.dropbox.com/s/awl4clyb3254n14/to_harbour.RDS?dl=0

# Create matrix for 3D plotting
to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
nrow = ncol(to_island), ncol = nrow(to_island))

# 3D plot land without water depth info ####################################################
to_island_matrix %>%
sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
waterlinecolor = "white", waterlinealpha = 0.5)

render_snapshot()
rgl::clear3d()

###########################################################################################
# Add water depth values to land raster layer ##############################################

# Resample to_harbour to match higher resolution of to_island
to_harbour_res <- resample(to_harbour, to_island, method = "bilinear")


# Identify points on to_island that are water
w <- which(to_island[] < 75.109)
length(w)

# Get coordinates of those points (water)
xy <- SpatialPoints(to_island)[w]

# Add CRS
proj4string(xy) = projection(to_island)

# These locations aren't in the coordinate system of the water raster so we need to transform them (WGS84 v NAD83)
xyt = spTransform(xy, projection(to_harbour))

# Get the water raster values at those points:
ex = raster::extract(to_harbour_res, xyt)

# Replace the locations in the land raster with the values sampled from from the water raster:
to_island[w] = ex

# Create matrix for 3D plotting
to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
nrow = ncol(to_island), ncol = nrow(to_island))

# # 3D plot land WITH water depth info
to_island_matrix %>%
sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
waterlinecolor = "white", waterlinealpha = 0.5)

render_snapshot()
rgl::clear3d()








share





























    0















    Here is some elevation data of some islands.



    Land Only



    I wish to add depth info to the water. With the generous help of @Spacedman here I get:



    Water and Land I



    To resolve the blockyness of the lower resolution water data I tried, resample(to_harbour, to_island, method = "bilinear") yielding:



    enter image description here



    I'm not sure if that is correct. Note that I have lost some of the water around the islands. I'm not sure why this is nor am I sure how I should identify the water in to_island. Currently I am just looking at the data and guessing that values less than 75.109m are water and should be looked up from the bathymetric raster layer.



    Dropbox:



    to_island



    to_harbour



    Code



    library(sp)
    library(raster)

    library(tidyverse)
    library(rayshader)

    to_island <- readRDS(file = "to_island.RDS") # https://www.dropbox.com/s/hc86gzdt6nm4j4w/to_island.RDS?dl=0
    to_harbour <- readRDS(file = "to_harbour.RDS") # https://www.dropbox.com/s/awl4clyb3254n14/to_harbour.RDS?dl=0

    # Create matrix for 3D plotting
    to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
    nrow = ncol(to_island), ncol = nrow(to_island))

    # 3D plot land without water depth info ####################################################
    to_island_matrix %>%
    sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
    plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
    water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
    waterlinecolor = "white", waterlinealpha = 0.5)

    render_snapshot()
    rgl::clear3d()

    ###########################################################################################
    # Add water depth values to land raster layer ##############################################

    # Resample to_harbour to match higher resolution of to_island
    to_harbour_res <- resample(to_harbour, to_island, method = "bilinear")


    # Identify points on to_island that are water
    w <- which(to_island[] < 75.109)
    length(w)

    # Get coordinates of those points (water)
    xy <- SpatialPoints(to_island)[w]

    # Add CRS
    proj4string(xy) = projection(to_island)

    # These locations aren't in the coordinate system of the water raster so we need to transform them (WGS84 v NAD83)
    xyt = spTransform(xy, projection(to_harbour))

    # Get the water raster values at those points:
    ex = raster::extract(to_harbour_res, xyt)

    # Replace the locations in the land raster with the values sampled from from the water raster:
    to_island[w] = ex

    # Create matrix for 3D plotting
    to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
    nrow = ncol(to_island), ncol = nrow(to_island))

    # # 3D plot land WITH water depth info
    to_island_matrix %>%
    sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
    plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
    water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
    waterlinecolor = "white", waterlinealpha = 0.5)

    render_snapshot()
    rgl::clear3d()








    share

























      0












      0








      0








      Here is some elevation data of some islands.



      Land Only



      I wish to add depth info to the water. With the generous help of @Spacedman here I get:



      Water and Land I



      To resolve the blockyness of the lower resolution water data I tried, resample(to_harbour, to_island, method = "bilinear") yielding:



      enter image description here



      I'm not sure if that is correct. Note that I have lost some of the water around the islands. I'm not sure why this is nor am I sure how I should identify the water in to_island. Currently I am just looking at the data and guessing that values less than 75.109m are water and should be looked up from the bathymetric raster layer.



      Dropbox:



      to_island



      to_harbour



      Code



      library(sp)
      library(raster)

      library(tidyverse)
      library(rayshader)

      to_island <- readRDS(file = "to_island.RDS") # https://www.dropbox.com/s/hc86gzdt6nm4j4w/to_island.RDS?dl=0
      to_harbour <- readRDS(file = "to_harbour.RDS") # https://www.dropbox.com/s/awl4clyb3254n14/to_harbour.RDS?dl=0

      # Create matrix for 3D plotting
      to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
      nrow = ncol(to_island), ncol = nrow(to_island))

      # 3D plot land without water depth info ####################################################
      to_island_matrix %>%
      sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
      plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
      water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
      waterlinecolor = "white", waterlinealpha = 0.5)

      render_snapshot()
      rgl::clear3d()

      ###########################################################################################
      # Add water depth values to land raster layer ##############################################

      # Resample to_harbour to match higher resolution of to_island
      to_harbour_res <- resample(to_harbour, to_island, method = "bilinear")


      # Identify points on to_island that are water
      w <- which(to_island[] < 75.109)
      length(w)

      # Get coordinates of those points (water)
      xy <- SpatialPoints(to_island)[w]

      # Add CRS
      proj4string(xy) = projection(to_island)

      # These locations aren't in the coordinate system of the water raster so we need to transform them (WGS84 v NAD83)
      xyt = spTransform(xy, projection(to_harbour))

      # Get the water raster values at those points:
      ex = raster::extract(to_harbour_res, xyt)

      # Replace the locations in the land raster with the values sampled from from the water raster:
      to_island[w] = ex

      # Create matrix for 3D plotting
      to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
      nrow = ncol(to_island), ncol = nrow(to_island))

      # # 3D plot land WITH water depth info
      to_island_matrix %>%
      sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
      plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
      water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
      waterlinecolor = "white", waterlinealpha = 0.5)

      render_snapshot()
      rgl::clear3d()








      share














      Here is some elevation data of some islands.



      Land Only



      I wish to add depth info to the water. With the generous help of @Spacedman here I get:



      Water and Land I



      To resolve the blockyness of the lower resolution water data I tried, resample(to_harbour, to_island, method = "bilinear") yielding:



      enter image description here



      I'm not sure if that is correct. Note that I have lost some of the water around the islands. I'm not sure why this is nor am I sure how I should identify the water in to_island. Currently I am just looking at the data and guessing that values less than 75.109m are water and should be looked up from the bathymetric raster layer.



      Dropbox:



      to_island



      to_harbour



      Code



      library(sp)
      library(raster)

      library(tidyverse)
      library(rayshader)

      to_island <- readRDS(file = "to_island.RDS") # https://www.dropbox.com/s/hc86gzdt6nm4j4w/to_island.RDS?dl=0
      to_harbour <- readRDS(file = "to_harbour.RDS") # https://www.dropbox.com/s/awl4clyb3254n14/to_harbour.RDS?dl=0

      # Create matrix for 3D plotting
      to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
      nrow = ncol(to_island), ncol = nrow(to_island))

      # 3D plot land without water depth info ####################################################
      to_island_matrix %>%
      sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
      plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
      water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
      waterlinecolor = "white", waterlinealpha = 0.5)

      render_snapshot()
      rgl::clear3d()

      ###########################################################################################
      # Add water depth values to land raster layer ##############################################

      # Resample to_harbour to match higher resolution of to_island
      to_harbour_res <- resample(to_harbour, to_island, method = "bilinear")


      # Identify points on to_island that are water
      w <- which(to_island[] < 75.109)
      length(w)

      # Get coordinates of those points (water)
      xy <- SpatialPoints(to_island)[w]

      # Add CRS
      proj4string(xy) = projection(to_island)

      # These locations aren't in the coordinate system of the water raster so we need to transform them (WGS84 v NAD83)
      xyt = spTransform(xy, projection(to_harbour))

      # Get the water raster values at those points:
      ex = raster::extract(to_harbour_res, xyt)

      # Replace the locations in the land raster with the values sampled from from the water raster:
      to_island[w] = ex

      # Create matrix for 3D plotting
      to_island_matrix = matrix(raster::extract(to_island, raster::extent(to_island), buffer = 10000),
      nrow = ncol(to_island), ncol = nrow(to_island))

      # # 3D plot land WITH water depth info
      to_island_matrix %>%
      sphere_shade(zscale = 0.1, texture = "imhof1") %>% # Lower zscale maps points to wider range of colours
      plot_3d(to_island_matrix, zscale = 1, fov = 0, theta = 170, phi = 30, windowsize = c(1000, 800), zoom = 0.35,
      water = TRUE, waterdepth = 75.2, wateralpha = 0.5, watercolor = "#88DDFF",
      waterlinecolor = "white", waterlinealpha = 0.5)

      render_snapshot()
      rgl::clear3d()






      raster r elevation bathymetry





      share












      share










      share



      share










      asked 4 mins ago









      ixodidixodid

      14117




      14117






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318551%2fissues-combining-bathymetric-and-elevation-data%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318551%2fissues-combining-bathymetric-and-elevation-data%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

          Meter-Bus Содержание Параметры шины | Стандартизация |...