Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / shp2geojson.js
Created December 4, 2013 21:43
shapefile to geojson in node.js with mapnik
var geojsonStream = require('geojson-stream');
var mapnik = require('mapnik');
var fs = require('fs');
var input = 'test/data/world_merc.shp';
var output = './out.geojson';
// set up geojson output stream
var fileOut = fs.createWriteStream(output);
var geojsonOut = geojsonStream.stringify();
@springmeyer
springmeyer / mapnik-features.md
Created November 22, 2013 07:00
Mapnik Supports

Formats

  • Shape
  • PostGIS
  • OSM
  • GeoJSON
  • TopoJSON
  • SQLite
  • Rasterlite
  • Spatialite
  • OGR
{
"EPSG:3857": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "EPSG:3006": "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
"EPSG:4326": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
}
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 39 in line 1.
wkt|label
MULTIPOLYGON(((3374339.0308 9614469.7032,3374761.9885 9614805.7929,3375232.1178 9615288.0913,3375279.0182 9615430.8428,3375325.4605 9615478.5458,3375464.7696 9615812.4503,3375509.248 9616050.1907,3375651.8417 9616138.5065,3375745.1157 9616196.5034,3375837.6017 9616434.9537,3375881.2206 9616765.8431,3376215.0666 9616723.4935,3376219.5797 9616246.8132,3376127.0851 9616008.3738,3376034.5957 9615769.9412,3376086.023 9615486.3237,3376278.4008 9615155.3065,3376425.5209 9614779.3724,3376574.6654 9614210.4834,3376673.7918 9613783.6821,3377057.5552 9613360.4741,3377105.6004 9613313.0683,3377201.4682 9613126.6887,3377202.2128 9613124.6897,3378316.5976 9610951.5909,3378461.5944 9610763.6,3378509.6172 9610716.2035,3378653.3424 9610528.4383,3378842.3887 9610528.1179,3379032.571 9610583.7369,3379128.2948 9610533.5671,3379366.5276 9610393.2721,3379510.3241 9610297.8384,3379651.6118 9610348.3482,3380076.9509 9610589.0568,3380267.5361 9610591.9492,3380457.6508 9610451.7766,3380747.0083 9609980.7715,3380748.1929 9609
@springmeyer
springmeyer / README.md
Last active December 28, 2015 06:49
Mapnik simplistic testcase starter

Test case for Bug #1

Depends

  • Mapnik >= 2.2 and the python bindings

How to replicate

To replicate the bug run:

diff --git a/SConstruct b/SConstruct
index 4473928..1601f50 100644
--- a/SConstruct
+++ b/SConstruct
@@ -83,6 +83,7 @@ pretty_dep_names = {
'png':'PNG C library | configure with PNG_LIBS & PNG_INCLUDES',
'webp':'WEBP C library | configure with WEBP_LIBS & WEBP_INCLUDES',
'icuuc':'ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/',
+ 'harfbuzz':'HarfBuzz text shaping library | configure with HB_LIBS & HB_INCLUDES',
'z':'Z compression library | more info: http://www.zlib.net/',
@springmeyer
springmeyer / msvc-error.txt
Last active December 27, 2015 14:59
compile error when MAPNIK_DECL is used on expression_grammar with msvc
0 File(s) copied
0 File(s) copied
0 File(s) copied
0 File(s) copied
0 File(s) copied
0 File(s) copied
0 File(s) copied
0 File(s) copied
Building Mapnik on NT ...
dependencies dir: c:\\dev2
diff --git a/Library/Formula/libstxxl.rb b/Library/Formula/libstxxl.rb
index b5c095b..4e6369b 100644
--- a/Library/Formula/libstxxl.rb
+++ b/Library/Formula/libstxxl.rb
@@ -5,13 +5,52 @@ class Libstxxl < Formula
url 'http://downloads.sourceforge.net/project/stxxl/stxxl/1.3.1/stxxl-1.3.1.tar.gz'
sha1 '5fba2bb26b919a07e966b2f69ae29aa671892a7d'
+ def patches
+ if MacOS.version >= :mavericks
diff --git a/include/mapnik/feature_style_processor_impl.hpp b/include/mapnik/feature_style_processor_impl.hpp
index 93fa7ef..f01f027 100644
--- a/include/mapnik/feature_style_processor_impl.hpp
+++ b/include/mapnik/feature_style_processor_impl.hpp
@@ -44,6 +44,7 @@
#include <mapnik/projection.hpp>
#include <mapnik/proj_transform.hpp>
#include <mapnik/util/featureset_buffer.hpp>
+#include <mapnik/timer.hpp>
@springmeyer
springmeyer / osm2pgsql-regression-tests.sh
Created October 31, 2013 21:34
Osm2pgsql regression-test.py output at the v0.84.0 tag
$ python tests/regression-test.py
Setting up test database
For the test, we need to create a tablespace. This needs root privilidges
sudo: /bin/chown: command not found
....osm2pgsql SVN version 0.84.0 (64bit id space)
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping