Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / the-one-and-true-epsg-3857.prj
Created September 26, 2013 20:10
canonical spherical mercator WKT via node-srs
PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2013 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
@springmeyer
springmeyer / gist:6444804
Created September 5, 2013 01:06
Install capnproto on Ubuntu Precise LTS (12.04)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.7 g++-4.7 subversion git
# note: you can also use update-alternatives to map gcc to gcc-4.7
export CC=gcc-4.7
export CXX=g++-4.7
git clone https://github.com/kentonv/capnproto.git
cd capnproto/c++
./setup-autotools.sh
autoreconf -i && ./configure && make -j6 check && sudo make install
@springmeyer
springmeyer / brew-mapnik.sh
Last active December 21, 2015 13:38
brew install mapnik on vanilla 13 inch macbook
$ uname -a
Darwin danes-MacBook-Pro.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
# source install no gdal
./configure ICU_LIBS=/usr/local/opt/icu4c/lib ICU_INCLUDES=/usr/local/opt/icu4c/include && time make
real 4m46.059s
user 13m52.596s
sys 0m46.456s
@springmeyer
springmeyer / libosmium-osx.diff
Last active December 21, 2015 03:48
libosmium os x patch
diff --git a/include/osmium/detail/typed_mmap.hpp b/include/osmium/detail/typed_mmap.hpp
index 96b5213..382461b 100644
--- a/include/osmium/detail/typed_mmap.hpp
+++ b/include/osmium/detail/typed_mmap.hpp
@@ -41,6 +41,11 @@ DEALINGS IN THE SOFTWARE.
#include <sys/types.h>
#include <unistd.h>
+// for bsd systems
+#ifndef MAP_ANONYMOUS
@springmeyer
springmeyer / android-config.py
Created August 14, 2013 22:36
result of doing `source Android.sh && ./scripts/build_mapnik_mobile.sh` from https://github.com/mapnik/mapnik-packaging/blob/master/osx
PREFIX = '/usr/local'
DESTDIR = '/Users/dane/projects/mapnik-packaging/osx/out/build-libstdc++-gcc-arm-mapnik'
CXX = 'arm-linux-androideabi-g++'
CC = 'arm-linux-androideabi-gcc'
CUSTOM_CXXFLAGS = ' -I/Users/dane/projects/mapnik-packaging/osx/out/build-libstdc++-gcc-arm/include -DNDEBUG -O3 -D_FILE_OFFSET_BITS=64 -fPIC -D_LITTLE_ENDIAN -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0 -DU_STATIC_IMPLEMENTATION=1 -DU_TIMEZONE=0 -DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_COLLATION=1 -DU_HAVE_NL_LANGINFO_CODESET=0'
CUSTOM_CFLAGS = '-I/Users/dane/projects/mapnik-packaging/osx/out/build-libstdc++-gcc-arm/include -DNDEBUG -O3 -D_FILE_OFFSET_BITS=64 -fPIC -D_LITTLE_ENDIAN'
CUSTOM_LDFLAGS = ' -L/Users/dane/projects/mapnik-packaging/osx/out/build-libstdc++-gcc-arm/lib -O3 -Wl,-S'
OPTIMIZATION = '3'
RUNTIME_LINK = 'static'
PATH = '/Users/dane/projects/mapnik-packaging/osx/out/build-libstdc++-gcc-arm/bin/'
> var srs = require('srs')
undefined
> srs.parse('Hochwasser_Risikozonen.prj')
{ input: 'Hochwasser_Risikozonen.prj',
proj4: '+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +units=m +no_defs',
srid: undefined,
auth: undefined,
pretty_wkt: 'PROJCS["MGI_M31",\n GEOGCS["GCS_MGI",\n DATUM["D_MGI",\n SPHEROID["Bessel_1841",6377397.155,299.1528128]],\n PRIMEM["Greenwich",0.0],\n UNIT["Degree",0.0174532925199433]],\n PROJECTION["Transverse_Mercator"],\n PARAMETER["False_Easting",0.0],\n PARAMETER["False_Northing",-5000000.0],\n PARAMETER["Central_Meridian",13.33333333333333],\n PARAMETER["Scale_Factor",1.0],\n PARAMETER["Latitude_Of_Origin",0.0],\n UNIT["Meter",1.0]]',
esri: false,
name: 'MGI_M31',
MapInteract 2013
ACM SIGSPATIAL Workshop on Interacting with Maps
November 5, 2013, Orlando, FL, USA
held in conjunction with ACM SIGSPATIAL 2013
http://mapinteract.org/
Important Dates
@springmeyer
springmeyer / mapnik.rb
Created July 22, 2013 20:32
Mapnik Hombrew formula fixed to actually find correct freetype and libpng - refs https://github.com/mapbox/tm2/issues/48
require 'formula'
class Mapnik < Formula
homepage 'http://www.mapnik.org/'
url 'http://mapnik.s3.amazonaws.com/dist/v2.2.0/mapnik-v2.2.0.tar.bz2'
sha1 'e493ad87ca83471374a3b080f760df4b25f7060d'
head 'https://github.com/mapnik/mapnik.git'
depends_on 'pkg-config' => :build
@springmeyer
springmeyer / ideas.md
Created July 19, 2013 03:59
Ideas for speeding up remote Postgres/PostGIS data access in TileMill

Pulling data from remote Postgresql can be really slow. Many people try this, once.

That said, here is a mini guide of things to think about if you are pulling remote data.

Big ideas

  • If network between you and the remote data is slow, try running TileMill on a remote machine. For example, if your data is on Amazon's network, short of running TileMill on the same machine, at least running TileMill on another AWS machine would be faster. This is because network access within Amazon's cloud is going to be reliably faster than between AWS and the outside. Here is a guide for how to run TileMill from the command line on an Ubuntu Server (with no desktop) that works with AWS: http://www.mapbox.com/tilemill/docs/guides/ubuntu-service/. For details on setting up an AWS instance see https://gist.github.com/springmeyer/b0bbcd976378cf3e4e44 and for details for how to automate this see https://github.com/miccolis/aws-tilemill.

  • Debug locally to make sure you know how fast data should show up in a normal situa