diff --git a/CHANGELOG.md b/CHANGELOG.md
index b54510ea5..a2becf50a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,12 +6,104 @@ Developers: Please commit along with changes.
For a complete change history, see the git log.
-## Future
+## 2.2.0
-- Added new mapnik-config options: `git-describe`, `defines`, `includes`, `dep-includes`, and `cxxflags` (#1443)
+Released ---
+
+(Packaged from ---)
+
+Summary: The 2.2.0 release is the fastest running and most stable release in the history of Mapnik. The code line represents development in the master branch since the release of 2.1.0 in Aug 2012 and therefore includes nearly a year of bugfixes and low level optimizations. Shapefile and PostGIS datasources have benefited from numerous stability fixes, 64 bit integer support has been added to support OSM data, and many rendering fixes have landed for high quality output when using a rendering `scale_factor`. Many critical code paths have been optimized extensively include raster rendering, xml map loading, string to number conversion, vector reprojection when using `epsg:4326` and `epsg:3857`, `hextree` encoding, halo rendering, and rendering when using a custom `gamma`. Mapnik 2.2 also compiles faster than previous releases in the 2.x series and drops several unneeded and hard to install dependencies.
+
+- Removed 3 depedencies without loosing any functionality: `ltdl`, `cairomm` and `libsigc++` (#1804,#806,#1681)
+
+- Added 64 bit integer support in expressions, feature ids, and the grid_renderer (#1661,#1662,#1662)
+
+- Added the ability to disable the need for various dependencies: `proj4`, `libpng`, `libtiff`, `libjpeg`
+
+- Added faster reprojection support between `epsg:3857` and `epsg:4326` (#1705,#1703,#1579)
+
+- Fixed concurrency problem when using cursors in postgis plugin (#1823,#1588)
+
+- Fixed postgres connection pool leaks when using `persist_connection=false` (#1764)
+
+- Fixed postgres connection key to respect highest value of `max_size` and `initial_size` for any layer in map (#1599)
+
+- Fixed potential crash in wkb parsing when postgis returns null geometry (#1843)
+
+- Fixed blurry rendering of image and SVG icons (#1316)
+
+- Improved logging system (https://github.com/mapnik/mapnik/wiki/Logging)
+
+- Added support for reading images from in memory streams (#1805)
+
+- Optimized halo rendering. When halo radius is < 1 new method will be used automatically (#1781)
- Added `text-halo-rasterizer` property. Set to `fast` for lower quality but faster
- halo rendering (#1298)
+ halo rendering (#1298) which matched new default method when radius is < 1.
+
+- Added support in `shape`, `sqlite`, `geojson`, and `csv` plugin for handling non-latin characters in the paths to file-based resources (#1177)
+
+- Fixed rendering of markers when their size is greater than the specified `spacing` value (#1487)
+
+- Fixed handling of alpha premultiplication in image scaling (#1489)
+
+- Optimized rendering when a style with no symbolizers is encountered (#1517)
+
+- Optimized string handling and type conversion by removing `boost::to_lower`, `boost::trim`, and `boost::lexical_cast` usage (#1687,#1687,#1633)
+
+- Optimized alpha preserving `hextree` method for quantization of png images (#1629)
+
+- Faster rendering of rasters by reducing memory allocation of temporary buffers (#1516)
+
+- Fixed some raster reprojection artifacts (#1501)
+
+- Fixed raster alignment when width != height and raster is being scaled (#1748,#1622)
+
+- Added support for caching rasters for re-use during rendering when styling more than once per layer (#1543)
+
+- Improved compile speeds of the code - in some cases by up to 2x and removed need for freetype dependency when building code against mapnik (#1688, #1756)
+
+- Removed internal rule cache on `mapnik::Map` c++ object (#1723)
+
+- Improved the scaled rendering of various map features when using `scale_factor` > 1 (#1280,#1100,#1273,#1792,#1291,#1344,#1279,#1624,#1767,#1766)
+
+- Added C++ api for overriding scale_denominator to enable rendering at fixed scale (#1582)
+
+- Added Layer `buffer-size` that can be used to override Map `buffer-size` to avoid
+ over-fetching of data that does not need to be buffered as much as other layers.
+ Map level `buffer-size` will be default if layers do not set the option. Renamed a
+ previously undocumented parameter by the same name that impacted clipping extent and
+ was not needed (clipping padding should likely be a symbolizer level option) (#1566)
+
+- Fixed potential file descriptor leaks in image readers when invalid images were encountered (#1783)
+
+- Fixed alpha handling in the `blur` and `invert` image filters (#1541)
+
+- Fixed error reporting in the python plugin (#1422)
+
+- Added the ability to run tests without installing with `make test-local`
+
+- Reduced library binary size by adding support for `-fvisibility-inlines-hidden` and `-fvisibility=hidden` (#1826,#1832)
+
+- Added `mapnik::map_request` class, a special object to allow passing mutable map objects to renderer (#1737)
+
+- Added the ability to use `boost::hash` on `mapnik::value` types (#1729)
+
+- Removed obsolete `geos` plugin (functionality replaced by `csv` plugin) and unmaintained `kismet` plugin (#1809,#1833)
+
+- Added new `mapnik-config` flags: `--all-flags`, `--defines`, `--git-describe`, `--includes`, `--dep-includes`, `--cxxflags`, `--cxx` (#1443)
+
+- Added support for unicode strings as arguments in python bindings (#163)
+
+- Added DebugSymbolizer which is able to render the otherwise invisible collision boxes (#1366)
+
+- Optimized rendering by reducing overhead of using `gamma` property (#1174)
+
+- Fixed rendering artifacts when using `polygon-gamma` or `line-gamma` equal to 0 (#761,#1763)
+
+- Fixed and optimized the display of excessive precision of some float data in labels (#430,#1697)
+
+- Removed the `bind` option for datasources (#1654)
- Added ability to access style list from map by (name,obj) in python (#1725)
@@ -21,19 +113,11 @@ For a complete change history, see the git log.
- Added support for `background-image` in cairo_renderer (#1724)
-- Added Layer `buffer-size` that can be used to override Map `buffer-size` to avoid
- over-fetching of data that does not need to be buffered as much as other layers.
- Map level `buffer-size` will be default if layers do not set the option. Renamed a
- previously undocumented parameter by the same name that impacted clipping extent and
- was not needed (clipping padding should likely be a symbolizer level option) (#1566)
-
- Fixed building symbolizer rendering to be fully sensitive to alpha (8b66128c892 / bc8ea1c5a7a)
-- Added 64 bit integer support in the grid_renderer (#1662)
-
- `[attr]` now returns false if attr is an empty string (#1665)
-- Added 64 bit integer support in expressions and feature ids (#1661,#1662)
+- `[attr]!=null` now returns true if attr is not null (#1642)
- Added support for DBF `Logical` type: #1614
@@ -50,9 +134,7 @@ For a complete change history, see the git log.
- Added support for setting zlib `Z_FIXED` strategy with format string: `png:z=fixed`
-- Fixed handling of transparency level option in Octree-based PNG encoding (#1556)
-
-- Faster rendering of rasters by reducing memory allocation of temporary buffers (#1516)
+- Fixed handling of transparency level option in `octree` png encoding (#1556)
- Added ability to pass a pre-created collision detector to the cairo renderer (#1444)
@@ -68,6 +150,24 @@ For a complete change history, see the git log.
now the combined layer extents will be again respected: they will be clipped to the maximum-extent if possible
and only when back-projecting fails for all layers will the maximum-extent be used as a fallback (#1473)
+- Compile time flag called `PLUGIN_LINKING` to allow input datasource plugins to be statically linked with the mapnik library (#249)
+
+- Fixed `dasharray` rendering in cairo backend (#1740)
+
+- Fixed handling of `opacity` in svg rendering (#1744)
+
+- Fixed uneven rendering of markers along lines (#1693)
+
+- Fixed handling of extra bytes in some shapefile fields (#1605)
+
+- Fixed handling (finally) of null shapes and partially corrupt shapefiles (#1630,#1621)
+
+- Added ability to re-use `mapnik::image_32` and `mapnik::grid` by exposing a `clear` method (#1571)
+
+- Added support for writing RGB (no A) png images by using the format string of `png:t=0` (#1559)
+
+- Added experimental support for geometry simplification at symbolizer level (#1385)
+
## Mapnik 2.1.0
Released Aug 23, 2012
@@ -215,7 +315,7 @@ Released April 10, 2012
- Workaround for boost interprocess compile error with recent gcc versions (#950,#1001,#1082)
-- Fix possible memory corruption when using hextree mode for png color reduction (#1087)
+- Fix possible memory corruption when using `hextree` mode for png color reduction (#1087)
- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) (#908)
@@ -395,14 +495,14 @@ Released March 23, 2010
- PNG: fixed png256 for large images and some improvements to reduce color corruptions ([#522](https://github.com/mapnik/mapnik/issues/522))
-- PNG: Added new quantization method for indexed png format using hextree with full support for alpha
+- PNG: Added new quantization method for indexed png format using `hextree` with full support for alpha
channel. Also new method has some optimizations for color gradients common when using elevation based
- rasters. By default old method using octree is used. (r1680, r1683, [#477](https://github.com/mapnik/mapnik/issues/477))
+ rasters. By default old method using `octree` is used. (r1680, r1683, [#477](https://github.com/mapnik/mapnik/issues/477))
- PNG: Added initial support for passing options to png writter like number of colors, transparency
support, quantization method and possibly other in future using type parameter. For example
"png8:c=128:t=1:m=h" limits palette to 128 colors, uses only binary transparency (0 - none,
- 1 - binary, 2 - full), and new method of quantization using hextree (h - hextree, o - octree).
+ 1 - binary, 2 - full), and new method of quantization using `hextree` (h - `hextree`, o - `octree`).
Existing type "png256" can be also written using "png8:c=256:m=o:t=2" (r1680, r1683, [#477](https://github.com/mapnik/mapnik/issues/477))
diff --git a/INSTALL.md b/INSTALL.md
index fd5300cbf..156f9b3dc 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -65,7 +65,7 @@ Note: Python3k is supported, see: https://github.com/mapnik/mapnik/wiki/Python3k
Optional dependencies:
- * Cairo - Graphics library for output formats like PDF, PS, and SVG
+ * Cairo >= 1.6.0 - Graphics library for output formats like PDF, PS, and SVG
- pkg-config - Required for building with cairo support
- pycairo - Python bindings for cairo
* libpq - PostgreSQL libraries (For PostGIS plugin support)
diff --git a/SConstruct b/SConstruct
index 5cba24449..2a52d5c87 100644
--- a/SConstruct
+++ b/SConstruct
@@ -22,6 +22,7 @@ import sys
import re
import platform
from glob import glob
+from copy import copy
from subprocess import Popen, PIPE
from SCons.SConf import SetCacheMode
import pickle
@@ -78,6 +79,7 @@ pretty_dep_names = {
'pkg-config':'pkg-config tool | more info: http://pkg-config.freedesktop.org',
'pg_config':'pg_config program | try setting PG_CONFIG SCons option',
'xml2-config':'xml2-config program | try setting XML2_CONFIG SCons option',
+ 'libxml2':'libxml2 library | try setting XML2_CONFIG SCons option to point to location of xml2-config program',
'gdal-config':'gdal-config program | try setting GDAL_CONFIG SCons option',
'freetype-config':'freetype-config program | try setting FREETYPE_CONFIG SCons option',
'osm':'more info: https://github.com/mapnik/mapnik/wiki//OsmPlugin',
@@ -100,14 +102,14 @@ PLUGINS = { # plugins with external dependencies
'rasterlite': {'default':False,'path':'RASTERLITE','inc':['sqlite3.h','rasterlite.h'],'lib':'rasterlite','lang':'C'},
# todo: osm plugin does also depend on libxml2 (but there is a separate check for that)
- 'osm': {'default':True,'path':None,'inc':'curl/curl.h','lib':'curl','lang':'C'},
+ 'osm': {'default':False,'path':None,'inc':'curl/curl.h','lib':'curl','lang':'C'},
# plugins without external dependencies requiring CheckLibWithHeader...
'shape': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'},
'csv': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'},
'raster': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'},
'geojson': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'},
- 'python': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'},
+ 'python': {'default':False,'path':None,'inc':None,'lib':None,'lang':'C++'},
}
@@ -171,6 +173,10 @@ def shortest_name(libs):
name = lib
return name
+def rm_path(item,set,_env):
+ for i in _env[set]:
+ if item in i:
+ _env[set].remove(i)
def sort_paths(items,priority):
"""Sort paths such that compiling and linking will globally prefer custom or local libs
@@ -308,8 +314,8 @@ opts.AddVariables(
('XML2_CONFIG', 'The path to the xml2-config executable.', 'xml2-config'),
PathVariable('ICU_INCLUDES', 'Search path for ICU include files', '/usr/include', PathVariable.PathAccept),
PathVariable('ICU_LIBS','Search path for ICU include files','/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept),
- ('ICU_LIB_NAME', 'The library name for icu (such as icuuc, sicuuc, or icucore)', 'icuuc',
-PathVariable.PathAccept),
+ ('ICU_LIB_NAME', 'The library name for icu (such as icuuc, sicuuc, or icucore)', 'icuuc', PathVariable.PathAccept),
+
BoolVariable('PNG', 'Build Mapnik with PNG read and write support', 'True'),
PathVariable('PNG_INCLUDES', 'Search path for libpng include files', '/usr/include', PathVariable.PathAccept),
PathVariable('PNG_LIBS','Search path for libpng library files','/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept),
@@ -352,6 +358,9 @@ PathVariable.PathAccept),
BoolVariable('ENABLE_STATS', 'Enable global statistics during map processing', 'False'),
('DEFAULT_LOG_SEVERITY', 'The default severity of the logger (eg. ' + ', '.join(severities) + ')', 'error'),
+ # Plugin linking
+ EnumVariable('PLUGIN_LINKING', "Set plugin linking with libmapnik", 'shared', ['shared','static']),
+
# Other variables
BoolVariable('SHAPE_MEMORY_MAPPED_FILE', 'Utilize memory-mapped files in Shapefile Plugin (higher memory usage, better performance)', 'True'),
('SYSTEM_FONTS','Provide location for python bindings to register fonts (if provided then the bundled DejaVu fonts are not installed)',''),
@@ -434,7 +443,7 @@ pickle_store = [# Scons internal variables
'LIBMAPNIK_DEFINES',
'LIBMAPNIK_CXXFLAGS',
'CAIRO_LIBPATHS',
- 'CAIRO_LINKFLAGS',
+ 'CAIRO_ALL_LIBS',
'CAIRO_CPPPATHS',
'SVG_RENDERER',
'SQLITE_LINKFLAGS',
@@ -729,25 +738,23 @@ def FindBoost(context, prefixes, thread_flag):
msg = str()
if BOOST_LIB_DIR:
- msg += '\n *libs found: %s' % BOOST_LIB_DIR
+ msg += '\nFound boost libs: %s' % BOOST_LIB_DIR
env['BOOST_LIBS'] = BOOST_LIB_DIR
else:
env['BOOST_LIBS'] = '/usr/' + env['LIBDIR_SCHEMA']
- msg += '\n *using default boost lib dir: %s' % env['BOOST_LIBS']
+ msg += '\nUsing default boost lib dir: %s' % env['BOOST_LIBS']
if BOOST_INCLUDE_DIR:
- msg += '\n *headers found: %s' % BOOST_INCLUDE_DIR
+ msg += '\nFound boost headers: %s' % BOOST_INCLUDE_DIR
env['BOOST_INCLUDES'] = BOOST_INCLUDE_DIR
else:
env['BOOST_INCLUDES'] = '/usr/include'
- msg += '\n *using default boost include dir: %s' % env['BOOST_INCLUDES']
+ msg += '\nUsing default boost include dir: %s' % env['BOOST_INCLUDES']
if not env['BOOST_TOOLKIT'] and not env['BOOST_ABI'] and not env['BOOST_VERSION']:
if BOOST_APPEND:
- msg += '\n *lib naming extension found: %s' % BOOST_APPEND
+ msg += '\nFound boost lib name extension: %s' % BOOST_APPEND
env['BOOST_APPEND'] = BOOST_APPEND
- else:
- msg += '\n *no lib naming extension found'
else:
# Creating BOOST_APPEND according to the Boost library naming order,
# which goes ---. See:
@@ -762,7 +769,7 @@ def FindBoost(context, prefixes, thread_flag):
# Boost libraries.
if len(append_params) > 1:
env['BOOST_APPEND'] = '-'.join(append_params)
- msg += '\n *using boost lib naming: %s' % env['BOOST_APPEND']
+ msg += '\nFound boost lib name extension: %s' % env['BOOST_APPEND']
env.AppendUnique(CPPPATH = os.path.realpath(env['BOOST_INCLUDES']))
env.AppendUnique(LIBPATH = os.path.realpath(env['BOOST_LIBS']))
@@ -799,6 +806,32 @@ int main()
context.Result(ret)
return ret
+def CheckCairoHasFreetype(context, silent=False):
+ if not silent:
+ context.Message('Checking for cairo freetype font support ... ')
+ context.env.AppendUnique(CPPPATH=copy(env['CAIRO_CPPPATHS']))
+
+ ret = context.TryRun("""
+
+#include
+
+int main()
+{
+ #ifdef CAIRO_HAS_FT_FONT
+ return 0;
+ #else
+ return 1;
+ #endif
+}
+
+""", '.cpp')[0]
+ if silent:
+ context.did_show_result=1
+ context.Result(ret)
+ for item in env['CAIRO_CPPPATHS']:
+ rm_path(item,'CPPPATH',context.env)
+ return ret
+
def GetBoostLibVersion(context):
ret = context.TryRun("""
@@ -946,6 +979,7 @@ conf_tests = { 'prioritize_paths' : prioritize_paths,
'CheckPKGVersion' : CheckPKGVersion,
'FindBoost' : FindBoost,
'CheckBoost' : CheckBoost,
+ 'CheckCairoHasFreetype' : CheckCairoHasFreetype,
'GetBoostLibVersion' : GetBoostLibVersion,
'GetMapnikLibVersion' : GetMapnikLibVersion,
'parse_config' : parse_config,
@@ -1007,11 +1041,12 @@ if not preconfigured:
env['SKIPPED_DEPS'] = []
env['HAS_CAIRO'] = False
env['CAIRO_LIBPATHS'] = []
- env['CAIRO_LINKFLAGS'] = []
+ env['CAIRO_ALL_LIBS'] = []
env['CAIRO_CPPPATHS'] = []
env['HAS_PYCAIRO'] = False
env['HAS_LIBXML2'] = False
env['LIBMAPNIK_LIBS'] = []
+ env['LIBMAPNIK_LINKFLAGS'] = []
env['LIBMAPNIK_CPPATHS'] = []
env['LIBMAPNIK_DEFINES'] = []
env['LIBMAPNIK_CXXFLAGS'] = []
@@ -1137,6 +1172,8 @@ if not preconfigured:
# https://github.com/mapnik/mapnik/issues/913
if conf.parse_config('XML2_CONFIG',checks='--cflags'):
env['HAS_LIBXML2'] = True
+ else:
+ env['MISSING_DEPS'].append('libxml2')
LIBSHEADERS = [
['z', 'zlib.h', True,'C'],
@@ -1185,7 +1222,7 @@ if not preconfigured:
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
if env['PRIORITIZE_LINKING']:
- conf.prioritize_paths(silent=False)
+ conf.prioritize_paths(silent=True)
if not env['HOST']:
for libname, headers, required, lang in LIBSHEADERS:
@@ -1234,7 +1271,7 @@ if not preconfigured:
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
if env['PRIORITIZE_LINKING']:
- conf.prioritize_paths()
+ conf.prioritize_paths(silent=True)
if not env['HOST']:
# if the user is not setting custom boost configuration
@@ -1369,9 +1406,9 @@ if not preconfigured:
#os.path.join(c_inc,'include/libpng'),
]
)
- env["CAIRO_LINKFLAGS"] = ['cairo']
+ env["CAIRO_ALL_LIBS"] = ['cairo']
if env['RUNTIME_LINK'] == 'static':
- env["CAIRO_LINKFLAGS"].extend(
+ env["CAIRO_ALL_LIBS"].extend(
['pixman-1','expat','fontconfig','iconv']
)
# todo - run actual checkLib?
@@ -1394,7 +1431,7 @@ if not preconfigured:
cairo_env.ParseConfig(cmd)
for lib in cairo_env['LIBS']:
if not lib in env['LIBS']:
- env["CAIRO_LINKFLAGS"].append(lib)
+ env["CAIRO_ALL_LIBS"].append(lib)
for lpath in cairo_env['LIBPATH']:
if not lpath in env['LIBPATH']:
env["CAIRO_LIBPATHS"].append(lpath)
@@ -1411,6 +1448,11 @@ if not preconfigured:
else:
color_print(4,'Not building with cairo support, pass CAIRO=True to enable')
+ if not env['HOST'] and env['HAS_CAIRO']:
+ if not conf.CheckCairoHasFreetype():
+ env['SKIPPED_DEPS'].append('cairo')
+ env['HAS_CAIRO'] = False
+
if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']:
if not os.access(env['PYTHON'], os.X_OK):
color_print(1,"Cannot run python interpreter at '%s', make sure that you have the permissions to execute it." % env['PYTHON'])
@@ -1608,7 +1650,9 @@ if not preconfigured:
if env['DEBUG']:
env.Append(CXXFLAGS = common_cxx_flags + '-O0 -fno-inline')
else:
- env.Append(CXXFLAGS = common_cxx_flags + '-O%s -fvisibility-inlines-hidden -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts' % (env['OPTIMIZATION']))
+ # TODO - add back -fvisibility-inlines-hidden
+ # https://github.com/mapnik/mapnik/issues/1863
+ env.Append(CXXFLAGS = common_cxx_flags + '-O%s -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts' % (env['OPTIMIZATION']))
if env['DEBUG_UNDEFINED']:
env.Append(CXXFLAGS = '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -ftrapv -fwrapv')
@@ -1638,7 +1682,7 @@ if not preconfigured:
# if requested, sort LIBPATH and CPPPATH one last time before saving...
if env['PRIORITIZE_LINKING']:
- conf.prioritize_paths()
+ conf.prioritize_paths(silent=True)
# finish config stage and pickle results
env = conf.Finish()
@@ -1696,15 +1740,11 @@ if not HELP_REQUESTED:
p = env['PATH_REMOVE']
if p in env['ENV']['PATH']:
env['ENV']['PATH'].replace(p,'')
- def rm_path(set):
- for i in env[set]:
- if p in i:
- env[set].remove(i)
- rm_path('LIBPATH')
- rm_path('CPPPATH')
- rm_path('CXXFLAGS')
- rm_path('CAIRO_LIBPATHS')
- rm_path('CAIRO_CPPPATHS')
+ rm_path(p,'LIBPATH',env)
+ rm_path(p,'CPPPATH',env)
+ rm_path(p,'CXXFLAGS',env)
+ rm_path(p,'CAIRO_LIBPATHS',env)
+ rm_path(p,'CAIRO_CPPPATHS',env)
if env['PATH_REPLACE']:
searches,replace = env['PATH_REPLACE'].split(':')
@@ -1727,8 +1767,6 @@ if not HELP_REQUESTED:
Export('env')
plugin_base = env.Clone()
- if not env['DEBUG']:
- plugin_base.Append(CXXFLAGS='-fvisibility=hidden')
Export('plugin_base')
@@ -1758,36 +1796,46 @@ if not HELP_REQUESTED:
# Build the requested and able-to-be-compiled input plug-ins
GDAL_BUILT = False
OGR_BUILT = False
- for plugin in env['REQUESTED_PLUGINS']:
- details = env['PLUGINS'][plugin]
- if details['lib'] in env['LIBS']:
- SConscript('plugins/input/%s/build.py' % plugin)
- if plugin == 'ogr': OGR_BUILT = True
- if plugin == 'gdal': GDAL_BUILT = True
- if plugin == 'ogr' or plugin == 'gdal':
- if GDAL_BUILT and OGR_BUILT:
- env['LIBS'].remove(details['lib'])
- else:
- env['LIBS'].remove(details['lib'])
- elif not details['lib']:
- # build internal shape and raster plugins
- SConscript('plugins/input/%s/build.py' % plugin)
- else:
- color_print(1,"Notice: dependencies not met for plugin '%s', not building..." % plugin)
- # also clear out locally built target
+ for plugin in env['PLUGINS']:
+ if env['PLUGIN_LINKING'] == 'static' or plugin not in env['REQUESTED_PLUGINS']:
if os.path.exists('plugins/input/%s.input' % plugin):
os.unlink('plugins/input/%s.input' % plugin)
+ if plugin in env['REQUESTED_PLUGINS']:
+ details = env['PLUGINS'][plugin]
+ if details['lib'] in env['LIBS']:
+ if env['PLUGIN_LINKING'] == 'shared':
+ SConscript('plugins/input/%s/build.py' % plugin)
+ if plugin == 'ogr': OGR_BUILT = True
+ if plugin == 'gdal': GDAL_BUILT = True
+ if plugin == 'ogr' or plugin == 'gdal':
+ if GDAL_BUILT and OGR_BUILT:
+ env['LIBS'].remove(details['lib'])
+ else:
+ env['LIBS'].remove(details['lib'])
+ elif not details['lib']:
+ if env['PLUGIN_LINKING'] == 'shared':
+ # build internal datasource input plugins
+ SConscript('plugins/input/%s/build.py' % plugin)
+ else:
+ color_print(1,"Notice: dependencies not met for plugin '%s', not building..." % plugin)
+ if os.path.exists('plugins/input/%s.input' % plugin):
+ os.unlink('plugins/input/%s.input' % plugin)
create_uninstall_target(env, env['MAPNIK_LIB_DIR_DEST'], False)
create_uninstall_target(env, env['MAPNIK_INPUT_PLUGINS_DEST'] , False)
- # before installing plugins, wipe out any previously
- # installed plugins that we are no longer building
if 'install' in COMMAND_LINE_TARGETS:
+ # if statically linking plugins still make sure
+ # to create the dynamic plugins directory
+ if env['PLUGIN_LINKING'] == 'static':
+ if not os.path.exists(env['MAPNIK_INPUT_PLUGINS_DEST']):
+ os.makedirs(env['MAPNIK_INPUT_PLUGINS_DEST'])
+ # before installing plugins, wipe out any previously
+ # installed plugins that we are no longer building
for plugin in PLUGINS.keys():
- if plugin not in env['REQUESTED_PLUGINS']:
- plugin_path = os.path.join(env['MAPNIK_INPUT_PLUGINS_DEST'],'%s.input' % plugin)
- if os.path.exists(plugin_path):
+ plugin_path = os.path.join(env['MAPNIK_INPUT_PLUGINS_DEST'],'%s.input' % plugin)
+ if os.path.exists(plugin_path):
+ if plugin not in env['REQUESTED_PLUGINS'] or env['PLUGIN_LINKING'] == 'static':
color_print(3,"Notice: removing out of date plugin: '%s'" % plugin_path)
os.unlink(plugin_path)
@@ -1827,11 +1875,10 @@ if not HELP_REQUESTED:
SConscript('fonts/build.py')
# build C++ tests
- if env['CPP_TESTS']:
- SConscript('tests/cpp_tests/build.py')
+ SConscript('tests/cpp_tests/build.py')
- if env['SVG_RENDERER']:
- SConscript('tests/cpp_tests/svg_renderer_tests/build.py')
+ if env['CPP_TESTS'] and env['SVG_RENDERER']:
+ SConscript('tests/cpp_tests/svg_renderer_tests/build.py')
if env['BENCHMARK']:
SConscript('benchmark/build.py')
@@ -1845,11 +1892,14 @@ if not HELP_REQUESTED:
# if requested, build the sample input plugins
if env['SAMPLE_INPUT_PLUGINS']:
SConscript('plugins/input/templates/helloworld/build.py')
- elif 'install' in COMMAND_LINE_TARGETS:
- plugin_path = os.path.join(env['MAPNIK_INPUT_PLUGINS_DEST'],'hello.input')
- if os.path.exists(plugin_path):
- color_print(3,"Notice: removing out of date plugin: '%s'" % plugin_path)
- os.unlink(plugin_path)
+ else:
+ if 'install' in COMMAND_LINE_TARGETS:
+ plugin_path = os.path.join(env['MAPNIK_INPUT_PLUGINS_DEST'],'hello.input')
+ if os.path.exists(plugin_path):
+ color_print(3,"Notice: removing out of date plugin: '%s'" % plugin_path)
+ os.unlink(plugin_path)
+ if os.path.exists('plugins/input/templates/hello.input'):
+ os.unlink('plugins/input/templates/hello.input')
# update linux project files
if env['PLATFORM'] == 'Linux':
diff --git a/bindings/python/build.py b/bindings/python/build.py
index 40bc6c254..2ba242c26 100644
--- a/bindings/python/build.py
+++ b/bindings/python/build.py
@@ -1,7 +1,7 @@
#
# This file is part of Mapnik (c++ mapping toolkit)
#
-# Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
+# Copyright (C) 2013 Artem Pavlenko
#
# Mapnik is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -43,19 +43,22 @@ prefix = env['PREFIX']
target_path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik')
target_path_deprecated = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik2')
-libraries = ['mapnik',env['BOOST_PYTHON_LIB']]
+py_env = env.Clone()
+py_env.Append(CPPPATH = env['PYTHON_INCLUDES'])
+
+py_env['LIBS'] = ['mapnik',env['BOOST_PYTHON_LIB']]
# TODO - do solaris/fedora need direct linking too?
if env['PLATFORM'] == 'Darwin':
if not env['PYTHON_DYNAMIC_LOOKUP']:
if env['PNG']:
- libraries.append('png')
+ py_env.AppendUnique(LIBS = 'png')
if env['JPEG']:
- libraries.append('jpeg')
- libraries.append(env['ICU_LIB_NAME'])
- libraries.append('boost_regex%s' % env['BOOST_APPEND'])
+ py_env.AppendUnique(LIBS = 'jpeg')
+ py_env.AppendUnique(LIBS = env['ICU_LIB_NAME'])
+ py_env.AppendUnique(LIBS = 'boost_regex%s' % env['BOOST_APPEND'])
if env['THREADING'] == 'multi':
- libraries.append('boost_thread%s' % env['BOOST_APPEND'])
+ py_env.AppendUnique(LIBS = 'boost_thread%s' % env['BOOST_APPEND'])
##### Python linking on OS X is tricky ###
# Confounding problems are:
@@ -115,6 +118,9 @@ if env['CUSTOM_LDFLAGS']:
else:
linkflags = python_link_flag
+if env['LINKING'] == 'static':
+ py_env.AppendUnique(LIBS=env['LIBMAPNIK_LIBS'])
+
paths = '''
"""Configuration paths of Mapnik fonts and input plugins (auto-generated by SCons)."""
@@ -147,9 +153,6 @@ except: pass
# install the shared object beside the module directory
sources = glob.glob('*.cpp')
-py_env = env.Clone()
-py_env.Append(CPPPATH = env['PYTHON_INCLUDES'])
-
if 'install' in COMMAND_LINE_TARGETS:
# install the core mapnik python files, including '__init__.py'
init_files = glob.glob('mapnik/*.py')
@@ -177,14 +180,14 @@ if 'uninstall' not in COMMAND_LINE_TARGETS:
py_env.Append(CPPPATH = env['CAIRO_CPPPATHS'])
py_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
if env['PLATFORM'] == 'Darwin':
- py_env.Append(LIBS=env['CAIRO_LINKFLAGS'])
+ py_env.Append(LIBS=env['CAIRO_ALL_LIBS'])
if env['HAS_PYCAIRO']:
py_env.ParseConfig('pkg-config --cflags pycairo')
py_env.Append(CPPDEFINES = '-DHAVE_PYCAIRO')
-libraries.append('boost_thread%s' % env['BOOST_APPEND'])
-_mapnik = py_env.LoadableModule('mapnik/_mapnik', sources, LIBS=libraries, LDMODULEPREFIX='', LDMODULESUFFIX='.so',LINKFLAGS=linkflags)
+py_env.AppendUnique(LIBS = 'boost_thread%s' % env['BOOST_APPEND'])
+_mapnik = py_env.LoadableModule('mapnik/_mapnik', sources, LDMODULEPREFIX='', LDMODULESUFFIX='.so',LINKFLAGS=linkflags)
Depends(_mapnik, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
diff --git a/bindings/python/mapnik/__init__.py b/bindings/python/mapnik/__init__.py
index acb7dfe0b..4c4a1dd89 100644
--- a/bindings/python/mapnik/__init__.py
+++ b/bindings/python/mapnik/__init__.py
@@ -558,24 +558,6 @@ def Osm(**keywords):
keywords['type'] = 'osm'
return CreateDatasource(keywords)
-def Geos(**keywords):
- """Create a GEOS Vector Datasource.
-
- Required keyword arguments:
- wkt -- inline WKT text of the geometry
-
- Optional keyword arguments:
- extent -- manually specified data extent (comma delimited string, default None)
-
- >>> from mapnik import Geos, Layer
- >>> datasource = Geos(wkt='MULTIPOINT(100 100, 50 50, 0 0)')
- >>> lyr = Layer('GEOS Layer from WKT string')
- >>> lyr.datasource = datasource
-
- """
- keywords['type'] = 'geos'
- return CreateDatasource(keywords)
-
def Python(**keywords):
"""Create a Python Datasource.
diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp
index 95c495aec..07383b372 100644
--- a/bindings/python/mapnik_datasource.cpp
+++ b/bindings/python/mapnik_datasource.cpp
@@ -48,14 +48,26 @@ namespace
{
//user-friendly wrapper that uses Python dictionary
using namespace boost::python;
-boost::shared_ptr create_datasource(const dict& d)
+boost::shared_ptr create_datasource(dict const& d)
{
mapnik::parameters params;
boost::python::list keys=d.keys();
- for (int i=0; i(keys[i]);
object obj = d[key];
+ if (PyUnicode_Check(obj.ptr()))
+ {
+ PyObject* temp = PyUnicode_AsUTF8String(obj.ptr());
+ if (temp)
+ {
+ char* c_str = PyString_AsString(temp);
+ params[key] = std::string(c_str);
+ Py_DecRef(temp);
+ }
+ continue;
+ }
+
extract ex0(obj);
extract ex1(obj);
extract ex2(obj);
diff --git a/bindings/python/mapnik_debug_symbolizer.cpp b/bindings/python/mapnik_debug_symbolizer.cpp
new file mode 100644
index 000000000..6b255967f
--- /dev/null
+++ b/bindings/python/mapnik_debug_symbolizer.cpp
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ *
+ * This file is part of Mapnik (c++ mapping toolkit)
+ *
+ * Copyright (C) 2013 Artem Pavlenko
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *****************************************************************************/
+
+#include
+#include "mapnik_enumeration.hpp"
+#include
+
+void export_debug_symbolizer()
+{
+ using namespace boost::python;
+
+ mapnik::enumeration_("debug_symbolizer_mode")
+ .value("COLLISION",mapnik::DEBUG_SYM_MODE_COLLISION)
+ .value("VERTEX",mapnik::DEBUG_SYM_MODE_VERTEX)
+ ;
+
+ class_("DebugSymbolizer",
+ init<>("Default debug Symbolizer"))
+ .add_property("mode",
+ &mapnik::debug_symbolizer::get_mode,
+ &mapnik::debug_symbolizer::set_mode)
+ ;
+}
diff --git a/bindings/python/mapnik_expression.cpp b/bindings/python/mapnik_expression.cpp
index d3bd8b1dd..caf4d2525 100644
--- a/bindings/python/mapnik_expression.cpp
+++ b/bindings/python/mapnik_expression.cpp
@@ -34,8 +34,6 @@
#include
#include
-
-using mapnik::Feature;
using mapnik::expression_ptr;
using mapnik::parse_expression;
using mapnik::to_expression_string;
@@ -53,15 +51,15 @@ std::string expression_to_string_(mapnik::expr_node const& expr)
return mapnik::to_expression_string(expr);
}
-mapnik::value expression_evaluate_(mapnik::expr_node const& expr, mapnik::Feature const& f)
+mapnik::value expression_evaluate_(mapnik::expr_node const& expr, mapnik::feature_impl const& f)
{
// will be auto-converted to proper python type by `mapnik_value_to_python`
- return boost::apply_visitor(mapnik::evaluate(f),expr);
+ return boost::apply_visitor(mapnik::evaluate(f),expr);
}
-bool expression_evaluate_to_bool_(mapnik::expr_node const& expr, mapnik::Feature const& f)
+bool expression_evaluate_to_bool_(mapnik::expr_node const& expr, mapnik::feature_impl const& f)
{
- return boost::apply_visitor(mapnik::evaluate(f),expr).to_bool();
+ return boost::apply_visitor(mapnik::evaluate(f),expr).to_bool();
}
// path expression
@@ -75,7 +73,7 @@ std::string path_to_string_(mapnik::path_expression const& expr)
return mapnik::path_processor_type::to_string(expr);
}
-std::string path_evaluate_(mapnik::path_expression const& expr, mapnik::Feature const& f)
+std::string path_evaluate_(mapnik::path_expression const& expr, mapnik::feature_impl const& f)
{
return mapnik::path_processor_type::evaluate(expr, f);
}
diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp
index 0c7e6745e..8f4e4494f 100644
--- a/bindings/python/mapnik_feature.cpp
+++ b/bindings/python/mapnik_feature.cpp
@@ -41,28 +41,27 @@
namespace {
-using mapnik::Feature;
using mapnik::geometry_utils;
using mapnik::from_wkt;
using mapnik::context_type;
using mapnik::context_ptr;
using mapnik::feature_kv_iterator;
-mapnik::geometry_type const& (mapnik::Feature::*get_geometry_by_const_ref)(unsigned) const = &mapnik::Feature::get_geometry;
-boost::ptr_vector const& (mapnik::Feature::*get_paths_by_const_ref)() const = &mapnik::Feature::paths;
+mapnik::geometry_type const& (mapnik::feature_impl::*get_geometry_by_const_ref)(unsigned) const = &mapnik::feature_impl::get_geometry;
+boost::ptr_vector const& (mapnik::feature_impl::*get_paths_by_const_ref)() const = &mapnik::feature_impl::paths;
-void feature_add_geometries_from_wkb(Feature &feature, std::string wkb)
+void feature_add_geometries_from_wkb(mapnik::feature_impl &feature, std::string wkb)
{
geometry_utils::from_wkb(feature.paths(), wkb.c_str(), wkb.size());
}
-void feature_add_geometries_from_wkt(Feature &feature, std::string wkt)
+void feature_add_geometries_from_wkt(mapnik::feature_impl &feature, std::string wkt)
{
bool result = mapnik::from_wkt(wkt, feature.paths());
if (!result) throw std::runtime_error("Failed to parse WKT");
}
-std::string feature_to_geojson(Feature const& feature)
+std::string feature_to_geojson(mapnik::feature_impl const& feature)
{
std::string json;
mapnik::json::feature_generator g;
@@ -73,22 +72,22 @@ std::string feature_to_geojson(Feature const& feature)
return json;
}
-mapnik::value __getitem__(Feature const& feature, std::string const& name)
+mapnik::value __getitem__(mapnik::feature_impl const& feature, std::string const& name)
{
return feature.get(name);
}
-mapnik::value __getitem2__(Feature const& feature, std::size_t index)
+mapnik::value __getitem2__(mapnik::feature_impl const& feature, std::size_t index)
{
return feature.get(index);
}
-void __setitem__(Feature & feature, std::string const& name, mapnik::value const& val)
+void __setitem__(mapnik::feature_impl & feature, std::string const& name, mapnik::value const& val)
{
feature.put_new(name,val);
}
-boost::python::dict attributes(Feature const& f)
+boost::python::dict attributes(mapnik::feature_impl const& f)
{
boost::python::dict attributes;
feature_kv_iterator itr = f.begin();
@@ -191,7 +190,6 @@ struct value_null_from_python
void export_feature()
{
using namespace boost::python;
- using mapnik::Feature;
// Python to mapnik::value converters
// NOTE: order matters here. For example value_null must be listed before
@@ -211,25 +209,25 @@ void export_feature()
.def("push", &context_type::push)
;
- class_,
+ class_,
boost::noncopyable>("Feature",init("Default ctor."))
- .def("id",&Feature::id)
- .def("__str__",&Feature::to_string)
+ .def("id",&mapnik::feature_impl::id)
+ .def("__str__",&mapnik::feature_impl::to_string)
.def("add_geometries_from_wkb", &feature_add_geometries_from_wkb)
.def("add_geometries_from_wkt", &feature_add_geometries_from_wkt)
- .def("add_geometry", &Feature::add_geometry)
- .def("num_geometries",&Feature::num_geometries)
+ .def("add_geometry", &mapnik::feature_impl::add_geometry)
+ .def("num_geometries",&mapnik::feature_impl::num_geometries)
.def("get_geometry", make_function(get_geometry_by_const_ref,return_value_policy()))
.def("geometries",make_function(get_paths_by_const_ref,return_value_policy()))
- .def("envelope", &Feature::envelope)
- .def("has_key", &Feature::has_key)
+ .def("envelope", &mapnik::feature_impl::envelope)
+ .def("has_key", &mapnik::feature_impl::has_key)
.add_property("attributes",&attributes)
.def("__setitem__",&__setitem__)
.def("__contains__",&__getitem__)
.def("__getitem__",&__getitem__)
.def("__getitem__",&__getitem2__)
- .def("__len__", &Feature::size)
- .def("context",&Feature::context)
+ .def("__len__", &mapnik::feature_impl::size)
+ .def("context",&mapnik::feature_impl::context)
.def("to_geojson",&feature_to_geojson)
;
}
diff --git a/bindings/python/mapnik_featureset.cpp b/bindings/python/mapnik_featureset.cpp
index 3148d116e..c1f7eecd4 100644
--- a/bindings/python/mapnik_featureset.cpp
+++ b/bindings/python/mapnik_featureset.cpp
@@ -65,10 +65,7 @@ inline mapnik::feature_ptr next(mapnik::featureset_ptr const& itr)
void export_featureset()
{
using namespace boost::python;
- using mapnik::Feature;
- using mapnik::Featureset;
-
- class_,
+ class_,
boost::noncopyable>("Featureset",no_init)
.def("__iter__",pass_through)
.def("next",next)
diff --git a/bindings/python/mapnik_markers_symbolizer.cpp b/bindings/python/mapnik_markers_symbolizer.cpp
index 64f6bc394..200c44959 100644
--- a/bindings/python/mapnik_markers_symbolizer.cpp
+++ b/bindings/python/mapnik_markers_symbolizer.cpp
@@ -30,6 +30,8 @@
#include
#include "mapnik_svg.hpp"
#include "mapnik_enumeration.hpp"
+#include "python_optional.hpp"
+
#include // for known_svg_prefix_
using mapnik::markers_symbolizer;
@@ -70,16 +72,6 @@ void set_marker_type(mapnik::markers_symbolizer & symbolizer, std::string const&
}
-
-// https://github.com/mapnik/mapnik/issues/1367
-PyObject* get_fill_opacity_impl(markers_symbolizer & sym)
-{
- boost::optional fill_opacity = sym.get_fill_opacity();
- if (fill_opacity)
- return ::PyFloat_FromDouble(*fill_opacity);
- Py_RETURN_NONE;
-}
-
void export_markers_symbolizer()
{
using namespace boost::python;
@@ -119,7 +111,7 @@ void export_markers_symbolizer()
&markers_symbolizer::set_opacity,
"Set/get the overall opacity")
.add_property("fill_opacity",
- &get_fill_opacity_impl,
+ &markers_symbolizer::get_fill_opacity,
&markers_symbolizer::set_fill_opacity,
"Set/get the fill opacity")
.add_property("ignore_placement",
diff --git a/bindings/python/mapnik_python.cpp b/bindings/python/mapnik_python.cpp
index 4ef560c23..c5da5938c 100644
--- a/bindings/python/mapnik_python.cpp
+++ b/bindings/python/mapnik_python.cpp
@@ -62,6 +62,7 @@ void export_polygon_pattern_symbolizer();
void export_raster_symbolizer();
void export_text_placement();
void export_shield_symbolizer();
+void export_debug_symbolizer();
void export_font_engine();
void export_projection();
void export_proj_transform();
@@ -84,7 +85,6 @@ void export_logger();
#include
#include
#include
-#include
#include
#include
#include
@@ -333,11 +333,6 @@ double scale_denominator(mapnik::Map const &map, bool geographic)
}
// http://docs.python.org/c-api/exceptions.html#standard-exceptions
-void config_error_translator(mapnik::config_error const & ex)
-{
- PyErr_SetString(PyExc_RuntimeError, ex.what());
-}
-
void value_error_translator(mapnik::value_error const & ex)
{
PyErr_SetString(PyExc_ValueError, ex.what());
@@ -433,7 +428,6 @@ BOOST_PYTHON_MODULE(_mapnik)
register_exception_translator(&standard_error_translator);
register_exception_translator(&out_of_range_error_translator);
- register_exception_translator(&config_error_translator);
register_exception_translator(&value_error_translator);
register_exception_translator(&runtime_error_translator);
register_cairo();
@@ -470,6 +464,7 @@ BOOST_PYTHON_MODULE(_mapnik)
export_raster_symbolizer();
export_text_placement();
export_shield_symbolizer();
+ export_debug_symbolizer();
export_font_engine();
export_projection();
export_proj_transform();
diff --git a/bindings/python/mapnik_raster_symbolizer.cpp b/bindings/python/mapnik_raster_symbolizer.cpp
index 54f66a554..20a04a3f3 100644
--- a/bindings/python/mapnik_raster_symbolizer.cpp
+++ b/bindings/python/mapnik_raster_symbolizer.cpp
@@ -28,18 +28,7 @@
#include
#include
-namespace {
-// https://github.com/mapnik/mapnik/issues/1367
-PyObject* get_premultiplied_impl(mapnik::raster_symbolizer & sym)
-{
- boost::optional premultiplied = sym.premultiplied();
- if (premultiplied)
- return ::PyBool_FromLong(*premultiplied);
- Py_RETURN_NONE;
-}
-
-}
using mapnik::raster_symbolizer;
void export_raster_symbolizer()
@@ -132,7 +121,7 @@ void export_raster_symbolizer()
">>> r.mesh_size = 32\n"
)
.add_property("premultiplied",
- &get_premultiplied_impl,
+ &raster_symbolizer::premultiplied,
&raster_symbolizer::set_premultiplied,
"Get/Set premultiplied status of the source image.\n"
"Can be used to override what the source data reports (when in error)\n"
diff --git a/bindings/python/mapnik_rule.cpp b/bindings/python/mapnik_rule.cpp
index bad1f2639..80341ca24 100644
--- a/bindings/python/mapnik_rule.cpp
+++ b/bindings/python/mapnik_rule.cpp
@@ -34,7 +34,6 @@
using mapnik::rule;
using mapnik::expr_node;
using mapnik::expression_ptr;
-using mapnik::Feature;
using mapnik::point_symbolizer;
using mapnik::line_symbolizer;
using mapnik::line_pattern_symbolizer;
diff --git a/bindings/python/mapnik_text_placement.cpp b/bindings/python/mapnik_text_placement.cpp
index f1dcefae8..05201326a 100644
--- a/bindings/python/mapnik_text_placement.cpp
+++ b/bindings/python/mapnik_text_placement.cpp
@@ -84,7 +84,7 @@ struct NodeWrap: formatting::node, wrapper
}
- void apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ void apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
python_block_auto_unblock b;
this->get_override("apply")(ptr(&p), ptr(&feature), ptr(&output));
@@ -122,7 +122,7 @@ struct TextNodeWrap: formatting::text_node, wrapper
}
- virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ virtual void apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
if(override o = this->get_override("apply"))
{
@@ -135,7 +135,7 @@ struct TextNodeWrap: formatting::text_node, wrapper
}
}
- void default_apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ void default_apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
formatting::text_node::apply(p, feature, output);
}
@@ -143,7 +143,7 @@ struct TextNodeWrap: formatting::text_node, wrapper
struct FormatNodeWrap: formatting::format_node, wrapper
{
- virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ virtual void apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
if(override o = this->get_override("apply"))
{
@@ -156,7 +156,7 @@ struct FormatNodeWrap: formatting::format_node, wrapper
}
}
- void default_apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ void default_apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
formatting::format_node::apply(p, feature, output);
}
@@ -164,7 +164,7 @@ struct FormatNodeWrap: formatting::format_node, wrapper
struct ExprFormatWrap: formatting::expression_format, wrapper
{
- virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ virtual void apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
if(override o = this->get_override("apply"))
{
@@ -177,7 +177,7 @@ struct ExprFormatWrap: formatting::expression_format, wrapper
http://wiki.python.org/moin/boost.python/HowTo#A.22Raw.22_function */
- virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ virtual void apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
if(override o = this->get_override("apply"))
{
@@ -214,7 +214,7 @@ struct ListNodeWrap: formatting::list_node, wrapper
}
}
- void default_apply(char_properties const& p, Feature const& feature, processed_text &output) const
+ void default_apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
formatting::list_node::apply(p, feature, output);
}
diff --git a/bindings/python/python_optional.hpp b/bindings/python/python_optional.hpp
index 0d785b0f3..9bc38d119 100644
--- a/bindings/python/python_optional.hpp
+++ b/bindings/python/python_optional.hpp
@@ -22,7 +22,8 @@
#include
#include
-#include
+
+#include
// boost::optional to/from converter from John Wiegley
@@ -46,7 +47,7 @@ struct register_python_conversion
};
template
-struct python_optional : public boost::noncopyable
+struct python_optional : public mapnik::noncopyable
{
struct optional_to_python
{
@@ -74,7 +75,7 @@ struct python_optional : public boost::noncopyable
rvalue_from_python_stage1(source, converters);
return rvalue_from_python_stage2(source, data, converters);
}
- return NULL;
+ return 0;
}
static void construct(PyObject * source,
@@ -94,17 +95,116 @@ struct python_optional : public boost::noncopyable
}
};
- explicit python_optional() {
+ explicit python_optional()
+ {
register_python_conversion,
optional_to_python, optional_from_python>();
}
};
-/** This class works around a bug in boost python.
+// to/from boost::optional
+template <>
+struct python_optional : public mapnik::noncopyable
+{
+ struct optional_to_python
+ {
+ static PyObject * convert(const boost::optional& value)
+ {
+ return (value ? PyFloat_FromDouble(*value) :
+ boost::python::detail::none());
+ }
+ };
- See http://osdir.com/ml/python.c++/2003-11/msg00158.html
-*/
-template
+ struct optional_from_python
+ {
+ static void * convertible(PyObject * source)
+ {
+ using namespace boost::python::converter;
+
+ if (source == Py_None || PyFloat_Check(source))
+ return source;
+ return 0;
+ }
+
+ static void construct(PyObject * source,
+ boost::python::converter::rvalue_from_python_stage1_data * data)
+ {
+ using namespace boost::python::converter;
+ void * const storage = ((rvalue_from_python_storage > *)
+ data)->storage.bytes;
+ if (source == Py_None) // == None
+ new (storage) boost::optional(); // A Boost uninitialized value
+ else
+ new (storage) boost::optional(PyFloat_AsDouble(source));
+ data->convertible = storage;
+ }
+ };
+
+ explicit python_optional()
+ {
+ register_python_conversion,
+ optional_to_python, optional_from_python>();
+ }
+};
+
+// to/from boost::optional
+template <>
+struct python_optional : public mapnik::noncopyable
+{
+ struct optional_to_python
+ {
+ static PyObject * convert(const boost::optional& value)
+ {
+ if (value)
+ {
+ if (*value) Py_RETURN_TRUE;
+ else Py_RETURN_FALSE;
+ }
+ else return boost::python::detail::none();
+ }
+ };
+ struct optional_from_python
+ {
+ static void * convertible(PyObject * source)
+ {
+ using namespace boost::python::converter;
+
+ if (source == Py_None || PyBool_Check(source))
+ return source;
+ return 0;
+ }
+
+ static void construct(PyObject * source,
+ boost::python::converter::rvalue_from_python_stage1_data * data)
+ {
+ using namespace boost::python::converter;
+ void * const storage = ((rvalue_from_python_storage > *)
+ data)->storage.bytes;
+ if (source == Py_None) // == None
+ new (storage) boost::optional(); // A Boost uninitialized value
+ else
+ {
+ new (storage) boost::optional(source == Py_True ? true : false);
+ }
+ data->convertible = storage;
+ }
+ };
+
+ explicit python_optional()
+ {
+ register_python_conversion,
+ optional_to_python, optional_from_python>();
+ }
+};
+
+
+// This class works around a feature in boost python.
+// See http://osdir.com/ml/python.c++/2003-11/msg00158.html
+
+template
class class_with_converter : public boost::python::class_
{
public:
diff --git a/demo/c++/Makefile b/demo/c++/Makefile
index d30b71b40..dbd425380 100644
--- a/demo/c++/Makefile
+++ b/demo/c++/Makefile
@@ -1,4 +1,4 @@
-CXXFLAGS = $(shell mapnik-config --cflags)
+CXXFLAGS = $(shell mapnik-config --includes --defines --cxxflags --dep-includes)
LDFLAGS = $(shell mapnik-config --libs --dep-libs --ldflags)
OBJ = rundemo.o
@@ -13,8 +13,15 @@ $(BIN) : $(OBJ)
.c.o :
$(CXX) -c $(CXXFLAGS) $<
+gyp:
+ rm -rf ./build
+ gyp rundemo.gyp --depth=. -f make --generator-output=./build/
+ make -C ./build
+ build/out/Release/rundemo `mapnik-config --prefix`
+
.PHONY : clean
clean:
rm -f $(OBJ)
rm -f $(BIN)
+ rm -f ./build
\ No newline at end of file
diff --git a/demo/c++/README.md b/demo/c++/README.md
new file mode 100644
index 000000000..daa4198c1
--- /dev/null
+++ b/demo/c++/README.md
@@ -0,0 +1,81 @@
+## rundemo.cpp
+
+This directory contains a simple c++ program demonstrating the Mapnik C++ API. It mimics the python 'rundemo.py' example with a couple exceptions.
+
+If building on unix you can have this program automatically build by configuring Mapnik like:
+
+ ./configure DEMO=True
+
+However, this example code also should be able to be built standalone.
+
+The following notes describe how to do that on various operating systems.
+
+## Depends
+
+ - Mapnik library development headers
+ - `mapnik-config` on unix and `mapnik-config.bat` on windows
+
+### Unix
+
+On OS X and Linux you also need `make`.
+
+### Windows
+
+On windows, additional dependencies to build are:
+
+ - MSVS 2010 with C++ compiler
+ - Python 2.x
+ - gyp: https://code.google.com/p/gyp | https://github.com/springmeyer/hello-gyp
+
+`mapnik-config.bat` should come with your Mapnik installation.
+
+First confirm it is on your path:
+
+ mapnik-config # should give usage
+
+To install gyp, which is pure python do:
+
+ svn checkout http://gyp.googlecode.com/svn/trunk/ gyp
+ cd gyp
+ python setup.py install
+
+If you do not have svn installed you can grab gyp from:
+
+ https://github.com/TooTallNate/node-gyp/archive/master.zip
+ # unzip and extract the 'gyp' subfolder then do
+ cd gyp
+ python setup.py install
+
+## Building the demo
+
+### Unix
+
+Simply type:
+
+ make
+
+Then to run do:
+
+ ./rundemo `mapnik-config --prefix`
+
+On OS X you can also create an xcode project:
+
+ gyp rundemo.gyp --depth=. -f xcode --generator-output=./build/
+ xcodebuild -project ./build/rundemo.xcodeproj
+ ./build/out/Release/rundemo `mapnik-config --prefix`
+
+
+### Windows
+
+First you need to build the visual studio solution with gyp:
+
+ C:\Python27\python.exe c:\Python27\Scripts\gyp rundemo.gyp --depth=. -f msvs -G msvs_version=2010
+
+Then you can compile with `msbuild`:
+
+ msbuild rundemo.sln /p:Configuration="Release" /p:Platform=Win32
+
+Then run it!
+
+ for /f %i in ('mapnik-config --prefix') do set MAPNIK_PREFIX=%i
+ Release\rundemo.exe %MAPNIK_PREFIX%
diff --git a/demo/c++/common.gypi b/demo/c++/common.gypi
new file mode 100644
index 000000000..2dd800c78
--- /dev/null
+++ b/demo/c++/common.gypi
@@ -0,0 +1,42 @@
+{
+ 'variables': {
+ 'conditions': [
+ ['OS == "mac"', {
+ 'target_arch%': 'x64'
+ }, {
+ 'target_arch%': 'ia32'
+ }]
+ ]
+ },
+ 'target_defaults': {
+ 'default_configuration': 'Release',
+ 'defines': [ ],
+ 'conditions': [
+ ['OS == "mac"', {
+ 'defines': [ 'DARWIN' ]
+ }, {
+ 'defines': [ 'LINUX' ]
+ }],
+ ['OS == "mac" and target_arch == "x64"', {
+ 'xcode_settings': {
+ 'ARCHS': [ 'x86_64' ]
+ },
+ }]
+ ],
+ 'configurations': {
+ 'Debug': {
+ 'cflags': [ '-g', '-O0' ],
+ 'xcode_settings': {
+ 'OTHER_CFLAGS': [ '-g', '-O0' ]
+ }
+ },
+ 'Release': {
+ 'cflags': [ '-O3' ],
+ 'defines': [ 'NDEBUG' ],
+ 'xcode_settings': {
+ 'OTHER_CFLAGS': [ '-O3' ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/c++/readme.txt b/demo/c++/readme.txt
deleted file mode 100644
index c9d546bc5..000000000
--- a/demo/c++/readme.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-This directory contains a simple c++ program demonstrating the Mapnik C++ API. It mimics the python 'rundemo.py' example with a couple exceptions.
-
-To build it re-configure SCons with DEMO=True then rebuild::
-
- $ python scons/scons.py configure DEMO=True
- $ python scons/scons.py
-
-
-The sample program will be compiled (but not installed).
-
-
-To run::
-
- $ cd demo/c++
- $ ./rundemo /usr/local/lib/mapnik
-
-For more detailed comments have a look in demo/python/rundemo.py
-
-Have fun!
-Artem.
diff --git a/demo/c++/rundemo.gyp b/demo/c++/rundemo.gyp
new file mode 100644
index 000000000..e54ae121c
--- /dev/null
+++ b/demo/c++/rundemo.gyp
@@ -0,0 +1,48 @@
+{
+ 'includes': [ 'common.gypi' ],
+ 'default_configuration': 'Release',
+ 'targets': [
+ {
+ 'target_name': 'rundemo',
+ 'type': 'executable',
+ 'sources': [
+ 'rundemo.cpp',
+ ],
+ 'conditions': [
+ [ 'OS=="mac"', {
+ 'libraries': [
+ '-lmapnik',
+ '-undefined dynamic_lookup'
+ ],
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS':[
+ '
-
- charplacement
- charplacement
-
- 1
- 1.00000
- 2.00000
- 1.00000
- 5.00000
-
-
- NAME
- NAME
- String
- 0
-
-
- CLASS
- CLASS
- String
- 0
-
-
-
diff --git a/demo/data/test/raw/charplacement.gml b/demo/data/test/raw/charplacement.gml
deleted file mode 100644
index 8de776840..000000000
--- a/demo/data/test/raw/charplacement.gml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
- 00
- 13-13
-
-
-
-
-
- 2,-1 1,-3 2,-5
- Road Name
- TRIANGLE
-
-
- 3,-1 4,-3 3,-5
- Road Name
- TRIANGLE
-
-
-
-
- 1,-12 13,-12
-
- Road Name
- STRAIGHT
-
-
-
- 1,-13 2,-13 5,-13 10,-13 13,-13
-
- Road Name
- STRAIGHT
-
-
-
- 6,-1 5,-3 5,-5
- Road Name
- BEND
-
-
- 7,-1 8,-3 8,-5
- Road Name
- BEND
-
-
- 5,-6 5,-8 6,-10
- Road Name
- BEND
-
-
- 8,-6 8,-8 7,-10
- Road Name
- BEND
-
-
-
- 10.055915,-1.00031738281 10.6649858,-1.077712483 11.274056,-1.26950068 11.77921,-1.55298308 12.191993,-1.92815928 12.51529,-2.369132 12.746218,-2.8329032 12.884774,-3.2968745 12.930959,-3.875339
- Road Name
- CURVE
-
-
- 10.0555,-8.875339 10.6645708,-8.7979439 11.273641,-8.6061557 11.778795,-8.3226733 12.191578,-7.9474971 12.514875,-7.5065244 12.745803,-7.0427532 12.884359,-6.5787819 12.930544,-6.0003174
- Road Name
- CURVE
-
-
-
-
-9.055915,-2.00031738281 9.6649858,-2.077712483 10.274056,-2.26950068 10.77921,-2.55298308 11.191993,-2.92815928 11.51529,-3.369132 11.746218,-3.8329032 11.884774,-4.2968745 11.930959,-4.875339
-11.930544,-5.0003174 11.884359,-5.5787819 11.745803,-6.0427532 11.514875,-6.5065244 11.191578,-6.9474971 10.778795,-7.3226733 10.273641,-7.6061557 9.6645708,-7.7979439 9.0555,-7.875339
-
- Road Name
- CURVE
-
-
-
-
-9.0435048,-10.5550195 9.480786,-10.2191668 9.963148,-10.0731439 10.540222,-10.2495527 10.968444,-10.525815 11.419238,-10.8336443 12.01882,-10.9565825 12.559787,-10.7996079 12.956495,-10.4089966
-
- Road Name
- SQUIGGLE
-
-
-
-
- 1,-9 1.4,-10 1.8,-9 2.2,-10 2.6,-9 3.0,-10 3.4,-9 3.8,-10 4.2,-9 4.6,-10
-
- Long ZigZag Road Name
- ZIGZAG
-
-
-
-
diff --git a/demo/data/test/raw/charplacement.xsd b/demo/data/test/raw/charplacement.xsd
deleted file mode 100644
index 345905d06..000000000
--- a/demo/data/test/raw/charplacement.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/data/test/raw/displacement.gfs b/demo/data/test/raw/displacement.gfs
deleted file mode 100644
index 3034d7109..000000000
--- a/demo/data/test/raw/displacement.gfs
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- displacement
- displacement
-
- 1
- 1.00000
- 2.00000
- 1.00000
- 5.00000
-
-
- NAME
- NAME
- String
- 0
-
-
- CLASS
- CLASS
- String
- 0
-
-
-
diff --git a/demo/data/test/raw/displacement.gml b/demo/data/test/raw/displacement.gml
deleted file mode 100644
index 9b3a007ce..000000000
--- a/demo/data/test/raw/displacement.gml
+++ /dev/null
@@ -1,173 +0,0 @@
-
-
-
-
- 00
- 13-13
-
-
-
-
-
- 1,-3 1,-2
- Road
- CLOCKWISE
-
-
- 1,-2 2,-1
- Road
- CLOCKWISE
-
-
- 2,-1 3,-1
- Road
- CLOCKWISE
-
-
- 3,-1 4,-2
- Road
- CLOCKWISE
-
-
- 4,-2 4,-3
- Road
- CLOCKWISE
-
-
- 4,-3 3,-4
- Road
- CLOCKWISE
-
-
- 3,-4 2,-4
- Road
- CLOCKWISE
-
-
- 2,-4 1,-3
- Road
- CLOCKWISE
-
-
-
- 5,-3 6,-4
- Road
- ANTICLOCKWISE
-
-
- 6,-4 7,-4
- Road
- ANTICLOCKWISE
-
-
- 7,-4 8,-3
- Road
- ANTICLOCKWISE
-
-
- 8,-3 8,-2
- Road
- ANTICLOCKWISE
-
-
- 8,-2 7,-1
- Road
- ANTICLOCKWISE
-
-
- 7,-1 6,-1
- Road
- ANTICLOCKWISE
-
-
- 6,-1 5,-2
- Road
- ANTICLOCKWISE
-
-
- 5,-2 5,-3
- Road
- ANTICLOCKWISE
-
-
-
-
- 1,-6.5 2,-5.5 3,-5 4,-5 5,-5.5 6,-6.5
-
- Long Road Name To Go Around The Whole Curve!
- CURVE
-
-
-
-
- 1,-7 2,-8 3,-8.5 4,-8.5 5,-8 6,-7
-
- Long Road Name To Go Around The Whole Curve!
- CURVE
-
-
-
-
- 3,-8.5 2,-9.5 1.5,-10.5 1.5,-11.5 2,-12.5 3,-13.5
-
- Long Road Name To Go Around The Whole Curve!
- VERTCURVE
-
-
-
- 4,-8.5 5,-9.5 5.5,-10.5 5.5,-11.5 5,-12.5 4,-13.5
-
- Long Road Name To Go Around The Whole Curve!
- VERTCURVE
-
-
-
-
- 9.2,-4 9,-3 10,-3 10.2,-4
-
- Road Name
- PARALLELOGRAM
-
-
-
- 9,-2 9.2,-1 10.2,-1 10,-2
-
- Road Name
- PARALLELOGRAM
-
-
-
-
- 11,-1 11,-2 12,-2
-
- Road Name
- CORNER
-
-
-
- 11,-4 12,-4 12,-3
-
- Road Name
- CORNER
-
-
-
- 12.5,-1 13.5,-1 13.5,-2
-
- Road Name
- CORNER
-
-
-
- 12.5,-4 12.5,-3 13.5,-3
-
- Road Name
- CORNER
-
-
-
-
diff --git a/demo/data/test/raw/displacement.xsd b/demo/data/test/raw/displacement.xsd
deleted file mode 100644
index 66f9b90f0..000000000
--- a/demo/data/test/raw/displacement.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/data/test/raw/overlap.gfs b/demo/data/test/raw/overlap.gfs
deleted file mode 100644
index 67e8c818e..000000000
--- a/demo/data/test/raw/overlap.gfs
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- overlap
- overlap
-
- 1
- 1.00000
- 2.00000
- 1.00000
- 5.00000
-
-
- NAME
- NAME
- String
- 0
-
-
- CLASS
- CLASS
- String
- 0
-
-
-
diff --git a/demo/data/test/raw/overlap.gml b/demo/data/test/raw/overlap.gml
deleted file mode 100644
index 5fe0e85df..000000000
--- a/demo/data/test/raw/overlap.gml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
- 00
- 13-13
-
-
-
-
-
- 1,-1 1,-10
- Road Name
- NETWORK
-
-
- 1,-3 7,-3
- Road Name
- NETWORK
-
-
- 7,-3 7,-7
- Road Name
- NETWORK
-
-
- 3,-2 3,-8
- Road Name
- NETWORK
-
-
- 7,-7 1,-7
- Road Name
- NETWORK
-
-
- 5,-2 5,-8
- Road Name
- NETWORK
-
-
-
- 8,-3 12,-3
- Road Name
- CROSS
-
-
- 10,-1 10,-5
- Road Name
- CROSS
-
-
-
-
- 10,-9 13,-9 13,-11 11,-11 11,-8
-
- Road Name
- SELFOVERLAP
-
-
-
- 4,-9 4,-13
- Road Name
- NETWORK2
-
-
- 8,-9 8,-13
- Road Name
- NETWORK2
-
-
- 1,-11 9,-11
- Road Name
- NETWORK2
-
-
- 2,-9 2,-13
- Road Name
- NETWORK2
-
-
- 6,-9 6,-13
- Road Name
- NETWORK2
-
-
-
-
- 8.8,-6 8.8,-8
- Long Road Name
- BENDOVER
-
-
- 8,-6 8,-7 10,-7 10,-8
- Long Road Name
- BENDUNDER
-
-
-
- 12.2,-6 12.2,-8
- Long Road Name
- BENDOVER
-
-
- 11,-6 11,-7 13,-7 13,-8
- Long Road Name
- BENDUNDER
-
-
-
- 12.2,-3.5 12.2,-5.5
- Long Road Name
- BENDOVER
-
-
- 11,-4.5 13,-4.5
- Long Road Name
- BENDUNDER
-
-
-
-
-
diff --git a/demo/data/test/raw/overlap.xsd b/demo/data/test/raw/overlap.xsd
deleted file mode 100644
index 1a7cf35a2..000000000
--- a/demo/data/test/raw/overlap.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/data/test/raw/textspacing.gfs b/demo/data/test/raw/textspacing.gfs
deleted file mode 100644
index c589181eb..000000000
--- a/demo/data/test/raw/textspacing.gfs
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- textspacing
- textspacing
-
- 1
- 1.00000
- 2.00000
- 1.00000
- 5.00000
-
-
- NAME
- NAME
- String
- 0
-
-
- CLASS
- CLASS
- String
- 0
-
-
-
diff --git a/demo/data/test/raw/textspacing.gml b/demo/data/test/raw/textspacing.gml
deleted file mode 100644
index 62fff2415..000000000
--- a/demo/data/test/raw/textspacing.gml
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
- 00
- 13-13
-
-
-
-
-
- 2,-1 1,-3 2,-5
- Road Name
- TRIANGLE
-
-
- 3,-1 4,-3 3,-5
- Road Name
- TRIANGLE
-
-
-
- 1,-7 2,-7
- Road Name
- STRAIGHT
-
-
- 1,-8 3,-8
- Road Name
- STRAIGHT
-
-
- 1,-9 4,-9
- Road Name
- STRAIGHT
-
-
- 1,-10 5,-10
- Road Name
- STRAIGHT
-
-
-
- 1,-11 7,-11
- Road Name
- STRAIGHT
-
-
-
- 1,-12 13,-12
-
- Road Name
- STRAIGHT
-
-
-
- 1,-13 2,-13 5,-13 10,-13 13,-13
-
- Road Name
- STRAIGHT
-
-
-
- 6,-1 5,-3 5,-5
- Road Name
- BEND
-
-
- 7,-1 8,-3 8,-5
- Road Name
- BEND
-
-
- 5,-6 5,-8 6,-10
- Road Name
- BEND
-
-
- 8,-6 8,-8 7,-10
- Road Name
- BEND
-
-
-
- 10.055915,-1.00031738281 10.6649858,-1.077712483 11.274056,-1.26950068 11.77921,-1.55298308 12.191993,-1.92815928 12.51529,-2.369132 12.746218,-2.8329032 12.884774,-3.2968745 12.930959,-3.875339
- Road Name
- CURVE
-
-
- 10.0555,-8.875339 10.6645708,-8.7979439 11.273641,-8.6061557 11.778795,-8.3226733 12.191578,-7.9474971 12.514875,-7.5065244 12.745803,-7.0427532 12.884359,-6.5787819 12.930544,-6.0003174
- Road Name
- CURVE
-
-
-
-
-9.055915,-2.00031738281 9.6649858,-2.077712483 10.274056,-2.26950068 10.77921,-2.55298308 11.191993,-2.92815928 11.51529,-3.369132 11.746218,-3.8329032 11.884774,-4.2968745 11.930959,-4.875339
-11.930544,-5.0003174 11.884359,-5.5787819 11.745803,-6.0427532 11.514875,-6.5065244 11.191578,-6.9474971 10.778795,-7.3226733 10.273641,-7.6061557 9.6645708,-7.7979439 9.0555,-7.875339
-
- Road Name
- CURVE
-
-
-
-
-9.0435048,-10.5550195 9.480786,-10.2191668 9.963148,-10.0731439 10.540222,-10.2495527 10.968444,-10.525815 11.419238,-10.8336443 12.01882,-10.9565825 12.559787,-10.7996079 12.956495,-10.4089966
-
- Road Name
- SQUIGGLE
-
-
-
-
diff --git a/demo/data/test/raw/textspacing.xsd b/demo/data/test/raw/textspacing.xsd
deleted file mode 100644
index 2e6a4d755..000000000
--- a/demo/data/test/raw/textspacing.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/data/test/readme.txt b/demo/data/test/readme.txt
deleted file mode 100644
index c1dc62efd..000000000
--- a/demo/data/test/readme.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-These files are for testing various rendering parts of mapnik, they have been created by hand.
-The raw files are in the raw/ folder (they were created with inkscape to assist!)
-Run the regenerate.sh script to regenerate the shape files from the gml files, this requires ogr2ogr to run.
diff --git a/demo/data/test/regenerate.sh b/demo/data/test/regenerate.sh
deleted file mode 100755
index de1b5babe..000000000
--- a/demo/data/test/regenerate.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-rm -f textspacing.shp textspacing.shx textspacing.dbf
-ogr2ogr -f "ESRI Shapefile" textspacing raw/textspacing.gml
-mv textspacing/* ./
-rmdir textspacing
-
-rm -f overlap.shp overlap.shx overlap.dbf
-ogr2ogr -f "ESRI Shapefile" overlap raw/overlap.gml
-mv overlap/* ./
-rmdir overlap
-
-rm -f displacement.shp displacement.shx displacement.dbf
-ogr2ogr -f "ESRI Shapefile" displacement raw/displacement.gml
-mv displacement/* ./
-rmdir displacement
-
-rm -f charplacement.shp charplacement.shx charplacement.dbf
-ogr2ogr -f "ESRI Shapefile" charplacement raw/charplacement.gml
-mv charplacement/* ./
-rmdir charplacement
diff --git a/demo/viewer/main.cpp b/demo/viewer/main.cpp
index 73af0c95c..6d83c46a9 100644
--- a/demo/viewer/main.cpp
+++ b/demo/viewer/main.cpp
@@ -19,7 +19,7 @@
// qt
-#include
+#include
#include
#include
#include
diff --git a/demo/viewer/mainwindow.cpp b/demo/viewer/mainwindow.cpp
index 996138678..e87e7a0d4 100644
--- a/demo/viewer/mainwindow.cpp
+++ b/demo/viewer/mainwindow.cpp
@@ -32,7 +32,10 @@
#include
#include
#include
-
+#include
+#include
+#include
+#include
// mapnik
#ifndef Q_MOC_RUN // QT moc chokes on BOOST_JOIN
diff --git a/demo/viewer/mainwindow.hpp b/demo/viewer/mainwindow.hpp
index 99936da73..f5f01863f 100644
--- a/demo/viewer/mainwindow.hpp
+++ b/demo/viewer/mainwindow.hpp
@@ -22,7 +22,6 @@
#define MAINWINDOW_HPP
#include
-#include
#include
#include
#include
@@ -78,7 +77,6 @@ private:
LayerTab *layerTab_;
StyleTab * styleTab_;
MapWidget * mapWidget_;
- QPrinter printer;
//actions
QList exportAsActs;
QActionGroup *toolsGroup;
diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp
index 0b8753e44..93be08351 100644
--- a/demo/viewer/mapwidget.cpp
+++ b/demo/viewer/mapwidget.cpp
@@ -26,7 +26,6 @@
#include
#include
-#include
#include
#include
#include
@@ -528,42 +527,7 @@ void render_agg(mapnik::Map const& map, double scaling_factor, QPixmap & pix)
void render_grid(mapnik::Map const& map, double scaling_factor, QPixmap & pix)
{
- unsigned width=map.width();
- unsigned height=map.height();
-
- mapnik::grid buf(width,height,"F_CODE", 1);
- mapnik::grid_renderer ren(map,buf,scaling_factor);
-
- try
- {
- ren.apply();
- mapnik::value_integer * imdata = static_cast(buf.raw_data());
-
- // Not sure how to display long long values ??
- //QImage image(width,height,QImage::Format_RGB32);
- //for (unsigned i = 0 ; i < height ; ++i)
- //{
- // for (unsigned j = 0 ; j < width ; ++j)
- // {
- // image.setPixel(j,i,qRgb((uint8_t)(imdata[i*width+j]>>8),
- // (uint8_t)(imdata[i*width+j+1]>>8),
- // (uint8_t)(imdata[i*width+j+2]>>8)));
- // }
- //}
- //pix = QPixmap::fromImage(image);
- }
- catch (mapnik::config_error & ex)
- {
- std::cerr << ex.what() << std::endl;
- }
- catch (const std::exception & ex)
- {
- std::cerr << "exception: " << ex.what() << std::endl;
- }
- catch (...)
- {
- std::cerr << "Unknown exception caught!\n";
- }
+ std::cerr << "Not supported" << std::endl;
}
diff --git a/demo/viewer/viewer.pro b/demo/viewer/viewer.pro
index adf2a46be..a19bc9c95 100644
--- a/demo/viewer/viewer.pro
+++ b/demo/viewer/viewer.pro
@@ -2,8 +2,10 @@
# Mapnik viewer - Copyright (C) 2007 Artem Pavlenko
######################################################################
TEMPLATE = app
+QT += core gui widgets
QMAKE_CXX = clang++
QMAKE_CXXFLAGS += $$system(mapnik-config --cxxflags)
+QMAKE_CXXFLAGS += $$system(mapnik-config --includes --dep-includes)
QMAKE_LFLAGS += $$system(mapnik-config --libs)
QMAKE_LFLAGS += $$system(mapnik-config --ldflags --dep-libs)
QMAKE_LFLAGS += -lboost_timer
diff --git a/deps/agg/include/agg_vpgen_clip_polygon.h b/deps/agg/include/agg_vpgen_clip_polygon.h
index ded754e21..4972a390b 100644
--- a/deps/agg/include/agg_vpgen_clip_polygon.h
+++ b/deps/agg/include/agg_vpgen_clip_polygon.h
@@ -18,6 +18,9 @@
#include "agg_basics.h"
+// https://github.com/mapnik/mapnik/issues/1860
+#include
+
namespace agg
{
@@ -25,7 +28,8 @@ namespace agg
//
// See Implementation agg_vpgen_clip_polygon.cpp
//
- class vpgen_clip_polygon
+
+ class MAPNIK_DECL vpgen_clip_polygon
{
public:
vpgen_clip_polygon() :
diff --git a/deps/clipper/include/clipper.hpp b/deps/clipper/include/clipper.hpp
index 78f6b1ca0..4683ef38d 100755
--- a/deps/clipper/include/clipper.hpp
+++ b/deps/clipper/include/clipper.hpp
@@ -105,7 +105,7 @@ private:
enum JoinType { jtSquare, jtRound, jtMiter };
bool Orientation(const Polygon &poly);
-double Area(const Polygon &poly);
+MAPNIK_DECL double Area(const Polygon &poly);
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
double delta, JoinType jointype = jtSquare, double limit = 0, bool autoFix = true);
diff --git a/include/mapnik/cairo_context.hpp b/include/mapnik/cairo_context.hpp
index db4e8b1e3..16a55e617 100644
--- a/include/mapnik/cairo_context.hpp
+++ b/include/mapnik/cairo_context.hpp
@@ -41,7 +41,6 @@
// cairo
#include
-#include
// stl
#include