GithubHelp home page GithubHelp logo

map-files's Introduction

Map Files from Time Interactives

Common files for Javascript mapping with basic demographic data baked in

Source

All shapefiles are downloaded from the "2010 Census Demographic Profile 1 โ€” Shapefile Format" section of the Census Department's TIGER/Line(R) Shapefiles Pre-joined with Demographic Data page.

Conversions

The TopoJSON files are produced using the GDAL library's ogr2ogr function and the TopoJSON command-line tool, as elegantly described in this StackOverflow response by Mike Bostock.

The large GeoJSON files produced in the intermedia stages of this conversion are preserved in the repo.

Requirements

  • GDAL. Binaries are available for Windows and OSX. Linux machines can install with sudo apt-get install gdal-bin
  • TopoJSON. Clone the respository or install using the Bower package manager.

Example command: SHP -> GeoJSON

ogr2ogr -f GeoJSON geojson/states.json shp/State_2010Census_DP1.shp

Properties to preserve

The shapefiles from the demographic profiles page come with about 250 data points, most of which we don't need. By default, we'll hang on to these:

  • DP0010001: Total population
  • DP0020001: Median age, both sexes
  • DP0040001: Population 18+
  • DP0110011: White, not Hispanic
  • DP0110012: Black, not Hispanic
  • DP0110013: American Indian, not Hispanic
  • DP0110014: Asian, not Hispanic
  • DP0110002: Hispanic or Latino

The files also come with some basic political and geographic data points we need to preserve:

  • GEOID10: Geographic ID
  • STUSPS10: State name
  • NAME10: Name
  • ALAND10: Land area
  • AWATER10: Water area
  • INTPTLAT10: Latitude of the internal point
  • INTPTLON10: Longitude of the internal point

Example commands: State files

ogr2ogr -f GeoJSON geojson/states.json shp/State_2010Census_DP1.shp

map-files's People

Watchers

 avatar  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.