Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
/* This function is called when there is a warning, but the library thinks
* it can continue anyway. Replacement functions don't have to do anything
* here if you don't want to. In the default configuration, png_ptr is
* not used, but it is passed in case it may be useful.
*/
static void PNGCBAPI
pngtest_warning(png_structp png_ptr, png_const_charp message)
{
PNG_CONST char *name = "UNKNOWN (ERROR!)";
char *test;
#point {
marker:auto;
marker-width:[field];
display:none/yes;
text-display: yes;
text-name: " 'mike' + 'yes' "
ccache clang++ -Qunused-arguments -fcolor-diagnostics -o bindings/python/mapnik_envelope.os -c -g -DHAVE_JPEG -ansi -Wall -Wno-unused-function -Wno-array-bounds -Wno-parentheses -Wno-char-subscripts -ftemplate-depth-200 -DDARWIN -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -fPIC -Iagg/include -I. -Iinclude -I/opt/libpng-1.5.2/include -I/opt/jpeg-8c/include -I/opt/proj/include -I/opt/icu/include -I/opt/boost-46/include -I/Library/Frameworks/GDAL.framework/Versions/1.8/Headers -I/usr/local/pgsql-9.0/include -I/usr/local/Cellar/geos/3.3.0/include -I/usr/local/Cellar/sqlite/3.7.5/include -I/usr/include -I/usr/X11/include/freetype2 -I/usr/X11/include -I/usr/include/libxml2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 bindings/python/mapnik_envelope.cpp
In file included from bindings/python/mapnik_envelope.cpp:1:
In file included from bindings/python/mapnik_envelope.cpp:25:
In file included from /opt/boost-46/include/boost/python.hpp:50:
/
@springmeyer
springmeyer / geojson_grid.py
Created June 13, 2011 18:18
generate a gridded set of points in geojson format
import json
def feat(x,y):
feat = { "type": "Feature",
"geometry" : { "type": "Point", "coordinates": [ x, y ] },
"properties": { "label": "%s,%s" % (x,y) }
}
return feat
def grid(minx,miny,maxx,maxy,increment):
Index: src/load_map.cpp
===================================================================
--- src/load_map.cpp (revision 2976)
+++ src/load_map.cpp (working copy)
@@ -83,7 +83,7 @@
relative_to_xml_(true),
font_manager_(font_engine_) {}
- void parse_map(Map & map, ptree const & sty, std::string const& base_path="");
+ void parse_map(Map & map, ptree const & sty, std::string const& base_path);
/* new map loading api in node-mapnik */
var map = new mapnik.Map(256,256);
// map.load is now async and therefore returns modified map in callback
// it could also not return it, since 'map' is already defined
map.load("stylesheet.xml",{strict:true},function(err,map) {
// do something with map...
})
/* new rendering api in node-mapnik */
@springmeyer
springmeyer / mapnik_osx.c
Created June 15, 2011 21:21
compile mapnik with cocoa.h
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#include <CoreFoundation/CoreFoundation.h>
#include <Cocoa/Cocoa.h>
#include <iostream>
#ifdef check
#undef check
#endif
# simple testcase showing compiler error with boost filesystem and clang trunk:
#include "boost/filesystem/operations.hpp"
int main() {
return 0;
}
# g++ works:
template <typename T> struct is_pod_impl
{
static const bool value = (::boost::type_traits::ice_or< ::boost::is_scalar<T>::value, ::boost::is_void<T>::value, __is_pod(T) >::value);
};
@springmeyer
springmeyer / geocoder.js
Created July 6, 2011 17:54 — forked from wboykinm/geocoder.js
A javascript geocoder piggybacked on the GeoDjango Admin Project
{% block extrastyle %}
<style type="text/css">
#{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
#{{ id }}_map .aligned label { float:inherit; }
#{{ id }}_admin_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; }
{% if not display_wkt %}#{{ id }} { display: none; }{% endif %}
.olControlEditingToolbar .olControlModifyFeatureItemActive {
background-image: url("{{ ADMIN_MEDIA_PREFIX }}img/gis/move_vertex_on.png");
background-repeat: no-repeat;
}