Skip to content

Instantly share code, notes, and snippets.

View colemanm's full-sized avatar

Coleman McCormick colemanm

View GitHub Profile
@colemanm
colemanm / shapefiles.sh
Created December 15, 2010 03:21
download / extract base data.
# Download
mkdir -P ~/data/boundaries
cd ~/data/boundaries
wget http://tile.openstreetmap.org/world_boundaries-spherical.tgz
wget http://tile.openstreetmap.org/shoreline_300.tar.bz2
wget http://tile.openstreetmap.org/processed_p.tar.bz2
wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/10m-populated-places.zip
wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/110m-admin-0-boundary-lines.zip
# Extract
@colemanm
colemanm / database.sh
Created December 15, 2010 02:30
configuring postgres
# Become postgres
sudo su postgres
createuser -SdR mapuser # -S = not super, -d = can create DBs, -R can't create roles
# Creating the template spatial database.
createdb -E UTF8 template_postgis
# Adding PLPGSQL language support
createlang -d template_postgis plpgsql
# Allows non-superusers the ability to create from this template
@colemanm
colemanm / build-mapnik.sh
Created December 15, 2010 02:56
build and install mapnik.
mkdir ~/src
cd ~/src
svn co http://svn.mapnik.org/tags/release-0.7.1/ mapnik
cd mapnik
python scons/scons.py configure INPUT_PLUGINS=all OPTIMIZATION=3 SYSTEM_FONTS=/usr/share/fonts/truetype/
python scons/scons.py
sudo python scons/scons.py install
sudo ldconfig
@colemanm
colemanm / mapnik.sh
Created December 15, 2010 02:54
mapnik dependencies.
sudo apt-get install libltdl3-dev libpng12-dev libtiff4-dev libicu-dev
sudo apt-get install libboost-python1.40-dev python-cairo-dev python-nose
sudo apt-get install libboost1.40-dev libboost-filesystem1.40-dev
sudo apt-get install libboost-iostreams1.40-dev libboost-regex1.40-dev libboost-thread1.40-dev
sudo apt-get install libboost-program-options1.40-dev libboost-python1.40-dev
sudo apt-get install libfreetype6-dev libcairo2-dev libcairomm-1.0-dev
sudo apt-get install libgeotiff-dev libtiff4 libtiff4-dev libtiffxx0c2
sudo apt-get install libsigc++-dev libsigc++0c2 libsigx-2.0-2 libsigx-2.0-dev
sudo apt-get install libgdal1-dev gdal-bin python-gdal python-setuptools
sudo apt-get install imagemagick ttf-dejavu
@colemanm
colemanm / import.sh
Created December 28, 2010 07:05
import OSM data.
# Download Italy OSM extract
cd ~/data
wget http://download.cloudmade.com/europe/italy/italy.osm.bz2
# Import
cd ~/bin/osm2pgsql
./osm2pgsql -v -U gisuser -s -S default.style -d osm ~/data/italy.osm.bz2 >~/data/import.log 2>&1
@colemanm
colemanm / mss-sample.mss
Created April 16, 2011 03:46
example of cascadenik
/* ================ */
/* Roadway features */
/* ================ */
.road
{
line-cap: round;
line-join: miter;
outline-cap: butt;
outline-join: miter;
@colemanm
colemanm / osm-xml-sample.xml
Created April 16, 2011 03:40
example of OSM XML style
<Rule>
<ElseFilter/>
&maxscale_zoom15;
&minscale_zoom16;
<TextSymbolizer name="name" fontset_name="book-fonts" size="9" fill="#000" halo_radius="1" placement="line" />
</Rule>
<Rule>
<ElseFilter/>
&maxscale_zoom17;
&minscale_zoom18;
GDAL is now configured for i386-apple-darwin11.3.0
Installation directory: /Users/coleman/local
C compiler: gcc -g -O2
C++ compiler: g++ -g -O2
LIBTOOL support: yes
LIBZ support: external
LIBLZMA support: no
@colemanm
colemanm / fulcrum-form-example.json
Created April 28, 2012 18:45
Fulcrum form JSON example
{
"form": {
"name": "Park Maintenance",
"description": "Form for inspection of park's state of maintenance. ",
"created_at": "2012-04-27T10:48:31-04:00",
"updated_at": "2012-04-27T10:58:39-04:00",
"elements": [
{
"disabled":false,
"hidden":false,
@colemanm
colemanm / fulcrum-record-example.json
Created April 30, 2012 01:08
Fulcrum record JSON example
{
"record":{
"longitude":-122.025067,
"latitude":37.325121,
"created_at":"2012-04-27T11:20:23-04:00",
"updated_at":"2012-04-27T11:20:23-04:00",
"form_id":"50345d9555554825980031a7",
"form_values":{
"36d58746-2b5c-a545-3009-5744de326e69":{
"choice_values":[