Git Product home page Git Product logo

bay_area_road_map's Introduction

Bay Area Road Map

Overview

This script generates a road map of the San Francisco Bay Area using only ggplot2, magick, and freely available data provided by the US Census Bureau’s TIGER/Line geodatabases. It includes the coastline, all bodies of water, and all paved roads, with the roads colored as they pass through municipal city boundaries.

A smaller version of the generated map.

Parameters

Because everything here is generated programmatically, it’s all entirely adjustable. I’ve created a set of user-adjustable parameters in a section near the top of the script for ease of use.

data_subfolder

This script automatically fetches all necessary data from the Census Bureau and saves and unpacks everything in a subfolder. By default, this is a subfolder in the working directory named “data”, but this can be changed if needed.

county_fips_codes

Data for area hydrography and road paths are organized by TIGER/Line in separate files for each county. This script can be used to plot different areas of the country by supplying a different vector of files to download. A list of county FIPS codes in the United States can be found here.

state_fips_codes

Unlike the water and road data, city boundary data is organized by state. A list of state FIPS codes can be found here.

image_dimensions

By default, this script generates a 9600 by 12000 pixel image, only because that results in a 24 by 30 inch image at 400dpi. This can be adjusted to any dimension size, but note that if this is dramatically increased, it can result in pretty lengthy plot times.

image_lat and image_lon

These two parameters control the latitude and longitude of the plotted geographic area.

road_thickness

This parameter is a numeric vector of length 2 because it directly feeds into the ggplot2::scale_size() plotting function, telling ggplot2 how thick to plot the thinnest and thickest styles of roads on the map, respectively. All intermediate road styles will be scaled to match the range given here. If the image_dimensions parameter is changed, this may have to be adjusted as well.

bay_area_road_map's People

Contributors

dlependorf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.