Skip to content

Commit

Permalink
fix maps, and update attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
AquaAuma committed Mar 15, 2023
1 parent bdf499f commit 6bd06ed
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
11 changes: 6 additions & 5 deletions code/create_layer/i.add_attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ library(tidyverse)
library(ggplot2)


bpow <- st_read(dsn = "/Users/auroremaureaud/Documents/bpow_p10.shp")
bpow <- st_read(dsn = "outputs/bpow_p10_attributes_clip2.shp") %>%
dplyr::select(ID) %>%
st_zm(drop = TRUE, what = "ZM")
attributes <- st_read("outputs/bpow/bpow_p8s5_abyssal_corr.shp") %>%
st_drop_geometry() %>%
mutate(depth_r = ifelse(type = "coastal", "0-800m", NA_character_),
depth_r = ifelse(type = "bathyal", "800-3,500m", depth_r),
mutate(depth_r = ifelse(type == "coastal", "0-800m", NA_character_),
depth_r = ifelse(type == "bathyal", "800-3,500m", depth_r),
depth_r = ifelse(type == "abyssal", "3,500-6,500m", depth_r),
depth_r = ifelse(type == "hadal", "6,500m+", depth_r))

bpow <- left_join(bpow, attributes, by = "ID")

st_write(bpow, dsn = "outputs/bpow/bpow_p10_attributes.shp",
append=F)
st_write(bpow, dsn = "outputs/bpow/bpow_p10_final.shp")
5 changes: 3 additions & 2 deletions code/make_figures/make_figure_3.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ library(tiff)
library(RColorBrewer)

# load layer
eco <- st_read("outputs/bpow_p10_attributes_clip2.shp")
st_crs(eco) <- st_crs(world)
eco <- st_read("outputs/bpow_p10_attributes_clip2.shp") %>%
st_crop(c(xmin=-180, xmax=180, ymin=-90, ymax=90)) %>%
st_transform(crs = "+proj=moll")


################################################################################
Expand Down
Binary file modified figures/figure_3/figure3_abyssal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/figure_3/figure3_bathyal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/figure_3/figure3_coastal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/figure_3/figure3_hadal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion methods.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ library(here)

- Step #2: Fix the boundaries of the layer

`-ArcGIS:`
`-ArcGIS: Creation of boundary box to clip the layer`

## Part X: Clipping to global landmasses

Expand Down
14 changes: 9 additions & 5 deletions methods.html
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ <h2>Part IX: Quality checks</h2>
append=F)</code></pre>
<ul>
<li><p>Step #2: Fix the boundaries of the layer</p>
<p><code>-ArcGIS:</code></p></li>
<p><code>-ArcGIS: Creation of boundary box to clip the layer</code></p></li>
</ul>
</div>
<div id="part-x-clipping-to-global-landmasses" class="section level2">
Expand All @@ -1600,14 +1600,18 @@ <h2>Part X: Clipping to global landmasses</h2>
library(ggplot2)


bpow &lt;- st_read(dsn = &quot;/Users/auroremaureaud/Documents/bpow_p10.shp&quot;)
bpow &lt;- st_read(dsn = &quot;outputs/bpow_p10_attributes_clip2.shp&quot;) %&gt;%
dplyr::select(ID)
attributes &lt;- st_read(&quot;outputs/bpow/bpow_p8s5_abyssal_corr.shp&quot;) %&gt;%
st_drop_geometry()
st_drop_geometry() %&gt;%
mutate(depth_r = ifelse(type = &quot;coastal&quot;, &quot;0-800m&quot;, NA_character_),
depth_r = ifelse(type = &quot;bathyal&quot;, &quot;800-3,500m&quot;, depth_r),
depth_r = ifelse(type == &quot;abyssal&quot;, &quot;3,500-6,500m&quot;, depth_r),
depth_r = ifelse(type == &quot;hadal&quot;, &quot;6,500m+&quot;, depth_r))

bpow &lt;- left_join(bpow, attributes, by = &quot;ID&quot;)

st_write(bpow, dsn = &quot;outputs/bpow/bpow_p10_attributes.shp&quot;,
append=F)</code></pre>
st_write(bpow, dsn = &quot;outputs/bpow/bpow_p10_final.shp&quot;)</code></pre>
</div>
</div>
<div id="references" class="section level1 unnumbered">
Expand Down
Binary file modified methods.pdf
Binary file not shown.

0 comments on commit 6bd06ed

Please sign in to comment.