Monday, March 31, 2014

Timeline plotting



npm bucky-server



Sunday, March 16, 2014

Binary decoding with AWK

function Bytes2Number( String, x, y, z, Number ) {
x = split( String, Scratch, "" )
Number = 0
for( y = 1; y <= x; y++ ) {
z = index( CharString, Scratch[ y ] ) -1
Number = Number + z * (256^(x - y))
return Number

for( x = 0; x <= 255; x++ ) {
CharString = CharString sprintf( "%c", x )
FS= ""
RS = /ABC/

{ Width = Bytes2Number( $22 $21 $20 $19 )
Height = Bytes2Number( $26 $25 $24 $23 )
Data = Bytes2Number( $14 $13 $12 $11 )
Size = Bytes2Number( $6 $5 $4 $3 )
Depth = Bytes2Number( $30 $29 ) / 8
ImgSize = Bytes2Number( $38 $37 $36 $35 )

Wednesday, February 19, 2014

Monday, December 16, 2013

node-mapnik on windows

1) Cleaning up mess
npm cache clean if encounter issues despite changes

2) binding.gyp

2a) From the dos command prompt, running npm install
set protobuf_src=
eg set protobuf_src=x:\progra~1\protobuf\src
set cairo_src=
eg set cairo_src=x:\progra~1\cairo\src

2b) Modifying binding.gyp in directory node-mapnik
 'conditions': [
      ['OS=="win"', {
        'variables': {
 'conditions': [
      ['OS=="win"', {
        'variables': {

2c) from
'conditions': [
        ['OS=="win"', {
                '<!@(mapnik-config --includes)',
                '<!@(mapnik-config --dep-includes)',

'conditions': [
        ['OS=="win"', {
                '<!@(mapnik-config --includes)',
                '<!@(mapnik-config --dep-includes)',

3) As advised in binding.gyp, make changes to .node-gyp\*\common.gypi under user directory
xp - c:\documents and settings\username\...
win7 - c:\users\username\...


4)  Testing
npm install -g mocha
npm install sphericalmercator

Grab a copy of GDAL for windows from
sdkshell.bat to set the environment for

mocha -R spec to list details

Monday, September 09, 2013


Decades of sustained, methodical development of Singapore’s water policies has its many players, from multi-national corporations to international organisations, all of whom have performed a crucial role. During the dialogue, Mr Lee acknowledged their contributions, and in a pay-it-forward move, Singapore now wants to share its expertise with other countries facing water shortages.

"We did not do this by ourselves. We climbed on other people’s shoulders. We brought this [technology] together and improved on them. We’re happy to have people climb on our shoulders, whether they are from the Middle East, China, India, whatever. It’s a collaborative effort. The world will need this because what we have assumed was limitless — endless supplies of water — is not so. We’ve found it not to be so, and that we’ve got a way out of it.” -MM Lee

C++ build environment for mapnik project on Windows

C/C++ General

C/C++ Preprocessor

Linker General
Additional Library Directories \mapnik\mapnik-v2.2.0\lib

Linker Input

main include

#include "mapnik/layer.hpp"
#include "mapnik/rule.hpp"
#include "mapnik/line_symbolizer.hpp"
#include "mapnik/polygon_symbolizer.hpp"
#include "mapnik/text_symbolizer.hpp"
#include "mapnik/feature_type_style.hpp"
#include "mapnik/graphics.hpp"
#include "mapnik/datasource_cache.hpp"
#include "mapnik/font_engine_freetype.hpp"
#include "mapnik/agg_renderer.hpp"
#include "mapnik/expression.hpp"
#include "mapnik/color_factory.hpp"
#include "mapnik/image_util.hpp"

#if defined(HAVE_CAIRO)
#include "mapnik/cairo_renderer.hpp"
#include "mapnik/cairo_context.hpp"

#include <iostream>

Build with
C/C++ Code Generation>Basic Runtime Checks>Default
C/C++ Code Generation>Runtime Library>Multi-threaded DLL (/MD)
If you attempt to build with C/C++ Code Generation>Runtime Library>Multi-threaded Debug DLL (/MDd)
1>LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_49.lib'

Sunday, August 18, 2013

Changing someone

“But we have each come to the understanding that there is no need to try to influence the other to your own point of view. We cannot change them. They cannot change us,” -Former MM Lee