Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite0eebf6

Browse files
committed
Updateeez()
1 parent694ed73 commite0eebf6

File tree

8 files changed

+538
-3
lines changed

8 files changed

+538
-3
lines changed

‎R/eez.R‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,22 @@
2929
#' geom_sf(data = districts(), mapping = aes(fill = district), col = "white") +
3030
#' guides(fill = "none")
3131
#'
32+
#' # WGS 84 projection
33+
#' ggplot() +
34+
#' geom_sf(data = eez(crs = "EPSG:4326"), fill = NA, linewidth = 1, col = "gray") +
35+
#' geom_sf(data = districts(crs = "EPSG:4326"), mapping = aes(fill = district), col = "white") +
36+
#' guides(fill = "none")
37+
#'
38+
#'
3239
#' @export
3340
eez<-function(crs= laea_azores_proj(),distance=200) {
3441

3542
# If `distance` is 200 nautical miles, then buffer_distance is
3643
distance_meters<-distance*1852# 370,400 meters
3744
islands<- districts()
3845
eez_buffers<-sf::st_buffer(islands,dist=distance_meters)
39-
eez<-sf::st_union(eez_buffers)
40-
41-
sf::st_transform(x=eez,crs=crs)
46+
eez<-sf::st_union(eez_buffers)|>
47+
sf::st_transform(crs=crs)
4248

4349
eez
4450
}

‎README.Rmd‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ parishes |>
9090
guides(fill = "none")
9191
```
9292

93+
##Exclusive Economic Zone
94+
95+
```{r dev='svg', fig.width=12}
96+
# LAEA custom projection
97+
ggplot() +
98+
geom_sf(data = eez(), fill = NA, linewidth = 1, col = "gray") +
99+
geom_sf(data = districts(), mapping = aes(fill = district), col = "white") +
100+
guides(fill = "none")
101+
102+
# WGS 84 projection
103+
ggplot() +
104+
geom_sf(data = eez(crs = "EPSG:4326"), fill = NA, linewidth = 1, col = "gray") +
105+
geom_sf(data = districts(crs = "EPSG:4326"), mapping = aes(fill = district), col = "white") +
106+
guides(fill = "none")
107+
```
108+
109+
93110
##Sources
94111

95112
-[Carta Administrativa Oficial de Portugal](https://www.dgterritorio.gov.pt/cartografia/cartografia-tematica/caop)

‎README.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,29 @@ parishes |>
177177

178178
<imgsrc="man/figures/README-unnamed-chunk-4-1.svg"width="100%" />
179179

180+
##Exclusive Economic Zone
181+
182+
```r
183+
# LAEA custom projection
184+
ggplot()+
185+
geom_sf(data= eez(),fill=NA,linewidth=1,col="gray")+
186+
geom_sf(data= districts(),mapping= aes(fill=district),col="white")+
187+
guides(fill="none")
188+
```
189+
190+
<imgsrc="man/figures/README-unnamed-chunk-5-1.svg"width="100%" />
191+
192+
```r
193+
194+
# WGS 84 projection
195+
ggplot()+
196+
geom_sf(data= eez(crs="EPSG:4326"),fill=NA,linewidth=1,col="gray")+
197+
geom_sf(data= districts(crs="EPSG:4326"),mapping= aes(fill=district),col="white")+
198+
guides(fill="none")
199+
```
200+
201+
<imgsrc="man/figures/README-unnamed-chunk-5-2.svg"width="100%" />
202+
180203
##Sources
181204

182205
-[Carta Administrativa Oficial de

‎man/eez.Rd‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
31.8 KB
Loading

‎man/figures/README-unnamed-chunk-5-1.svg‎

Lines changed: 203 additions & 0 deletions
Loading
27.3 KB
Loading

‎man/figures/README-unnamed-chunk-5-2.svg‎

Lines changed: 279 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp