Skip to content
A (map) look at Twin Cities metro parcels.
JavaScript CSS Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data-processing
dist
js
styles
.editorconfig
.gitignore
.jshintrc
Gruntfile.js
LICENSE.txt
README.md
bower.json
index.html
package.json
requirements.txt

README.md

Minnpost Twin Cities Metro County Parcels

A (map) look at Twin Cities Metro county parcels.

You can see this project in action here.

Unless otherwise noted, MinnPost projects on Github are story-driven and meant for transparency sake and not focused on re-use. For a list of our more reusable projects, go to code.minnpost.com.

Data

Several metro counties are passing Open GIS Data policies, and only some have started releasing up to date parcel data.

Get data

Download the data with the following commands. These will be linked and processed and are too big to commit to the repo:

  1. Ensure data directory is there: mkdir -p data;
  2. Hennepin: cd data && wget http://gis-stage.co.hennepin.mn.us/publicgisdata/hennepin_county_tax_property_base.zip && unzip hennepin_county_tax_property_base.zip -d hennepin-gdb; cd -;
  3. MetroGIS: cd data && wget ftp://gisftp.metc.state.mn.us/ParcelsCurrent.zip && unzip ParcelsCurrent.zip -d metrogis-shp; cd -;
  4. Ramsey: cd data && wget ftp://ftp.co.ramsey.mn.us/gisdata/publicdata.zip && unzip publicdata.zip -d ramsey-shp-gdb; cd -;

Data processing

Reproject and convert the data

  1. mkdir -p data/reprojected_4326-shps;
  2. ogr2ogr -f "ESRI Shapefile" data/reprojected_4326-shps/anoka-parcels.shp data/metrogis-shp/ParcelsAnoka.shp -s_srs EPSG:26915 -t_srs EPSG:4326;
  3. ogr2ogr data/reprojected_4326-shps/hennepin-parcels.shp data/hennepin-gdb/Hennepin_County_Tax_Property_Base.gdb -t_srs EPSG:4326;
  4. ogr2ogr data/reprojected_4326-shps/ramsey-parcels.shp data/ramsey-shp-gdb/Shapefiles/CDSTL_AttributedParcelPoly.shp -t_srs EPSG:4326;

Process the data

We need to combine the shapefiles and adjust some data.

  1. Run: python data-processing/process-shapefiles.py

Setup TileMill project

  1. Use variable for Mapbox path just in case yours is different: export MAPBOX_PATH=~/Documents/MapBox/
  2. Link data into Mapbox directory: ln -s "$(pwd)/data/combined-shp" $MAPBOX_PATH/data/minnpost-combined-metro-shp
  3. Link the Tilemill project into Mapbox directory: ln -s "$(pwd)/data-processing/map-metro-parcels" $MAPBOX_PATH/project/map-metro-parcels
  4. Open up TileMill

Exporting tiles

Use TileMill to export to .mbtiles. Then upload to Mapbox.

Development and running locally

Prerequisites

All commands are assumed to be on the command line, often called the Terminal, unless otherwise noted. The following will install technologies needed for the other steps and will only needed to be run once on your computer so there is a good chance you already have these technologies on your computer.

  1. Install Git.
    • On a Mac, install Homebrew, then do: brew install git
  2. Install NodeJS.
    • On a Mac, do: brew install node
  3. Install Grunt: npm install -g grunt-cli
  4. Install Bower: npm install -g bower
  5. Install Sass: gem install sass
    • On a Mac do: sudo gem install sass
  6. Install Compass: gem install compass
    • On a Mac do: sudo gem install compass
  7. Install Python. This is probably already installed on your system.
    • On a Mac, it is suggested to install with Homebrew and will probably require doing more than just installing: brew install python
  8. Install pip: easy_install pip
  9. Install GDAL (with FileGDB support)

Install GDAL with FileGDB support

The ESRI Geodatabase (FileGDB) format is proprietary and not yet well support in open source applications. GDAL 1.11+ has limited support for it or we build GDAL with the specific libraries provided by ESRI. These instructions are for Mac only

  1. Download file from ESRI, specifically the "File Geodatabase API 1.3 version for Mac 64-bit" version. This requires making a free account on ESRI.
  2. Copy the file to Homebrew cache: `cp FileGDB_API_1_3-64.zip $(brew --cache)/FileGDB_API_1_3-64.zip
  3. Install custom OSGeo tap (ensure that old version of tap is removed): brew untap dakcarto/osgeo4mac && brew tap osgeo/osgeo4mac && brew tap --repair;
  4. brew install osgeo/osgeo4mac/gdal-filegdb
  5. brew install osgeo/osgeo4mac/gdal --complete --enable-unsupported
  6. Tell GDAL about the plugins: export GDAL_DRIVER_PATH=$(brew --prefix)/lib/gdalplugins
    • This should go in your .bash_profile so that it is consistently available.

Get code and install packages

Get the code for this project and install the necessary dependency libraries and packages.

  1. Check out this code with Git: git clone https://github.com/MinnPost/minnpost-hennepin-county-parcels.git
  2. Go into the template directory: cd minnpost-hennepin-county-parcels
  3. Install NodeJS packages: npm install
  4. Install Bower components: bower install
  5. Because Mapbox comes unbuilt, we need to build it: cd bower_components/mapbox.js/ && npm install && make; cd -;
  6. Install Python packages: pip install -r requirements.txt

Running locally

  1. Run: grunt server
    • This will run a local webserver for development and you can view the application in your web browser at http://localhost:8804.
  2. By default, running a local server will show you the local development version. But there are other builds that you can view by changing the query parameters. Do note that you may have to run the build and deploy things for things to work normally.

Developing

Development will depend on what libraries are used. But here are a few common parts.

  • js/app.js is the main application and will contain the top logic.

Adding libraries is not difficult, but there are a few steps.

  1. User bower to install the appropriate library: bower install library --save
  2. Add the appropriate reference in js/config.js so that RequireJS knows about it.
  3. Add an entry in the dependencyMap object in bower.json. This is used to automatically collect resources in the build process. It is possible, like with minnpost-styles that multiple entries will need to be made, one ber .js file. Here is an example:
// Should be bower identifier.  Order matters for build, meaning that any dependencies should come first.
"library": {
  // Name used for reference in RequireJS (some modules expect dependencies with specific case, otherwise its arbitrary and you can just use the library name from above).
  // If this is not a JS library, do not include.
  "rname": "library",
  // (optional) Path to un-minified JS files within bower_components excluding .js suffix.
  "js": ["library/dist/library"],
  // (optional) Path to un-minified CSS files within bower_components excluding .css suffix.
  "css": ["library/dist/css/library"],
  // (optional) Path to un-minified IE-specific CSS files within bower_components excluding .css suffix.
  "ie": ["library/dist/css/library.ie"],
  // What is expected to be returned when using as a RequireJS dependency.  Some specific libraries, like jQuery use $, or backbone returns the Backbone class.
  // If this is not a JS library, do not include.
  "returns": "Library"
}

Testing

Unfortunately there are no tests at the moment.

Build

To build or compile all the assets together for easy and efficient deployment, do the following. It will create all the files in the dist/ folder.

  1. Run: grunt

Deploy

Deploying will push the relevant files up to Amazon's AWS S3 so that they can be easily referenced on the MinnPost site. This is specific to MinnPost, and your deployment might be different.

  1. Run: grunt deploy
    • This will output a bit of HTML to if you want to use the project as an embed.

There are to main ways to include the necessary HTML in a page in order to run the project.

  1. Copy the relevant parts from index.html.
    • This has the benefit of showing messages to users that have older browsers or have Javascript turned off. This also uses the build that separates out the third-party libraries that are used and are less likely to change; this gains a bit of performance for users.
  2. Copy the embed output from grunt deploy.

Hacks

List any hacks used in this project, such as forked repos. Link to pull request or repo and issue.

About Us

MinnData, the MinnPost data team, is Alan, Tom, and Kaeti and all the awesome contributors to open source projects we utilize. See our work at minnpost.com/data.


                                                   .--.
                                                   `.  \
                                                     \  \
                                                      .  \
                                                      :   .
                                                      |    .
                                                      |    :
                                                      |    |
      ..._  ___                                       |    |
     `."".`''''""--..___                              |    |
     ,-\  \             ""-...__         _____________/    |
     / ` " '                    `""""""""                  .
     \                                                      L
     (>                                                      \
    /                                                         \
    \_    ___..---.                                            L
      `--'         '.                                           \
                     .                                           \_
                    _/`.                                           `.._
                 .'     -.                                             `.
                /     __.-Y     /''''''-...___,...--------.._            |
               /   _."    |    /                ' .      \   '---..._    |
              /   /      /    /                _,. '    ,/           |   |
              \_,'     _.'   /              /''     _,-'            _|   |
                      '     /               `-----''               /     |
                      `...-'                                       `...-'

You can’t perform that action at this time.