Skip to content

Commit be3465d

Browse files
committed
Improve map plot
1 parent 99d80ee commit be3465d

7 files changed

+45
-7
lines changed

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(Berlin_add_boarder)
4+
export(Berlin_add_waterbodies)
45
export(QSIM_prepare)
56
export(add_catchments)
67
export(add_coloredRivers)

R/add_coloured_rivers.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ add_coloredRivers <- function(
3434
lines(x = ext_rivers[[j]]$x[i:(i+1)],
3535
y = ext_rivers[[j]]$y[i:(i+1)],
3636
col = ext_rivers[[j]]$color[i+1],
37-
lwd = 6)
37+
lwd = 4)
3838
}
3939
}
4040

R/add_polygons.R

+25-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ add_catchments <- function(){
5050
#' @export
5151
#'
5252
add_districts <- function(){
53-
geo <- load_geo(region = "Berlin", Rdata_file = "berlin_boarder")
53+
geo <- load_geo(region = "berlin", Rdata_file = "berlin_boarder")
5454
polygon(
5555
x = geo$gis_coordinates[,1],
5656
y = geo$gis_coordinates[,2],
@@ -66,12 +66,34 @@ add_districts <- function(){
6666
#' @importFrom graphics polygon
6767
#' @export
6868
#'
69-
Berlin_add_boarder <- function(bg_color = "gray80"){
70-
geo <- load_geo(region = "Berlin", Rdata_file = "berlin_boarder")
69+
Berlin_add_boarder <- function(bg_color = "gray60"){
70+
geo <- load_geo(region = "berlin", Rdata_file = "berlin_boarder")
7171
polygon(
7272
x = geo$gis_coordinates[,"X"],
7373
y = geo$gis_coordinates[,"Y"],
7474
col = bg_color
7575
)
7676
}
7777

78+
#' Add Berlin boarder to a map
79+
#'
80+
#' Polygons is drawn in lightgray
81+
#' @param bg_color Character string or [rgb()] for the polygon background color
82+
#'
83+
#' @importFrom graphics polygon
84+
#' @export
85+
#'
86+
Berlin_add_waterbodies <- function(bg_color = "lightblue"){
87+
geo <- load_geo(region = "berlin", Rdata_file = "berlin_waterbodies_ordnung1")
88+
polies <- unique(geo$gis_coordinates[,"L2"])
89+
for(poly in polies){
90+
poly_rows <- geo$gis_coordinates[geo$gis_coordinates[,"L2"] == poly,]
91+
polygon(
92+
x = poly_rows[,"X"],
93+
y = poly_rows[,"Y"],
94+
col = bg_color, border = NA
95+
)
96+
}
97+
98+
}
99+
Binary file not shown.

inst/extdata/scripts/impetus/plot_impetus.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ rivers_ext <- lapply(
2828
names(rivers_ext) <- names(rivers)
2929

3030
# plot empty map
31-
qsimVis::plot_empty_map(rivers = rivers_ext, plot_toner = FALSE)
31+
# qsimVis::plot_empty_map(rivers = rivers_ext, plot_toner = FALSE)
3232
qsimVis::plot_empty_map(
3333
bbox = list(c(13, 13.8),
34-
c(52.29755, 52.68))
34+
c(52.35, 52.68))
3535
)
3636

3737
# Add Shape Background
3838
qsimVis::Berlin_add_boarder()
39+
qsimVis::Berlin_add_waterbodies()
3940

4041
# Add colored Rivers
4142
qsimVis::add_coloredRivers(

man/Berlin_add_boarder.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/Berlin_add_waterbodies.Rd

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)