boB Rudis 4 years ago
parent
commit
64535e0139
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 198
      2019-11-28-funny.R
  2. 89
      2019-11-29-experimental.R
  3. BIN
      data/GISofThrones/GoT.gvsproj
  4. BIN
      data/GISofThrones/GoTRelease/Continents.dbf
  5. BIN
      data/GISofThrones/GoTRelease/Continents.gvsleg
  6. BIN
      data/GISofThrones/GoTRelease/Continents.shp
  7. BIN
      data/GISofThrones/GoTRelease/Continents.shx
  8. BIN
      data/GISofThrones/GoTRelease/Islands.dbf
  9. BIN
      data/GISofThrones/GoTRelease/Islands.gvsleg
  10. BIN
      data/GISofThrones/GoTRelease/Islands.shp
  11. BIN
      data/GISofThrones/GoTRelease/Islands.shx
  12. 21
      data/GISofThrones/GoTRelease/LICENSE.txt
  13. BIN
      data/GISofThrones/GoTRelease/Lakes.dbf
  14. BIN
      data/GISofThrones/GoTRelease/Lakes.gvsleg
  15. BIN
      data/GISofThrones/GoTRelease/Lakes.shp
  16. BIN
      data/GISofThrones/GoTRelease/Lakes.shx
  17. BIN
      data/GISofThrones/GoTRelease/Land.dbf
  18. BIN
      data/GISofThrones/GoTRelease/Land.gvsleg
  19. BIN
      data/GISofThrones/GoTRelease/Land.shp
  20. BIN
      data/GISofThrones/GoTRelease/Land.shx
  21. BIN
      data/GISofThrones/GoTRelease/Landscape.dbf
  22. BIN
      data/GISofThrones/GoTRelease/Landscape.gvsleg
  23. BIN
      data/GISofThrones/GoTRelease/Landscape.shp
  24. BIN
      data/GISofThrones/GoTRelease/Landscape.shx
  25. BIN
      data/GISofThrones/GoTRelease/Locations.dbf
  26. BIN
      data/GISofThrones/GoTRelease/Locations.gvsleg
  27. BIN
      data/GISofThrones/GoTRelease/Locations.shp
  28. BIN
      data/GISofThrones/GoTRelease/Locations.shx
  29. BIN
      data/GISofThrones/GoTRelease/Political.dbf
  30. BIN
      data/GISofThrones/GoTRelease/Political.gvsleg
  31. BIN
      data/GISofThrones/GoTRelease/Political.shp
  32. BIN
      data/GISofThrones/GoTRelease/Political.shx
  33. 15
      data/GISofThrones/GoTRelease/README.txt
  34. BIN
      data/GISofThrones/GoTRelease/Regions.dbf
  35. BIN
      data/GISofThrones/GoTRelease/Regions.gvsleg
  36. BIN
      data/GISofThrones/GoTRelease/Regions.shp
  37. BIN
      data/GISofThrones/GoTRelease/Regions.shx
  38. BIN
      data/GISofThrones/GoTRelease/Rivers.dbf
  39. BIN
      data/GISofThrones/GoTRelease/Rivers.gvsleg
  40. BIN
      data/GISofThrones/GoTRelease/Rivers.shp
  41. BIN
      data/GISofThrones/GoTRelease/Rivers.shx
  42. BIN
      data/GISofThrones/GoTRelease/Roads.dbf
  43. BIN
      data/GISofThrones/GoTRelease/Roads.gvsleg
  44. BIN
      data/GISofThrones/GoTRelease/Roads.shp
  45. BIN
      data/GISofThrones/GoTRelease/Roads.shx
  46. BIN
      data/GISofThrones/GoTRelease/Wall.dbf
  47. BIN
      data/GISofThrones/GoTRelease/Wall.gvsleg
  48. BIN
      data/GISofThrones/GoTRelease/Wall.shp
  49. BIN
      data/GISofThrones/GoTRelease/Wall.shx
  50. 1
      data/dante.json
  51. BIN
      data/rose3.png

198
2019-11-28-funny.R

@ -0,0 +1,198 @@
library(igraph)
library(ggraph)
library(ggtext)
library(hrbrthemes)
library(tidyverse)
world <- rnaturalearth::ne_countries(returnclass = "sf")
if (!file.exists(here::here("data/dante.json"))) {
download.file(
url = "https://www.mappingdante.com/network/data.json",
destfile = here::here("data/dante.json")
)
}
dante <- jsonlite::fromJSON(here::here("data/dante.json"))
graph_from_data_frame(
select(dante$edges, source, target, col = color) %>%
mutate(col = map_chr(col, ~{
gsub("[^[:digit:]]", " ", .x) %>%
trimws() %>%
strsplit(" ", fixed=TRUE) %>%
unlist() %>%
as.integer() %>%
`/`(255) -> x
rgb(x[1], x[2], x[3])
})),
vertices = select(dante$nodes, id, label, col=color, size) %>%
mutate(col = map_chr(col, ~{
gsub("[^[:digit:]]", " ", .x) %>%
trimws() %>%
strsplit(" ", fixed=TRUE) %>%
unlist() %>%
as.integer() %>%
`/`(255) -> x
rgb(x[1], x[2], x[3])
})) %>%
mutate(lab = ifelse(size >= 60, sprintf("%s ", label), ""))
) -> g
select(dante$nodes, x, y) %>%
as.matrix() -> l
ggraph(g, layout = l) +
geom_edge_arc2(
aes(color = I(col)), width = 0.25, linetype = "dotted", alpha=2/3
) +
geom_node_point(
aes(size = size, fill = I(col)),
shape = 21, color = "#2b2b2b", stroke = 0.075
) +
geom_node_text(
aes(label = lab), hjust = 1, family = font_es_bold, size = 3
) +
geom_rich_text(
data = data.frame(),
aes(
x = -2900,
y = -2900,
label = paste0(c(
"<span style='color:#2166ac'>**Blue nodes**</span> are all the geographical item mentioned in the *Comedy*",
"<span style='color:#9d1642'>**Red nodes**</span> are the cantos of the *Inferno*.",
"<span style='color:#4d9220'>**Green nodes**</span> are the cantos of the *Purgatorio*.",
"<span style='color:#fdae61'>**Yellow nodes**</span> are the cantos of the *Paradiso*."
), collapse = "<br/>\n")
),
hjust = 0, size = 4, vjust = 1,
fill = NA, label.color = NA,
label.padding = grid::unit(rep(0, 4), "pt")
) +
scale_y_reverse() +
scale_fill_manual(
name = "",
values = c(
"#00CC00" = "#4d9221",
"#00CC33" = "#00cc33",
"#FF0000" = "#9e0142",
"#FF3333" = "#ff3333",
"#0000FF" = "#2166ac",
"#FFCC00" = "#fdae61"
),
label = c(
"#FFCC00" = "Paradiso",
"#FF0000" = "Inferno",
"#00CC00" = "Purgatorio"#,
# "#FF3333" = "#ff3333",
# "#00CC33" = "#00cc33"
),
breaks = c(
"#FFCC00" = "Paradiso",
"#FF0000" = "Inferno",
"#00CC00" = "Purgatorio"
)
) +
guides(
size = FALSE
) +
labs(
x = NULL, y = NULL,
title = "Mapping Dante • Connecting Cantos to Physical Locations (Original by Andrea Gazzoni)",
subtitle = "This network visualizes connections between cantos and places in Dante Alighieri's Divine Comedy.",
caption = "Data source: <mappingdante.com>\n<git.rud.is/hrbrmstr/y2019-30daymapchallenge> • #30DayMapChallenge"
) +
theme_ipsum_es(grid="") +
theme(plot.background = element_rect(color = "#DEE5E8", fill = "#DEE5E8")) +
theme(panel.background = element_rect(color = "#DEE5E8", fill = "#DEE5E8")) +
theme(axis.text = element_blank())
as_tibble(dante$edges) %>%
pull(attributes) %>%
select(lng = Long_X, lat = Lat_Y) %>%
mutate_all(as.numeric) %>%
filter(complete.cases(.)) %>%
count(lng, lat) %>%
st_as_sf(coords = c("lng", "lat")) %>%
st_set_crs(st_crs(world)) -> all_places
st_intersection(all_places, select(world, name)) %>%
count(name, wt = n) %>%
filter(n <= 3) %>%
filter(!(name %in% c("Cyprus", "N. Cyprus"))) -> single_places
ggplot() +
geom_sf(
data = world, size = 0.125, linetype = "dotted",
fill = "#3B454A", color = "#b2b2b2"
) +
geom_sf(
data = all_places,
aes(size = n), shape=21, stroke = 0.125,
fill = alpha("#fdae61", 2/3), color = "white", show.legend = FALSE
) +
geom_sf_label(
data = single_places,
aes(
label = name,
hjust = I(ifelse(name %in% c("Morocco", "Switzerland", "Tunisia"), 1, 0))
),
color = "white", family = font_es_bold, size = 3,
vjust = 1, label.size = 0, fill = alpha("black", 1/10)
) +
coord_sf(
xlim = c(-10, 80),
ylim = c(-1, 75),
datum = NA
) +
labs(
x = NULL, y = NULL,
title = "Mapping Dante • Physical Location Geography",
subtitle = "Frequency of location mentions in the Cantos. Data collected by by Andrea Gazzoni.",
caption = "Data source: <mappingdante.com>\n<git.rud.is/hrbrmstr/y2019-30daymapchallenge> • #30DayMapChallenge"
) +
theme_ipsum_es(grid="") +
theme(plot.background = element_rect(color = "#DEE5E8", fill = "#DEE5E8")) +
theme(panel.background = element_rect(color = "#DEE5E8", fill = "#DEE5E8")) +
theme(axis.text = element_blank())
st_intersection(all_places, select(world, name)) %>%
count(name, wt = n) %>%
# filter(n <= 10) %>%
filter(!(name %in% c("Cyprus", "N. Cyprus"))) -> single_places
ggplot() +
geom_sf(
data = world, size = 0.125, linetype = "dotted",
fill = "#3B454A", color = "#b2b2b2"
) +
geom_sf(
data = all_places,
aes(size = n), shape=21, stroke = 0.125,
fill = alpha("#fdae61", 2/3), color = "white", show.legend = FALSE
) +
geom_sf_label(
data = single_places,
aes(
label = name,
hjust = I(ifelse(name %in% c("Morocco", "Switzerland", "Tunisia"), 1, 0))
),
color = "white", family = font_es_bold, size = 3,
vjust = 1, label.size = 0, fill = alpha("black", 1/10)
) +
coord_sf(
xlim = c(0, 30),
ylim = c(35, 50),
datum = NA
) +
labs(
x = NULL, y = NULL,
title = "Mapping Dante • Physical Location Geography • Italy Zoom",
subtitle = "Frequency of location mentions in the Cantos. Data collected by by Andrea Gazzoni.",
caption = "Data source: <mappingdante.com>\n<git.rud.is/hrbrmstr/y2019-30daymapchallenge> • #30DayMapChallenge"
) +
theme_ipsum_es(grid="") +
theme(plot.background = element_rect(color = "#DEE5E8", fill = "#DEE5E8")) +
theme(panel.background = element_rect(color = "#DEE5E8", fill = "#DEE5E8")) +
theme(axis.text = element_blank())

89
2019-11-29-experimental.R

@ -0,0 +1,89 @@
library(sf)
library(ggimage)
library(ggspatial)
library(tidyverse)
cont <- st_read("data/GISofThrones/GoTRelease/Continents.shp")
islands <- st_read("data/GISofThrones/GoTRelease/Islands.shp")
regions <- st_read("data/GISofThrones/GoTRelease/Regions.shp")
polit <- st_read("data/GISofThrones/GoTRelease/Political.shp")
land <- st_read("data/GISofThrones/GoTRelease/Land.shp")
landsc <- st_read("data/GISofThrones/GoTRelease/Landscape.shp")
riv <- st_read("data/GISofThrones/GoTRelease/Rivers.shp")
lak <- st_read("data/GISofThrones/GoTRelease/Lakes.shp")
wall <- st_read("data/GISofThrones/GoTRelease/Wall.shp")
roads <- st_read("data/GISofThrones/GoTRelease/Roads.shp")
loc <- st_read("data/GISofThrones/GoTRelease/Locations.shp")
sea_col <- "#39474e"
land_col <- "#bbc09c"
forest_col <- "#31382588"
mountain_col <- "#989a81"
stepp_col <- "#bec2a5"
swamp_col <- "#6e715c"
water_col <- "#425461"
road_col <- "black"
loc_col <- "#5d2210"
mutate(landsc, f_col = case_when(
type == "forest" ~ forest_col,
type == "mountain" ~ mountain_col,
type == "stepp" ~ stepp_col,
type == "swamp" ~ swamp_col
)) -> landsc
mutate(regions, r_col = case_when(
name == "The Red Waste" ~ "#81432877",
name == "The Land of Always Winter" ~ "#ffffff99",
name == "The Disputed Lands" ~ "#c2af94",
name == "The Flatlands" ~ "#c2af94",
TRUE ~ "#00000000"
)) -> regions
mutate(islands, i_col = case_when(
name == "Ibben" ~ "#ffffff99",
TRUE ~ land_col
)) -> islands
mutate(loc, loc_sz = case_when(
type == "Castle" ~ 1,
type == "City" ~ 0.6,
type == "Other" ~ 0.25,
type == "Ruin" ~ 0.33,
type == "Town" ~ 0.4
)) -> loc
ggplot() +
geom_sf(data = land, fill = land_col, color = "#5f7f7f", size = 0.5) +
geom_sf(data = islands, aes(fill = I(i_col)), color = "#5f7f7f", size = 0.5) +
geom_sf(data = cont, fill = land_col, size = 0.125) +
geom_sf(data = regions, aes(fill = r_col), color = NA, size = 0.125) +
geom_sf(data = landsc, aes(fill = I(f_col)), size = 0.125) +
geom_sf(data = lak, size = 0.125, color = water_col, fill = water_col) +
geom_sf(data = riv, fill = NA, size = 0.125, color = water_col) +
geom_sf(data = wall, fill = NA, size = 1, color = "white") +
geom_sf(data = roads, fill = NA, size = 0.33, color = road_col) +
geom_sf(data = loc, fill = NA, color = loc_col, aes(size = I(loc_sz))) +
geom_sf_text(
data = regions, aes(label = name),
family = "Luminari", size = 2, color = "#b2b2b2"
) +
geom_image(
data = data.frame(),
aes(x = 32, y = 41, image = "data/rose3.png"),
size = 0.1
) +
geom_text(
data = data.frame(),
aes(x = 70, y = 45, label = "A Song Of Ice and Fire"),
family = "Luminari", size = 8, color = "white"
) +
coord_sf(datum=NA) +
labs(
x = NULL, y = NULL,
caption = "Data source: GISofThrones <downloads.gvsig.org/download/documents/books/>\n#30DayMapChallenge • <git.rud.is/hrbrmstr/y2019-30daymapchallenge>"
) +
theme(plot.caption = element_text(color = "white")) +
theme(plot.background = element_rect(color=sea_col, fill=sea_col)) +
theme(panel.background = element_rect(color=sea_col, fill=sea_col))

BIN
data/GISofThrones/GoT.gvsproj

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Continents.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Continents.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Continents.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Continents.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Islands.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Islands.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Islands.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Islands.shx

Binary file not shown.

21
data/GISofThrones/GoTRelease/LICENSE.txt

@ -0,0 +1,21 @@
This work is licensed under the Creative Commons Attribution-Non-Commercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit www.creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
Under the following terms:
Attribution — You must give appropriate credit to it's original creators cadaei, theMountainGoat and Tear with copyright attributed to George RR Martin, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial — You may not use the material for commercial purposes.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
This map was created as a fan project and may be used in other fan based projects under the terms of the Creative Commons license. Thank you.

BIN
data/GISofThrones/GoTRelease/Lakes.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Lakes.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Lakes.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Lakes.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Land.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Land.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Land.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Land.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Landscape.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Landscape.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Landscape.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Landscape.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Locations.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Locations.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Locations.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Locations.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Political.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Political.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Political.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Political.shx

Binary file not shown.

15
data/GISofThrones/GoTRelease/README.txt

@ -0,0 +1,15 @@
A Song of Ice and Fire Speculative World Map
Released 2015-05-01
Legends and geometry bugs fixed with open source gvSIG by gvSIG Association (www.gvsig.com). Released 2016-05-20
Intellectual property of A Song of Ice and Fire, this map and all locations copyright George RR Martin (www.georgerrmartin.com).
Map of Westeros (original version) created originally by Tear of the Cartographer's Guild (http://www.cartographersguild.com/showthread.php?t=6683), updated and extended by theMountainGoat (http://www.sermountaingoat.co.uk/map/index.php) in 2012: Updates to Westeros, addition of Essos, Sothoryos, Ibben and the Summer Isles based in part upon the speculative world map drawn by Werthead (www.thewertzone.blogspot.com). Some locations positioned according to the maps drawn by Other-in-Law.
These GIS-map-files are based on this work and are created by cadaei.
The scale is of course not exact, as it is not clear what projection the original map used and on what kind of planet the map is located. I placed the continents roughly on the place of the coordinates of Africa to minimize the distortion near the poles. The scale is slightly too small (the Wall is only 240 miles long), so don't use the map for distance measuring. It's thought to provide the vector-geometry and labels of the world of a Song of Ice and Fire.
Locations have a field 'confirmed' which is '1' for confirmed locations and '0' for locations with speculative location.
The Areas outside the polygons of the file officialMapAreas.shp are the parts of the map which are not official and based on assumptions (see http://www.sermountaingoat.co.uk/map/index.php for more info about how theMountainGoat created these areas) and can be outdated.

BIN
data/GISofThrones/GoTRelease/Regions.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Regions.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Regions.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Regions.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Rivers.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Rivers.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Rivers.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Rivers.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Roads.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Roads.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Roads.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Roads.shx

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Wall.dbf

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Wall.gvsleg

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Wall.shp

Binary file not shown.

BIN
data/GISofThrones/GoTRelease/Wall.shx

Binary file not shown.

1
data/dante.json

File diff suppressed because one or more lines are too long

BIN
data/rose3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 KiB

Loading…
Cancel
Save