This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import mapnik | |
>>> m = mapnik.Map(256,256) | |
>>> m.background = mapnik.Color('green') | |
>>> print mapnik.save_map_to_string(m) | |
<?xml version="1.0" encoding="utf-8"?> | |
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" background-color="rgb(0,128,0)"/> | |
>>> mapnik.save_map(m,'file.xml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mapnik | |
points = [[-122,48],[-120,45],[-90,43]] | |
bbox = None | |
for idx, point in enumerate(points): | |
if idx == 0: | |
bbox = mapnik.Box2d(point[0],point[1],point[0],point[1]) | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c:\dev2\node-mapnik>set PROJ_LIB=C:\dev2\proj\nad | |
c:\dev2\node-mapnik>set GDAL_DATA=C:\dev2\gdal\data | |
c:\dev2\node-mapnik>set MAPNIK_INPUT_PLUGINS_DIRECTORY="c:\\mapnik-2.0\\lib\\mapnik\\input" | |
c:\dev2\node-mapnik>set MAPNIK_FONT_DIRECTORY="c:\\mapnik-2.0\\lib\\mapnik\\fonts" | |
c:\dev2\node-mapnik>rd /q /s Default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> mapnik@1.0.0 install c:\dev2\node-mapnik | |
> node-gyp rebuild | |
c:\dev2\node-mapnik>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild | |
Build started 5/15/2013 7:16:32 PM. | |
Project "c:\dev2\node-mapnik\build\binding.sln" on node 1 (default targets). | |
ValidateSolutionConfiguration: | |
Building solution configuration "Release|Win32". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MarkerCache is a singleton so does not need to be created | |
var mc = mapnik.MarkerCache; | |
// size | |
// should always report `2` since there are `2` built-in markers (ellipse and arrow) | |
mc.size(); | |
// keys | |
// should report the keys of the `2` built-in markers | |
> mc.keys(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/include/mapnik/utils.hpp b/include/mapnik/utils.hpp | |
index 24a5d3d..01cf84a 100644 | |
--- a/include/mapnik/utils.hpp | |
+++ b/include/mapnik/utils.hpp | |
@@ -23,6 +23,8 @@ | |
#ifndef MAPNIK_UTILS_HPP | |
#define MAPNIK_UTILS_HPP | |
+#include <mapnik/config.hpp> | |
+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import mapnik | |
>>> path = mapnik.Path.from_geojson('{ "type":"Point","coordinates":[-122,48] }') | |
>>> path.envelope() | |
Box2d(-122.0,48.0,-122.0,48.0) | |
>>> path.to_geojson() | |
'{"type":"Point","coordinates":[-122,48]}' | |
>>> path.to_wkt() | |
'Point(-122 48)' | |
>>> path.to_wkb(mapnik.wkbByteOrder.NDR) | |
'\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x80^\xc0\x00\x00\x00\x00\x00\x00H@' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'' != null: False | |
0 != null: False | |
null != null: False | |
---------- | |
'' = null: False | |
0 = null: False | |
null = null: False | |
---------- | |
'' != '': False | |
0 != '': True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --depth 1 git@github.com:mapnik/mapnik-packaging.git | |
cd mapnik-packaging/osx | |
source MacOSX.sh | |
git clone --depth 1 git@github.com:mapnik/mapnik.git | |
./scripts/download_deps.sh | |
./scripts/build_core_deps.sh | |
./scripts/build_mapnik_ios.sh | |
export PATH=${MAPNIK_BIN_SOURCE}/bin:$PATH | |
curl -O https://gist.github.com/springmeyer/5359567/raw/e53361a7fa88c7d647fd8cdabefa834334389ffd/image-reader-test.cpp | |
clang++ -o image-reader-test image-reader-test.cpp `mapnik-config --cxxflags --defines --includes --libs --ldflags --dep-libs` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <mapnik/image_reader.hpp> | |
#include <mapnik/image_util.hpp> | |
#include <mapnik/graphics.hpp> | |
#include <mapnik/noncopyable.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/make_shared.hpp> | |
/* |