Skip to content

Instantly share code, notes, and snippets.

@springmeyer
springmeyer / dedupe.md
Last active March 9, 2021 20:05
Dedupe geojson -> shapefile

First convert to sqlite

$ time ogr2ogr -f SQLite out.db 1447454472-debug.geojson 

real    2m31.904s
user    1m37.525s
sys 0m48.042s
@springmeyer
springmeyer / get-trees.cpp
Created December 15, 2015 20:36
C++ code sample using libosmium
/*
To build:
git clone git@github.com:osmcode/libosmium.git
clang++ -o get-trees get-trees.cpp -O3 -DNDEBUG -I./libosmium/include -std=c++11 -lz
./get-trees
#!/bin/bash
files=$@
replacements=(
"NanAsyncWorker/Nan::AsyncWorker"
"NanAsyncQueueWorker/Nan::AsyncQueueWorker"
"NanCallback/Nan::Callback"
"NanNewBufferHandle\\(([^;]+);/Nan::NewBuffer(\\1.ToLocalChecked();"
"(NanNew(<(v8::)?String>)?\\(\"[^\"]*\"\\))/\\1.ToLocalChecked()"
"(NanNew<(v8::)?String>\\([^\"][^\;]*);/\\1.ToLocalChecked();"
@springmeyer
springmeyer / test-run.cpp
Created October 28, 2015 15:56
Simple C++ test of compiling and linking against Mapnik
#include <mapnik/map.hpp>
#include <iostream>
/*
clang++ test-run.cpp -o test-run `mapnik-config --all-flags`
./test-run
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
@springmeyer
springmeyer / project.mml
Created October 21, 2015 21:31
group-by in cartocss
{
"bounds": [
13.2644,
52.4914,
13.2994,
52.5071
],
"center": [
13.2811,
52.4992,
In file included from cryptlib.c:117:
./cryptlib.h:62:11: fatal error: 'stdlib.h' file not found
# include <stdlib.h>
^
1 error generated.
make[1]: *** [cryptlib.o] Error 1
make: *** [build_crypto] Error 1
diff --git a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp
index b1a25c9..8d2a398 100644
--- a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp
+++ b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp
@@ -51,14 +51,14 @@ class liang_barsky
private:
typedef model::referring_segment<Point> segment_type;
- template <typename T>
- inline bool check_edge(T const& p, T const& q, T& t1, T& t2) const
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springmeyer
springmeyer / enf.8k273nmi_14_13089_8506.vector.pbf
Last active August 29, 2015 14:23
multipoint vtile.composite benchmark
This file has been truncated, but you can view the full file.
~/projects/mbstudio[mapnik-up]$ lldb -- node ./index.js
(lldb) target create "node"
Current executable set to 'node' (x86_64).
(lldb) settings set -- target.run-args "./index.js"
(lldb) r
Process 68273 launched: '/Users/dane/.nvm/v0.10.38/bin/node' (x86_64)
<Tue, 09 Jun 2015 00:06:35 GMT> Mapbox Studio @ http://localhost:3000/
Process 68273 stopped
* thread #10: tid = 0x154f10, 0x0000000104a9ad60 mapnik.node`ClipperLib::OutRec1RightOfOutRec2(outRec1=0x0000000000000000, outRec2=0x000000012aa51f50) + 16 at clipper.cpp:2346, stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
frame #0: 0x0000000104a9ad60 mapnik.node`ClipperLib::OutRec1RightOfOutRec2(outRec1=0x0000000000000000, outRec2=0x000000012aa51f50) + 16 at clipper.cpp:2346