Skip to content

Commit 5e53d64

Browse files
committed
Create distribution for MTN grids #61
1 parent 7a6e88a commit 5e53d64

File tree

61 files changed

+498
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+498
-73
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ doc
3434
Meta
3535
CRAN-RELEASE
3636
cran-comments.md
37+
vignettes/
38+
dev/

MTN/MTN/img/grid-preview-1.png

6.68 KB
Loading

MTN/MTN/img/grid-preview-2.png

4.89 KB
Loading

MTN/MTN/img/grid-preview-3.png

6.16 KB
Loading

MTN/MTN/img/grid-preview-4.png

5.04 KB
Loading

MTN/MTN/img/grid-preview-5.png

6.4 KB
Loading

MTN/MTN/img/grid-preview-6.png

5.87 KB
Loading

MTN/MTN/img/grid-preview-7.png

6.21 KB
Loading

MTN/README.Rmd

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
---
2+
title: "MTN Grids"
3+
output:
4+
github_document:
5+
html_preview: false
6+
toc: true
7+
toc_depth: 3
8+
---
9+
10+
```{r config, message=FALSE, warning=FALSE, include=FALSE}
11+
12+
knitr::opts_chunk$set(
13+
collapse = TRUE,
14+
tidy = "styler",
15+
comment = "#>",
16+
fig.path = "MTN/img/grid-"
17+
)
18+
19+
library(sf)
20+
library(dplyr)
21+
```
22+
23+
**Updated: `r Sys.Date()`**
24+
25+
## DESCRIPCIÓN DE LOS DISTINTOS JUEGOS DE CUADRÍCULAS CARTOGRÁFICAS (ES)
26+
27+
- **MTN25_ED50_Peninsula_Baleares.shp**
28+
29+
Cuadrícula del MTN25 correspondiente a la Península e Islas Baleares, en
30+
ED50 y coordenadas geográficas (longitud, latitud) Se trata de la cuadrícula
31+
real del MTN25, es decir, aquella que divide a la serie impresa actual del
32+
mapa, teniendo en cuenta hojas especiales e irregularidades.
33+
34+
- **MTN50_ED50_Peninsula_Baleares.shp**
35+
36+
Cuadrícula del MTN50 correspondiente a la Península e Islas Baleares, en
37+
ED50 y coordenadas geográficas (longitud, latitud) Se trata de la cuadrícula
38+
real del MTN50, es decir, aquella que divide a la serie impresa actual del
39+
mapa, teniendo en cuenta hojas especiales e irregularidades.
40+
41+
- **MTN25_ETRS89_ceuta_melilla_alboran.shp**
42+
43+
Cuadrícula del MTN25 correspondiente a Ceuta, Melilla, Alborán y posesiones
44+
españolas en el Norte de África, ajustada al nuevo sistema geodésico de
45+
referencia oficial ETRS89, en coordenadas geográficas (longitud, latitud).
46+
47+
- **MTN25_ETRS89_Peninsula_Baleares_Canarias.shp**
48+
49+
Cuadrícula real del MTN25 correspondiente a la Península, Baleares y
50+
Canarias, ajustada al nuevo sistema geodésico de referencia oficial ETRS89,
51+
en coordenadas geográficas (longitud, latitud).
52+
53+
- **MTN50_ETRS89_Peninsula_Baleares_Canarias.shp**
54+
55+
Cuadrícula real del MTN50 correspondiente a la Península, Baleares y
56+
Canarias, ajustada al nuevo sistema geodésico de referencia oficial ETRS89,
57+
en coordenadas geográficas (longitud, latitud).
58+
59+
- **MTN25_RegCan95_Canarias.shp**
60+
61+
Cuadrícula del MTN25 correspondiente a Canarias, en REGCAN95 (compatible
62+
WGS84) y coordenadas geográficas (longitud, latitud). Se trata de la
63+
cuadrícula real del MTN25, es decir, aquella que divide a la serie impresa
64+
actual del mapa, teniendo en cuenta la distribución especial de las hojas de
65+
Canarias.
66+
67+
- **MTN50_RegCan95_Canarias.shp**
68+
69+
Cuadrícula del MTN50 correspondiente a Canarias, en REGCAN95 (compatible
70+
WGS84) y coordenadas geográficas (longitud, latitud). Se trata de la
71+
cuadrícula real del MTN50, es decir, aquella que divide a la serie impresa
72+
actual del mapa, teniendo en cuenta la distribución especial de las hojas de
73+
Canarias.
74+
75+
## DESCRIPTION OF THE DIFFERENT CARTOGRAPHIC GRID ITEMS (EN)
76+
77+
- **MTN25_ED50_Peninsula_Baleares.shp**
78+
79+
MTN25 grid corresponding to the Peninsula and Balearic Islands, in ED50 and
80+
geographical coordinates (longitude, latitude) This is the real MTN25 grid,
81+
that is, the one that divides the current printed series of the map, taking
82+
into account special sheets and irregularities.
83+
84+
- **MTN50_ED50_Peninsula_Baleares.shp**
85+
86+
MTN50 grid corresponding to the Peninsula and Balearic Islands, in ED50 and
87+
geographical coordinates (longitude, latitude) This is the real MTN50 grid,
88+
that is, the one that divides the current printed series of the map, taking
89+
into account special sheets and irregularities.
90+
91+
- **MTN25_ETRS89_ceuta_melilla_alboran.shp**
92+
93+
MTN25 grid corresponding to Ceuta, Melilla, Alboran and Spanish territories
94+
in North Africa, adjusted to the new official geodetic reference system
95+
ETRS89, in geographical coordinates (longitude, latitude).
96+
97+
- **MTN25_ETRS89_Peninsula_Baleares_Canarias.shp**
98+
99+
MTN25 real grid corresponding to the Peninsula, the Balearic Islands and the
100+
Canary Islands, adjusted to the new ETRS89 official reference geodetic
101+
system, in geographical coordinates (longitude, latitude).
102+
103+
- **MTN50_ETRS89_Peninsula_Baleares_Canarias.shp**
104+
105+
MTN50 real grid corresponding to the Peninsula, the Balearic Islands and the
106+
Canary Islands, adjusted to the new ETRS89 official reference geodetic
107+
system, in geographical coordinates (longitude, latitude).
108+
109+
- **MTN25_RegCan95_Canarias.shp**
110+
111+
MTN25 grid corresponding to the Canary Islands, in REGCAN95 (WGS84
112+
compatible) and geographic coordinates (longitude, latitude). It is the real
113+
MTN25 grid, that is, the one that divides the current printed series of the
114+
map, taking into account the special distribution of the Canary Islands
115+
sheets.
116+
117+
- **MTN50_RegCan95_Canarias.shp**
118+
119+
MTN50 grid corresponding to the Canary Islands, in REGCAN95 (WGS84
120+
compatible) and geographic coordinates (longitude, latitude). This is the
121+
real grid of the MTN50, that is, the one that divides the current printed
122+
series of the map, taking into account the special distribution of the
123+
Canary Islands sheets.
124+
125+
## Table of files
126+
127+
Full reference of each dataset in the [source](./MTN/source) folder.
128+
129+
There are `r length(list.files("dist/", ".gpkg"))` files available:
130+
131+
```{r echo=FALSE, message=FALSE}
132+
133+
library(dplyr)
134+
135+
files <-
136+
list.files("dist/", ".gpkg")
137+
138+
139+
df <- data.frame(
140+
file = files,
141+
stringsAsFactors = FALSE
142+
)
143+
144+
145+
knitr::kable(df)
146+
```
147+
148+
149+
## Preview
150+
151+
```{r preview, echo=FALSE, fig.keep="all", message=FALSE, warning=FALSE, out.width="33%"}
152+
153+
par(mar = c(2, 2, 2, 2))
154+
for (i in seq_len(nrow(df))) {
155+
path <- file.path("dist", df[i, "file"])
156+
157+
input <- st_read(path, stringsAsFactors = FALSE, quiet = TRUE)
158+
159+
plot(st_geometry(input), axes = TRUE, main = df[i, "file"])
160+
}
161+
```

MTN/README.md

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
MTN Grids
2+
================
3+
4+
- [DESCRIPCIÓN DE LOS DISTINTOS JUEGOS DE CUADRÍCULAS CARTOGRÁFICAS
5+
(ES)](#descripción-de-los-distintos-juegos-de-cuadrículas-cartográficas-es)
6+
- [DESCRIPTION OF THE DIFFERENT CARTOGRAPHIC GRID ITEMS
7+
(EN)](#description-of-the-different-cartographic-grid-items-en)
8+
- [Table of files](#table-of-files)
9+
- [Preview](#preview)
10+
11+
**Updated: 2021-11-30**
12+
13+
## DESCRIPCIÓN DE LOS DISTINTOS JUEGOS DE CUADRÍCULAS CARTOGRÁFICAS (ES)
14+
15+
- **MTN25_ED50_Peninsula_Baleares.shp**
16+
17+
Cuadrícula del MTN25 correspondiente a la Península e Islas
18+
Baleares, en ED50 y coordenadas geográficas (longitud, latitud) Se
19+
trata de la cuadrícula real del MTN25, es decir, aquella que divide
20+
a la serie impresa actual del mapa, teniendo en cuenta hojas
21+
especiales e irregularidades.
22+
23+
- **MTN50_ED50_Peninsula_Baleares.shp**
24+
25+
Cuadrícula del MTN50 correspondiente a la Península e Islas
26+
Baleares, en ED50 y coordenadas geográficas (longitud, latitud) Se
27+
trata de la cuadrícula real del MTN50, es decir, aquella que divide
28+
a la serie impresa actual del mapa, teniendo en cuenta hojas
29+
especiales e irregularidades.
30+
31+
- **MTN25_ETRS89_ceuta_melilla_alboran.shp**
32+
33+
Cuadrícula del MTN25 correspondiente a Ceuta, Melilla, Alborán y
34+
posesiones españolas en el Norte de África, ajustada al nuevo
35+
sistema geodésico de referencia oficial ETRS89, en coordenadas
36+
geográficas (longitud, latitud).
37+
38+
- **MTN25_ETRS89_Peninsula_Baleares_Canarias.shp**
39+
40+
Cuadrícula real del MTN25 correspondiente a la Península, Baleares y
41+
Canarias, ajustada al nuevo sistema geodésico de referencia oficial
42+
ETRS89, en coordenadas geográficas (longitud, latitud).
43+
44+
- **MTN50_ETRS89_Peninsula_Baleares_Canarias.shp**
45+
46+
Cuadrícula real del MTN50 correspondiente a la Península, Baleares y
47+
Canarias, ajustada al nuevo sistema geodésico de referencia oficial
48+
ETRS89, en coordenadas geográficas (longitud, latitud).
49+
50+
- **MTN25_RegCan95_Canarias.shp**
51+
52+
Cuadrícula del MTN25 correspondiente a Canarias, en REGCAN95
53+
(compatible WGS84) y coordenadas geográficas (longitud, latitud). Se
54+
trata de la cuadrícula real del MTN25, es decir, aquella que divide
55+
a la serie impresa actual del mapa, teniendo en cuenta la
56+
distribución especial de las hojas de Canarias.
57+
58+
- **MTN50_RegCan95_Canarias.shp**
59+
60+
Cuadrícula del MTN50 correspondiente a Canarias, en REGCAN95
61+
(compatible WGS84) y coordenadas geográficas (longitud, latitud). Se
62+
trata de la cuadrícula real del MTN50, es decir, aquella que divide
63+
a la serie impresa actual del mapa, teniendo en cuenta la
64+
distribución especial de las hojas de Canarias.
65+
66+
## DESCRIPTION OF THE DIFFERENT CARTOGRAPHIC GRID ITEMS (EN)
67+
68+
- **MTN25_ED50_Peninsula_Baleares.shp**
69+
70+
MTN25 grid corresponding to the Peninsula and Balearic Islands, in
71+
ED50 and geographical coordinates (longitude, latitude) This is the
72+
real MTN25 grid, that is, the one that divides the current printed
73+
series of the map, taking into account special sheets and
74+
irregularities.
75+
76+
- **MTN50_ED50_Peninsula_Baleares.shp**
77+
78+
MTN50 grid corresponding to the Peninsula and Balearic Islands, in
79+
ED50 and geographical coordinates (longitude, latitude) This is the
80+
real MTN50 grid, that is, the one that divides the current printed
81+
series of the map, taking into account special sheets and
82+
irregularities.
83+
84+
- **MTN25_ETRS89_ceuta_melilla_alboran.shp**
85+
86+
MTN25 grid corresponding to Ceuta, Melilla, Alboran and Spanish
87+
territories in North Africa, adjusted to the new official geodetic
88+
reference system ETRS89, in geographical coordinates (longitude,
89+
latitude).
90+
91+
- **MTN25_ETRS89_Peninsula_Baleares_Canarias.shp**
92+
93+
MTN25 real grid corresponding to the Peninsula, the Balearic Islands
94+
and the Canary Islands, adjusted to the new ETRS89 official
95+
reference geodetic system, in geographical coordinates (longitude,
96+
latitude).
97+
98+
- **MTN50_ETRS89_Peninsula_Baleares_Canarias.shp**
99+
100+
MTN50 real grid corresponding to the Peninsula, the Balearic Islands
101+
and the Canary Islands, adjusted to the new ETRS89 official
102+
reference geodetic system, in geographical coordinates (longitude,
103+
latitude).
104+
105+
- **MTN25_RegCan95_Canarias.shp**
106+
107+
MTN25 grid corresponding to the Canary Islands, in REGCAN95 (WGS84
108+
compatible) and geographic coordinates (longitude, latitude). It is
109+
the real MTN25 grid, that is, the one that divides the current
110+
printed series of the map, taking into account the special
111+
distribution of the Canary Islands sheets.
112+
113+
- **MTN50_RegCan95_Canarias.shp**
114+
115+
MTN50 grid corresponding to the Canary Islands, in REGCAN95 (WGS84
116+
compatible) and geographic coordinates (longitude, latitude). This
117+
is the real grid of the MTN50, that is, the one that divides the
118+
current printed series of the map, taking into account the special
119+
distribution of the Canary Islands sheets.
120+
121+
## Table of files
122+
123+
Full reference of each dataset in the [source](./MTN/source) folder.
124+
125+
There are 7 files available:
126+
127+
| file |
128+
|:----------------------------------------------|
129+
| MTN25_ED50_Peninsula_Baleares.gpkg |
130+
| MTN25_ETRS89_ceuta_melilla_alboran.gpkg |
131+
| MTN25_ETRS89_Peninsula_Baleares_Canarias.gpkg |
132+
| MTN25_RegCan95_Canarias.gpkg |
133+
| MTN50_ED50_Peninsula_Baleares.gpkg |
134+
| MTN50_ETRS89_Peninsula_Baleares_Canarias.gpkg |
135+
| MTN50_RegCan95_Canarias.gpkg |
136+
137+
## Preview
138+
139+
<img src="MTN/img/grid-preview-1.png" width="33%" /><img src="MTN/img/grid-preview-2.png" width="33%" /><img src="MTN/img/grid-preview-3.png" width="33%" /><img src="MTN/img/grid-preview-4.png" width="33%" /><img src="MTN/img/grid-preview-5.png" width="33%" /><img src="MTN/img/grid-preview-6.png" width="33%" /><img src="MTN/img/grid-preview-7.png" width="33%" />

MTN/create_gpkgs.R

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 1. Config----
2+
3+
rm(list = ls())
4+
library(sf)
5+
library(dplyr)
6+
library(zip)
7+
8+
9+
initwd <- getwd()
10+
11+
setwd("MTN")
12+
13+
# 2. Clean ----
14+
15+
# Clean output dirs
16+
17+
folderfiles <- list.files("dist/")
18+
all <- file.path("dist", folderfiles)
19+
file.remove(all)
20+
21+
22+
# MTN ----
23+
24+
basedir <-
25+
file.path("source")
26+
27+
28+
# List files
29+
shp <- list.files(basedir)
30+
shp <- shp[grep(".shp", shp)]
31+
32+
33+
# Create geopackages
34+
35+
for (i in seq_len(length(shp))) {
36+
path <- file.path(basedir, shp[i])
37+
outpath <- gsub(".shp", ".gpkg", file.path("dist", shp[i]))
38+
39+
if (file.exists(outpath)) {
40+
print(paste0("Skipping ", outpath, ", already in dist"))
41+
next()
42+
}
43+
input <-
44+
st_read(path, stringsAsFactors = FALSE, quiet = TRUE) %>% st_make_valid()
45+
46+
write_sf(input,
47+
outpath,
48+
factorsAsCharacter = FALSE,
49+
overwrite = TRUE
50+
)
51+
}
52+
53+
54+
# 8. Create zip----
55+
# https://stackoverflow.com/questions/23668395/creating-zip-file-from-folders-in-r
56+
57+
58+
59+
60+
files2zip <- dir("dist", full.names = TRUE)
61+
zipr(zipfile = "dist/MTN_grids.zip", files = files2zip)
62+
63+
# Reset wd
64+
65+
setwd(initwd)
66+
67+
rm(list = ls())
1020 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

MTN/dist/MTN25_RegCan95_Canarias.gpkg

120 KB
Binary file not shown.
364 KB
Binary file not shown.
Binary file not shown.

MTN/dist/MTN50_RegCan95_Canarias.gpkg

104 KB
Binary file not shown.

MTN/dist/MTN_grids.zip

932 KB
Binary file not shown.

MTN/img/grid-preview-1.png

6.68 KB
Loading

MTN/img/grid-preview-2.png

4.89 KB
Loading

MTN/img/grid-preview-3.png

6.16 KB
Loading

MTN/img/grid-preview-4.png

5.04 KB
Loading

MTN/img/grid-preview-5.png

6.4 KB
Loading

MTN/img/grid-preview-6.png

5.87 KB
Loading

MTN/img/grid-preview-7.png

6.21 KB
Loading

0 commit comments

Comments
 (0)