Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
diff --git a/lib/tilelive/mbtiles.js b/lib/tilelive/mbtiles.js
index eff4fe1..60c7709 100644
--- a/lib/tilelive/mbtiles.js
+++ b/lib/tilelive/mbtiles.js
@@ -3,6 +3,7 @@ var fs = require('fs');
var Step = require('step');
var crypto = require('crypto');
var compress = require('compress');
+var zlib = require('zlib');
var Buffer = require('buffer').Buffer;
grid({"grid":[" !!!!!!! "," !!!!!!!!! "," !!!!!!!!! "," !!!!!! "," !!!!!! "," ! "," ## "," ## "," # "," $$"," $"," $$ "," $$$$ "," $$$$$ "," $$$$$ ","
(gdb) thread apply all bt
Thread 5 (Thread 0x7f36b0d64700 (LWP 7760)):
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:211
#1 0x00000000004e22cc in etp_proc (thr_arg=<value optimized out>) at ../deps/libeio/eio.c:1490
#2 0x00007f36d557f9ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
#3 0x00007f36d52dc70d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4 0x0000000000000000 in ?? ()
Thread 4 (Thread 0x7f36af472700 (LWP 7766)):
@springmeyer
springmeyer / tileseed.js
Created March 12, 2011 02:08
test seed script for tilelive
#!/usr/bin/env node
// To test run from tilelive.js master checkout:
// ./bin/node ./bin/carto files/project/k12_county_stats/k12_county_stats.mml > k12_county_stats.xml
// time ./bin/node ./seedtest/tileseed.js k12_county_stats.xml 1 CNTY_FIPS k12_z12_test.mbtiles
var sys = require('sys'),
Step = require('step'),
TileBatch = require('tilelive').TileBatch;
Thread 5 (Thread 0x7f4b5bf00910 (LWP 16601)):
#0 0x00007f4b6a57281d in mapnik::polygon<mapnik::vertex<double, 2>, mapnik::vertex_vector2>::set_capacity(unsigned long) ()
from /usr/local/lib/libmapnik.so.0.7
#1 0x00007f4b6a5d9f31 in mapnik::wkb_reader::read_polygon(mapnik::feature<mapnik::geometry<mapnik::vertex<double, 2> >, boost::shared_ptr<mapnik::raster> >&) () from /usr/local/lib/libmapnik.so.0.7
#2 0x00007f4b6a5d8c60 in mapnik::geometry_utils::from_wkb(mapnik::feature<mapnik::geometry<mapnik::vertex<double, 2> >, boost::shared_ptr<mapnik::raster> >&, char const*, unsigned int, bool, mapnik::wkbFormat) () from /usr/local/lib/libmapnik.so.0.7
#3 0x00007f4b63d0f685 in postgis_featureset::next() () from /usr/local/lib/mapnik/input/postgis.input
#4 0x00007f4b6a9db9d9 in mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::Image32> >::apply_to_layer(mapnik::Layer const&, mapnik::agg_renderer<mapnik::Image32>&, mapnik::projection const&, double) ()
from /usr/lib/python2.6/dist-packages/mapni
@springmeyer
springmeyer / gdb backtrac
Created March 15, 2011 20:38
ubuntu backtraces of hung threads
Program received signal SIGSEGV, Segmentation fault.
0x00000000005e30f2 in v8::internal::HeapObject::map_word (this=0xcf11) at /home/ubuntu/src/tilemill/src/node-0.2.6/deps/v8/src/objects-inl.h:1056
1056 return MapWord(reinterpret_cast<uintptr_t>(READ_FIELD(this, kMapOffset)));
(gdb) thread apply all bt
Thread 6 (Thread 0x7fffc439a700 (LWP 15259)):
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:211
#1 0x00000000005b4800 in etp_proc (thr_arg=0xd873c0) at ../deps/libeio/eio.c:1490
#2 0x00007ffff6a2a9ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
#3 0x00007ffff678770d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature",
"properties": { "name": "whitehouse" },
"geometry" : { "type": "Point", "coordinates": [ -8575605.398444, 4707174.018280 ] }
}
]
}
@springmeyer
springmeyer / degress2meters.js
Last active August 22, 2024 14:22
convert from long/lat to google mercator (or EPSG:4326 to EPSG:900913)
// See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for more details.
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
x= -77.035974
Thread 5 (process 46581):
#0 0x00007fff86f9ffca in __semwait_signal ()
#1 0x00007fff86fa3de1 in _pthread_cond_wait ()
#2 0x000000010002c657 in etp_proc (thr_arg=<value temporarily unavailable, due to optimizations>) at ../deps/libeio/eio.c:1490
#3 0x00007fff86f9e536 in _pthread_start ()
#4 0x00007fff86f9e3e9 in thread_start ()
Thread 4 (process 46581):
#0 0x00007fff86f9ffca in __semwait_signal ()
#1 0x00007fff86fa3de1 in _pthread_cond_wait ()
Thread 5 (process 46611):
#0 0x00007fffffe007db in __memcpy ()
#1 0x00007fff844801a2 in std::string::_S_construct<char const*> ()
#2 0x00007fff844801f0 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string ()
#3 0x0000000127f9fdf5 in dbf_file::add_attribute ()
#4 0x0000000127fb372e in shape_featureset<mapnik::filter_in_box>::next ()
#5 0x00000001258b1a9b in mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image_32> >::apply_to_layer (this=0x12a45bcc0, lay=@0x12550afd0, p=@0x12a45bcc0, proj0=<value temporarily unavailable, due to optimizations>, scale_denom=34942641.501794897) at feature_style_processor.hpp:358
#6 0x00000001258b25c0 in mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image_32> >::apply (this=<value temporarily unavailable, due to optimizations>) at feature_style_processor.hpp:114
#7 0x000000012586bf70 in Map::EIO_Render (req=<value temporarily unavailable, due to optimizations>) at ../src/mapnik_map.cpp:679
#8 0x000000010002ca1