geo_get_spatial: Get Danish spatial data

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Get Danish spatial data

Usage

1
geo_get_spatial(spatial, quiet = TRUE)

Arguments

spatial

one of "Danish zip codes", "Danish regions", "Danish police districts", "Danish placenames - points", "Danish placenames - lines", "Danish placenames - areas", "Danish parishes", "Danish municipalities", "Danish jurisdictions" or "Danish constituencies"

Value

an object of either SpatialLinesDataFrame, SpatialPointsDataFrame or SpatialPolygonsDataFrame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(geoDK)
library(ggplot2)

dk_regions <- geo_get_spatial("Danish regions")
dk_placenames_points <- geo_get_spatial("Danish placenames - points")

df_regions <- make_tidy_poly(dk_regions)
long_barrows <- subset(dk_placenames_points, dk_placenames_points$feat_type == "langdysse")

ggplot() +
  geom_polygon(data = df_regions, aes(x = lng, y = lat, group = area), fill = "white",
               color = "black", show.legend = FALSE) +
  geom_point(data = tibble::as_tibble(long_barrows@coords), aes(x = coords.x1, y = coords.x2),
             color = "red") +
  coord_cartesian() +
  theme_minimal()

56north/geoDK documentation built on May 5, 2019, 11:26 a.m.