Skip to content

Instantly share code, notes, and snippets.

@leeolney3
Last active November 3, 2021 03:38
Show Gist options
  • Save leeolney3/52ddb755676b8099a7585aa172cc6729 to your computer and use it in GitHub Desktop.
Save leeolney3/52ddb755676b8099a7585aa172cc6729 to your computer and use it in GitHub Desktop.
02_30DayMapChallenge
# 30DayMapChallenge Day 2 Lines
# load libraries
library(tidyverse)
library(sf)
library(tmap)
# import water pipes shp
# source: https://discover.data.vic.gov.au/dataset/water-supply-main-pipelines
water_pipes_shp = read_sf('Water_Supply_Main_Pipelines-shp/Water_Supply_Main_Pipelines.shp')
# import boundary shp
# source: https://www.planmelbourne.vic.gov.au/maps/spatial-data
mel = read_sf('Plan-Melbourne-Shape-Files/Administrative/State Regions_region.shp')
# map
tm_shape(water_pipes_shp) + tm_lines(col="#ffff3f") +
tm_shape(mel) + tm_borders(col = "#577B77") + tm_polygons(col="#192a32") +
tm_layout(bg.color = "#d4dddd") +
tm_shape(water_pipes_shp) + tm_lines(col="#ffb703") +
tm_layout(title = "Water Supply Main Pipelines\nfrom Melbourne Water Corporation", title.size = 0.5, title.color = "#ffb703", title.position = c('right', 'top'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment