Merge branch 'master' into gsoc-crundel
This commit is contained in:
commit
43f2fa7075
395 changed files with 7881 additions and 5252 deletions
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
.DS_Store
|
||||||
*~
|
*~
|
||||||
*.o
|
*.o
|
||||||
*.pyc
|
*.pyc
|
||||||
|
@ -23,4 +24,13 @@ utils/shapeindex/shapeindex
|
||||||
utils/pgsql2sqlite/pgsql2sqlite
|
utils/pgsql2sqlite/pgsql2sqlite
|
||||||
utils/svg2png/svg2png
|
utils/svg2png/svg2png
|
||||||
demo/python/demo*
|
demo/python/demo*
|
||||||
demo/python/map.xml
|
demo/python/map.xml
|
||||||
|
tests/cpp_tests/svg_renderer_tests/background_color_test
|
||||||
|
tests/cpp_tests/svg_renderer_tests/combined_test
|
||||||
|
tests/cpp_tests/svg_renderer_tests/compilation_test
|
||||||
|
tests/cpp_tests/svg_renderer_tests/file_output_test
|
||||||
|
tests/cpp_tests/svg_renderer_tests/file_output_test_case.svg
|
||||||
|
tests/cpp_tests/svg_renderer_tests/path_element_test
|
||||||
|
tests/cpp_tests/svg_renderer_tests/path_element_test_case_1.svg
|
||||||
|
tests/cpp_tests/svg_renderer_tests/root_element_test
|
||||||
|
tests/data/sqlite/*index
|
||||||
|
|
25
CHANGELOG
25
CHANGELOG
|
@ -3,7 +3,7 @@
|
||||||
----------------
|
----------------
|
||||||
Mapnik Changelog
|
Mapnik Changelog
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
A simple log of core changes affecting Mapnik usage.
|
A simple log of core changes affecting Mapnik usage.
|
||||||
|
|
||||||
Developers: Please commit along with changes.
|
Developers: Please commit along with changes.
|
||||||
|
@ -18,6 +18,7 @@ Mapnik 2.1.0
|
||||||
|
|
||||||
- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) (#908)
|
- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) (#908)
|
||||||
|
|
||||||
|
- Added <layer_by_sql> parameter in OGR plugin to select a layer by SQL query (besides name or index): see http://www.gdal.org/ogr/ogr_sql.html for specifications (kunitoki) (#472)
|
||||||
|
|
||||||
|
|
||||||
Mapnik 2.0.0
|
Mapnik 2.0.0
|
||||||
|
@ -45,7 +46,7 @@ Mapnik 2.0.0
|
||||||
- Added map.base parameter that can be set to control where files with relative paths should be interpreted
|
- Added map.base parameter that can be set to control where files with relative paths should be interpreted
|
||||||
from when a map is loaded from a string or saved to a string. It defaults to an empty string which means
|
from when a map is loaded from a string or saved to a string. It defaults to an empty string which means
|
||||||
that the base path will be the current working directory of the mapnik process. When a stylesheet is read
|
that the base path will be the current working directory of the mapnik process. When a stylesheet is read
|
||||||
from a file that files directory is used. And a custom value can still be passed as an argument to
|
from a file that files directory is used. And a custom value can still be passed as an argument to
|
||||||
load_map_from_string().
|
load_map_from_string().
|
||||||
|
|
||||||
- Added python function 'render_grid' to allow conversion of grid buffer to python object containing list of grid
|
- Added python function 'render_grid' to allow conversion of grid buffer to python object containing list of grid
|
||||||
|
@ -112,7 +113,7 @@ Mapnik 2.0.0
|
||||||
|
|
||||||
Mapnik 0.7.2 Release
|
Mapnik 0.7.2 Release
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
- Added forward compatibility for Mapnik 2.0 XML syntax (https://trac.mapnik.org/wiki/Mapnik2/Changes)
|
- Added forward compatibility for Mapnik 2.0 XML syntax (https://trac.mapnik.org/wiki/Mapnik2/Changes)
|
||||||
|
|
||||||
- Build fixes to ensure boost_threads are not used unless THREADING=multi build option is used
|
- Build fixes to ensure boost_threads are not used unless THREADING=multi build option is used
|
||||||
|
@ -167,9 +168,9 @@ Mapnik 0.7.0 Release
|
||||||
|
|
||||||
* Use the gdaladdo utility to add overviews to existing GDAL datasets
|
* Use the gdaladdo utility to add overviews to existing GDAL datasets
|
||||||
|
|
||||||
- PostGIS: Added an optional 'geometry_table' parameter. The 'geometry_table' used by Mapnik to look up
|
- PostGIS: Added an optional 'geometry_table' parameter. The 'geometry_table' used by Mapnik to look up
|
||||||
metadata in the geometry_columns and calculate extents (when the 'geometry_field' and 'srid' parameters
|
metadata in the geometry_columns and calculate extents (when the 'geometry_field' and 'srid' parameters
|
||||||
are not supplied). If 'geometry_table' is not specified Mapnik will attempt to determine the name of the
|
are not supplied). If 'geometry_table' is not specified Mapnik will attempt to determine the name of the
|
||||||
table to query based on parsing the 'table' parameter, which may fail for complex queries with more than
|
table to query based on parsing the 'table' parameter, which may fail for complex queries with more than
|
||||||
one 'from' keyword. Using this parameter should allow for existing metadata and table indexes to be used
|
one 'from' keyword. Using this parameter should allow for existing metadata and table indexes to be used
|
||||||
while opening the door to much more complicated subqueries being passed to the 'table' parameter without
|
while opening the door to much more complicated subqueries being passed to the 'table' parameter without
|
||||||
|
@ -191,7 +192,7 @@ Mapnik 0.7.0 Release
|
||||||
query to be used by indexes. (#415)
|
query to be used by indexes. (#415)
|
||||||
|
|
||||||
* Pass the bbox token inside a subquery like: !bbox!
|
* Pass the bbox token inside a subquery like: !bbox!
|
||||||
|
|
||||||
* Valid Usages include:
|
* Valid Usages include:
|
||||||
|
|
||||||
<Parameter name="table">
|
<Parameter name="table">
|
||||||
|
@ -210,7 +211,7 @@ Mapnik 0.7.0 Release
|
||||||
|
|
||||||
- PostGIS Plugin: Added support for quoted table names (r1454) (#393)
|
- PostGIS Plugin: Added support for quoted table names (r1454) (#393)
|
||||||
|
|
||||||
- PostGIS: Add a 'persist_connection' option (default true), that when false will release
|
- PostGIS: Add a 'persist_connection' option (default true), that when false will release
|
||||||
the idle psql connection after datasource goes out of scope (r1337) (#433,#434)
|
the idle psql connection after datasource goes out of scope (r1337) (#433,#434)
|
||||||
|
|
||||||
- PostGIS: Added support for BigInt (int8) postgres type (384)
|
- PostGIS: Added support for BigInt (int8) postgres type (384)
|
||||||
|
@ -234,14 +235,14 @@ Mapnik 0.7.0 Release
|
||||||
- PolygonSymbolizer: Added 'gamma' attribute to allow for dilation of polygon edges - a solution
|
- PolygonSymbolizer: Added 'gamma' attribute to allow for dilation of polygon edges - a solution
|
||||||
to gap artifacts or "ghost lines" between adjacent polygons and allows for slight sharpening of
|
to gap artifacts or "ghost lines" between adjacent polygons and allows for slight sharpening of
|
||||||
the edges of non overlapping polygons. Accepts any values but 0-1 is the recommended range.
|
the edges of non overlapping polygons. Accepts any values but 0-1 is the recommended range.
|
||||||
|
|
||||||
- TextSymbolizer: Large set of new attributes: 'text_transform', 'line_spacing', 'character_spacing',
|
- TextSymbolizer: Large set of new attributes: 'text_transform', 'line_spacing', 'character_spacing',
|
||||||
'wrap_character', 'wrap_before', 'horizontal_alignment', 'justify_alignment', and 'opacity'.
|
'wrap_character', 'wrap_before', 'horizontal_alignment', 'justify_alignment', and 'opacity'.
|
||||||
|
|
||||||
* More details at changesets: r1254 and r1341
|
* More details at changesets: r1254 and r1341
|
||||||
|
|
||||||
- SheildSymbolizer: Added special new attributes: 'unlock_image', 'VERTEX' placement, 'no_text' and many
|
- SheildSymbolizer: Added special new attributes: 'unlock_image', 'VERTEX' placement, 'no_text' and many
|
||||||
attributes previously only supported in the TextSymbolizer: 'allow_overlap', 'vertical_alignment',
|
attributes previously only supported in the TextSymbolizer: 'allow_overlap', 'vertical_alignment',
|
||||||
'horizontal_alignment', 'justify_alignment', 'wrap_width', 'wrap_character', 'wrap_before', 'text_transform',
|
'horizontal_alignment', 'justify_alignment', 'wrap_width', 'wrap_character', 'wrap_before', 'text_transform',
|
||||||
'line_spacing', 'character_spacing', and 'opacity'.
|
'line_spacing', 'character_spacing', and 'opacity'.
|
||||||
|
|
||||||
|
@ -281,7 +282,7 @@ Mapnik 0.7.0 Release
|
||||||
|
|
||||||
- Python: Ensured mapnik::config_errors now throw RuntimeError exception instead of UserWarning exception (#442)
|
- Python: Ensured mapnik::config_errors now throw RuntimeError exception instead of UserWarning exception (#442)
|
||||||
|
|
||||||
- Filters: Added support for '!=' as an alias to '<>' for not-equals filters (avoids <>) (r1326) (#427)
|
- Filters: Added support for '!=' as an alias to '<>' for not-equals filters (avoids <>) (r1326) (#427)
|
||||||
|
|
||||||
- SCons: Improved boost auto-detection (r1255,r1279)
|
- SCons: Improved boost auto-detection (r1255,r1279)
|
||||||
|
|
||||||
|
@ -303,7 +304,7 @@ Mapnik 0.6.1 Release
|
||||||
|
|
||||||
(Packaged from r1247)
|
(Packaged from r1247)
|
||||||
|
|
||||||
- Plugins: expose list of registered plugins as a 'plugin_names()' method of DatasourceCache (r1180)
|
- Plugins: expose list of registered plugins as a 'plugin_names()' method of DatasourceCache (r1180)
|
||||||
|
|
||||||
- XML: Fixed serialization and parsing bugs related to handling of integers and Enums (#328,#353)
|
- XML: Fixed serialization and parsing bugs related to handling of integers and Enums (#328,#353)
|
||||||
|
|
||||||
|
|
59
SConstruct
59
SConstruct
|
@ -329,7 +329,7 @@ opts.AddVariables(
|
||||||
('BOOST_TOOLKIT','Specify boost toolkit, e.g., gcc41.','',False),
|
('BOOST_TOOLKIT','Specify boost toolkit, e.g., gcc41.','',False),
|
||||||
('BOOST_ABI', 'Specify boost ABI, e.g., d.','',False),
|
('BOOST_ABI', 'Specify boost ABI, e.g., d.','',False),
|
||||||
('BOOST_VERSION','Specify boost version, e.g., 1_35.','',False),
|
('BOOST_VERSION','Specify boost version, e.g., 1_35.','',False),
|
||||||
('BOOST_PYTHON_LIB','Specify library name or full path to boost_python lib (e.g. "boost_python-py26" or "/usr/lib/libboost_python.dylib")',''),
|
('BOOST_PYTHON_LIB','Specify library name to specific Boost Python lib (e.g. "boost_python-py26")',''),
|
||||||
|
|
||||||
# Variables for required dependencies
|
# Variables for required dependencies
|
||||||
('FREETYPE_CONFIG', 'The path to the freetype-config executable.', 'freetype-config'),
|
('FREETYPE_CONFIG', 'The path to the freetype-config executable.', 'freetype-config'),
|
||||||
|
@ -425,7 +425,6 @@ pickle_store = [# Scons internal variables
|
||||||
'PYTHON_INSTALL_LOCATION',
|
'PYTHON_INSTALL_LOCATION',
|
||||||
'PYTHON_SYS_PREFIX',
|
'PYTHON_SYS_PREFIX',
|
||||||
'COLOR_PRINT',
|
'COLOR_PRINT',
|
||||||
'HAS_BOOST_SYSTEM',
|
|
||||||
'SVN_REVISION',
|
'SVN_REVISION',
|
||||||
'HAS_CAIRO',
|
'HAS_CAIRO',
|
||||||
'HAS_PYCAIRO',
|
'HAS_PYCAIRO',
|
||||||
|
@ -451,6 +450,7 @@ pickle_store = [# Scons internal variables
|
||||||
'CAIROMM_LIBPATHS',
|
'CAIROMM_LIBPATHS',
|
||||||
'CAIROMM_LINKFLAGS',
|
'CAIROMM_LINKFLAGS',
|
||||||
'CAIROMM_CPPPATHS',
|
'CAIROMM_CPPPATHS',
|
||||||
|
'SVG_RENDERER',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add all other user configurable options to pickle pickle_store
|
# Add all other user configurable options to pickle pickle_store
|
||||||
|
@ -1070,15 +1070,17 @@ if not preconfigured:
|
||||||
env.AppendUnique(CPPPATH = os.path.realpath(inc_path))
|
env.AppendUnique(CPPPATH = os.path.realpath(inc_path))
|
||||||
env.AppendUnique(LIBPATH = os.path.realpath(lib_path))
|
env.AppendUnique(LIBPATH = os.path.realpath(lib_path))
|
||||||
|
|
||||||
conf.parse_config('FREETYPE_CONFIG')
|
if conf.parse_config('FREETYPE_CONFIG'):
|
||||||
|
# check if freetype links to bz2
|
||||||
# check if freetype links to bz2
|
if env['RUNTIME_LINK'] == 'static':
|
||||||
if env['RUNTIME_LINK'] == 'static':
|
temp_env = env.Clone()
|
||||||
temp_env = env.Clone()
|
temp_env['LIBS'] = []
|
||||||
temp_env['LIBS'] = []
|
try:
|
||||||
temp_env.ParseConfig('%s --libs' % env['FREETYPE_CONFIG'])
|
temp_env.ParseConfig('%s --libs' % env['FREETYPE_CONFIG'])
|
||||||
if 'bz2' in temp_env['LIBS']:
|
if 'bz2' in temp_env['LIBS']:
|
||||||
env['EXTRA_FREETYPE_LIBS'].append('bz2')
|
env['EXTRA_FREETYPE_LIBS'].append('bz2')
|
||||||
|
except OSError,e:
|
||||||
|
pass
|
||||||
|
|
||||||
# libxml2 should be optional but is currently not
|
# libxml2 should be optional but is currently not
|
||||||
# https://github.com/mapnik/mapnik/issues/913
|
# https://github.com/mapnik/mapnik/issues/913
|
||||||
|
@ -1105,14 +1107,14 @@ if not preconfigured:
|
||||||
if env['PRIORITIZE_LINKING']:
|
if env['PRIORITIZE_LINKING']:
|
||||||
conf.prioritize_paths(silent=False)
|
conf.prioritize_paths(silent=False)
|
||||||
|
|
||||||
for libinfo in LIBSHEADERS:
|
for libname, headers, required, lang in LIBSHEADERS:
|
||||||
if not conf.CheckLibWithHeader(libinfo[0], libinfo[1], libinfo[3]):
|
if not conf.CheckLibWithHeader(libname, headers, lang):
|
||||||
if libinfo[2]:
|
if required:
|
||||||
color_print(1,'Could not find required header or shared library for %s' % libinfo[0])
|
color_print(1, 'Could not find required header or shared library for %s' % libname)
|
||||||
env['MISSING_DEPS'].append(libinfo[0])
|
env['MISSING_DEPS'].append(libname)
|
||||||
else:
|
else:
|
||||||
color_print(4,'Could not find optional header or shared library for %s' % libinfo[0])
|
color_print(4, 'Could not find optional header or shared library for %s' % libname)
|
||||||
env['SKIPPED_DEPS'].append(libinfo[0])
|
env['SKIPPED_DEPS'].append(libname)
|
||||||
|
|
||||||
if env['ICU_LIB_NAME'] not in env['MISSING_DEPS']:
|
if env['ICU_LIB_NAME'] not in env['MISSING_DEPS']:
|
||||||
if not conf.icu_at_least_four_two():
|
if not conf.icu_at_least_four_two():
|
||||||
|
@ -1126,18 +1128,14 @@ if not preconfigured:
|
||||||
|
|
||||||
conf.FindBoost(BOOST_SEARCH_PREFIXES,thread_flag)
|
conf.FindBoost(BOOST_SEARCH_PREFIXES,thread_flag)
|
||||||
|
|
||||||
# boost system is used in boost 1.35 and greater
|
|
||||||
env['HAS_BOOST_SYSTEM'] = False
|
|
||||||
boost_lib_version_from_header = conf.GetBoostLibVersion()
|
boost_lib_version_from_header = conf.GetBoostLibVersion()
|
||||||
if boost_lib_version_from_header:
|
if boost_lib_version_from_header:
|
||||||
boost_version_from_header = int(boost_lib_version_from_header.split('_')[1])
|
boost_version_from_header = int(boost_lib_version_from_header.split('_')[1])
|
||||||
if boost_version_from_header >= 35:
|
|
||||||
env['HAS_BOOST_SYSTEM'] = True
|
|
||||||
|
|
||||||
|
|
||||||
# The other required boost headers.
|
# The other required boost headers.
|
||||||
BOOST_LIBSHEADERS = [
|
BOOST_LIBSHEADERS = [
|
||||||
['system', 'boost/system/system_error.hpp', env['HAS_BOOST_SYSTEM']],
|
['system', 'boost/system/system_error.hpp', True],
|
||||||
['filesystem', 'boost/filesystem/operations.hpp', True],
|
['filesystem', 'boost/filesystem/operations.hpp', True],
|
||||||
['regex', 'boost/regex.hpp', True],
|
['regex', 'boost/regex.hpp', True],
|
||||||
['program_options', 'boost/program_options.hpp', False]
|
['program_options', 'boost/program_options.hpp', False]
|
||||||
|
@ -1331,7 +1329,7 @@ if not preconfigured:
|
||||||
if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'):
|
if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'):
|
||||||
color_print(1,'Could not find required header files for boost python')
|
color_print(1,'Could not find required header files for boost python')
|
||||||
env['MISSING_DEPS'].append('boost python')
|
env['MISSING_DEPS'].append('boost python')
|
||||||
|
|
||||||
if env['CAIRO']:
|
if env['CAIRO']:
|
||||||
if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'):
|
if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'):
|
||||||
env['HAS_PYCAIRO'] = True
|
env['HAS_PYCAIRO'] = True
|
||||||
|
@ -1502,14 +1500,23 @@ if not preconfigured:
|
||||||
if not conf.CheckHeader(header='Python.h',language='C'):
|
if not conf.CheckHeader(header='Python.h',language='C'):
|
||||||
color_print(1,'Could not find required header files for the Python language (version %s)' % env['PYTHON_VERSION'])
|
color_print(1,'Could not find required header files for the Python language (version %s)' % env['PYTHON_VERSION'])
|
||||||
env.Replace(**backup)
|
env.Replace(**backup)
|
||||||
env['MISSING_DEPS'].append('python %s development headers' % env['PYTHON_VERSION'])
|
Exit(1)
|
||||||
else:
|
else:
|
||||||
env.Replace(**backup)
|
env.Replace(**backup)
|
||||||
|
|
||||||
if (int(majver), int(minver)) < (2, 2):
|
if (int(majver), int(minver)) < (2, 2):
|
||||||
color_print(1,"Python version 2.2 or greater required")
|
color_print(1,"Python version 2.2 or greater required")
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
|
if env['BOOST_PYTHON_LIB']:
|
||||||
|
env.Append(LIBS='python%s' % env['PYTHON_VERSION'])
|
||||||
|
if not conf.CheckLibWithHeader(libs=[env['BOOST_PYTHON_LIB']], header='boost/python/detail/config.hpp', language='C++'):
|
||||||
|
color_print(1, 'Could not find library %s for boost python' % env['BOOST_PYTHON_LIB'])
|
||||||
|
env.Replace(**backup)
|
||||||
|
Exit(1)
|
||||||
|
else:
|
||||||
|
env.Replace(**backup)
|
||||||
|
|
||||||
color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION'])
|
color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION'])
|
||||||
color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX']))
|
color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX']))
|
||||||
color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION']))
|
color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION']))
|
||||||
|
|
|
@ -48,13 +48,7 @@ if env['JPEG']:
|
||||||
libraries.append('jpeg')
|
libraries.append('jpeg')
|
||||||
|
|
||||||
if env['BOOST_PYTHON_LIB']:
|
if env['BOOST_PYTHON_LIB']:
|
||||||
if os.path.sep in env['BOOST_PYTHON_LIB']:
|
libraries.append(env['BOOST_PYTHON_LIB'])
|
||||||
pylib_dir = os.path.dirname(env['BOOST_PYTHON_LIB'])
|
|
||||||
env.Prepend(LIBPATH = pylib_dir)
|
|
||||||
pylib_name = os.path.splitext(os.path.basename(env['BOOST_PYTHON_LIB']))[0].replace('lib','',1)
|
|
||||||
libraries.append(pylib_name)
|
|
||||||
else:
|
|
||||||
libraries.append(env['BOOST_PYTHON_LIB'].replace('lib','',1))
|
|
||||||
else:
|
else:
|
||||||
if is_py3():
|
if is_py3():
|
||||||
libraries.append('boost_python3%s' % env['BOOST_APPEND'])
|
libraries.append('boost_python3%s' % env['BOOST_APPEND'])
|
||||||
|
|
|
@ -410,6 +410,13 @@ def Raster(**keywords):
|
||||||
|
|
||||||
Optional keyword arguments:
|
Optional keyword arguments:
|
||||||
base -- path prefix (default None)
|
base -- path prefix (default None)
|
||||||
|
multi -- whether the image is in tiles on disk (default False)
|
||||||
|
|
||||||
|
Multi-tiled keyword arguments:
|
||||||
|
x_width -- virtual image number of tiles in X direction (required)
|
||||||
|
y_width -- virtual image number of tiles in Y direction (required)
|
||||||
|
tile_size -- if an image is in tiles, how large are the tiles (default 256)
|
||||||
|
tile_stride -- if an image is in tiles, what's the increment between rows/cols (default 1)
|
||||||
|
|
||||||
>>> from mapnik import Raster, Layer
|
>>> from mapnik import Raster, Layer
|
||||||
>>> raster = Raster(base='/home/mapnik/data',file='elevation.tif',lox=-122.8,loy=48.5,hix=-122.7,hiy=48.6)
|
>>> raster = Raster(base='/home/mapnik/data',file='elevation.tif',lox=-122.8,loy=48.5,hix=-122.7,hiy=48.6)
|
||||||
|
@ -478,10 +485,11 @@ def Ogr(**keywords):
|
||||||
|
|
||||||
Required keyword arguments:
|
Required keyword arguments:
|
||||||
file -- path to OGR supported dataset
|
file -- path to OGR supported dataset
|
||||||
layer -- name of layer to use within datasource (optional if layer_by_index is used)
|
layer -- name of layer to use within datasource (optional if layer_by_index or layer_by_sql is used)
|
||||||
|
|
||||||
Optional keyword arguments:
|
Optional keyword arguments:
|
||||||
layer_by_index -- choose layer by index number instead of by layer name.
|
layer_by_index -- choose layer by index number instead of by layer name or sql.
|
||||||
|
layer_by_sql -- choose layer by sql query number instead of by layer name or index.
|
||||||
base -- path prefix (default None)
|
base -- path prefix (default None)
|
||||||
encoding -- file encoding (default 'utf-8')
|
encoding -- file encoding (default 'utf-8')
|
||||||
multiple_geometries -- boolean, direct the Mapnik wkb reader to interpret as multigeometries (default False)
|
multiple_geometries -- boolean, direct the Mapnik wkb reader to interpret as multigeometries (default False)
|
||||||
|
|
|
@ -15,6 +15,7 @@ page.render_map(m,"my_output_file.pdf")
|
||||||
see the documentation of mapnik2.printing.PDFPrinter() for options
|
see the documentation of mapnik2.printing.PDFPrinter() for options
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from . import render, Map, Box2d, MemoryDatasource, Layer, Feature, Projection, ProjTransform, Coord, Style, Rule, Geometry2d
|
from . import render, Map, Box2d, MemoryDatasource, Layer, Feature, Projection, ProjTransform, Coord, Style, Rule, Geometry2d
|
||||||
import math
|
import math
|
||||||
|
|
|
@ -78,7 +78,6 @@ void export_geometry()
|
||||||
.def("envelope",&geometry_type::envelope)
|
.def("envelope",&geometry_type::envelope)
|
||||||
// .def("__str__",&geometry_type::to_string)
|
// .def("__str__",&geometry_type::to_string)
|
||||||
.def("type",&geometry_type::type)
|
.def("type",&geometry_type::type)
|
||||||
.def("area",&geometry_type::area)
|
|
||||||
// TODO add other geometry_type methods
|
// TODO add other geometry_type methods
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
123
bindings/python/mapnik_label_collision_detector.cpp
Normal file
123
bindings/python/mapnik_label_collision_detector.cpp
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
/*****************************************************************************
|
||||||
|
*
|
||||||
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 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 <boost/python.hpp>
|
||||||
|
#include <boost/python/module.hpp>
|
||||||
|
#include <boost/python/def.hpp>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
|
#include <mapnik/label_collision_detector.hpp>
|
||||||
|
#include <mapnik/map.hpp>
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
using mapnik::label_collision_detector4;
|
||||||
|
using mapnik::box2d;
|
||||||
|
using mapnik::Map;
|
||||||
|
using boost::make_shared;
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
|
boost::shared_ptr<label_collision_detector4>
|
||||||
|
create_label_collision_detector_from_extent(box2d<double> const &extent)
|
||||||
|
{
|
||||||
|
return make_shared<label_collision_detector4>(extent);
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::shared_ptr<label_collision_detector4>
|
||||||
|
create_label_collision_detector_from_map(Map const &m)
|
||||||
|
{
|
||||||
|
double buffer = m.buffer_size();
|
||||||
|
box2d<double> extent(-buffer, -buffer, m.width() + buffer, m.height() + buffer);
|
||||||
|
return make_shared<label_collision_detector4>(extent);
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::python::list
|
||||||
|
make_label_boxes(boost::shared_ptr<label_collision_detector4> det)
|
||||||
|
{
|
||||||
|
boost::python::list boxes;
|
||||||
|
|
||||||
|
for (label_collision_detector4::query_iterator jtr = det->begin();
|
||||||
|
jtr != det->end(); ++jtr)
|
||||||
|
{
|
||||||
|
boxes.append<box2d<double> >(jtr->box);
|
||||||
|
}
|
||||||
|
|
||||||
|
return boxes;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void export_label_collision_detector()
|
||||||
|
{
|
||||||
|
using namespace boost::python;
|
||||||
|
|
||||||
|
// for overload resolution
|
||||||
|
void (label_collision_detector4::*insert_box)(box2d<double> const &) = &label_collision_detector4::insert;
|
||||||
|
|
||||||
|
class_<label_collision_detector4, boost::shared_ptr<label_collision_detector4>, boost::noncopyable>
|
||||||
|
("LabelCollisionDetector",
|
||||||
|
"Object to detect collisions between labels, used in the rendering process.",
|
||||||
|
no_init)
|
||||||
|
|
||||||
|
.def("__init__", make_constructor(create_label_collision_detector_from_extent),
|
||||||
|
"Creates an empty collision detection object with a given extent. Note "
|
||||||
|
"that the constructor from Map objects is a sensible default and usually "
|
||||||
|
"what you want to do.\n"
|
||||||
|
"\n"
|
||||||
|
"Example:\n"
|
||||||
|
">>> m = Map(size_x, size_y)\n"
|
||||||
|
">>> buf_sz = m.buffer_size\n"
|
||||||
|
">>> extent = mapnik.Box2d(-buf_sz, -buf_sz, m.width + buf_sz, m.height + buf_sz)\n"
|
||||||
|
">>> detector = mapnik.LabelCollisionDetector(extent)")
|
||||||
|
|
||||||
|
.def("__init__", make_constructor(create_label_collision_detector_from_map),
|
||||||
|
"Creates an empty collision detection object matching the given Map object. "
|
||||||
|
"The created detector will have the same size, including the buffer, as the "
|
||||||
|
"map object. This is usually what you want to do.\n"
|
||||||
|
"\n"
|
||||||
|
"Example:\n"
|
||||||
|
">>> m = Map(size_x, size_y)\n"
|
||||||
|
">>> detector = mapnik.LabelCollisionDetector(m)")
|
||||||
|
|
||||||
|
.def("extent", &label_collision_detector4::extent, return_value_policy<copy_const_reference>(),
|
||||||
|
"Returns the total extent (bounding box) of all labels inside the detector.\n"
|
||||||
|
"\n"
|
||||||
|
"Example:\n"
|
||||||
|
">>> detector.extent()\n"
|
||||||
|
"Box2d(573.252589209,494.789179821,584.261023823,496.83610261)")
|
||||||
|
|
||||||
|
.def("boxes", &make_label_boxes,
|
||||||
|
"Returns a list of all the label boxes inside the detector.")
|
||||||
|
|
||||||
|
.def("insert", insert_box,
|
||||||
|
"Insert a 2d box into the collision detector. This can be used to ensure that "
|
||||||
|
"some space is left clear on the map for later overdrawing, for example by "
|
||||||
|
"non-Mapnik processes.\n"
|
||||||
|
"\n"
|
||||||
|
"Example:\n"
|
||||||
|
">>> m = Map(size_x, size_y)\n"
|
||||||
|
">>> detector = mapnik.LabelCollisionDetector(m)"
|
||||||
|
">>> detector.insert(mapnik.Box2d(196, 254, 291, 389))")
|
||||||
|
;
|
||||||
|
}
|
|
@ -66,6 +66,7 @@ void export_view_transform();
|
||||||
void export_raster_colorizer();
|
void export_raster_colorizer();
|
||||||
void export_glyph_symbolizer();
|
void export_glyph_symbolizer();
|
||||||
void export_inmem_metawriter();
|
void export_inmem_metawriter();
|
||||||
|
void export_label_collision_detector();
|
||||||
|
|
||||||
#include <mapnik/version.hpp>
|
#include <mapnik/version.hpp>
|
||||||
#include <mapnik/value_error.hpp>
|
#include <mapnik/value_error.hpp>
|
||||||
|
@ -120,6 +121,28 @@ void render(const mapnik::Map& map,
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void render_with_detector(
|
||||||
|
const mapnik::Map &map,
|
||||||
|
mapnik::image_32 &image,
|
||||||
|
boost::shared_ptr<mapnik::label_collision_detector4> detector,
|
||||||
|
double scale_factor = 1.0,
|
||||||
|
unsigned offset_x = 0u,
|
||||||
|
unsigned offset_y = 0u)
|
||||||
|
{
|
||||||
|
Py_BEGIN_ALLOW_THREADS
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mapnik::agg_renderer<mapnik::image_32> ren(map,image,detector);
|
||||||
|
ren.apply();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
Py_BLOCK_THREADS
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
Py_END_ALLOW_THREADS
|
||||||
|
}
|
||||||
|
|
||||||
void render_layer2(const mapnik::Map& map,
|
void render_layer2(const mapnik::Map& map,
|
||||||
mapnik::image_32& image,
|
mapnik::image_32& image,
|
||||||
unsigned layer_idx)
|
unsigned layer_idx)
|
||||||
|
@ -374,6 +397,7 @@ BOOST_PYTHON_FUNCTION_OVERLOADS(load_map_string_overloads, load_map_string, 2, 4
|
||||||
BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_overloads, save_map, 2, 3)
|
BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_overloads, save_map, 2, 3)
|
||||||
BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_to_string_overloads, save_map_to_string, 1, 2)
|
BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_to_string_overloads, save_map_to_string, 1, 2)
|
||||||
BOOST_PYTHON_FUNCTION_OVERLOADS(render_overloads, render, 2, 5)
|
BOOST_PYTHON_FUNCTION_OVERLOADS(render_overloads, render, 2, 5)
|
||||||
|
BOOST_PYTHON_FUNCTION_OVERLOADS(render_with_detector_overloads, render_with_detector, 3, 6)
|
||||||
|
|
||||||
BOOST_PYTHON_MODULE(_mapnik2)
|
BOOST_PYTHON_MODULE(_mapnik2)
|
||||||
{
|
{
|
||||||
|
@ -427,6 +451,7 @@ BOOST_PYTHON_MODULE(_mapnik2)
|
||||||
export_raster_colorizer();
|
export_raster_colorizer();
|
||||||
export_glyph_symbolizer();
|
export_glyph_symbolizer();
|
||||||
export_inmem_metawriter();
|
export_inmem_metawriter();
|
||||||
|
export_label_collision_detector();
|
||||||
|
|
||||||
def("render_grid",&render_grid,
|
def("render_grid",&render_grid,
|
||||||
( arg("map"),
|
( arg("map"),
|
||||||
|
@ -503,6 +528,19 @@ BOOST_PYTHON_MODULE(_mapnik2)
|
||||||
"\n"
|
"\n"
|
||||||
));
|
));
|
||||||
|
|
||||||
|
def("render_with_detector", &render_with_detector, render_with_detector_overloads(
|
||||||
|
"\n"
|
||||||
|
"Render Map to an AGG image_32 using a pre-constructed detector.\n"
|
||||||
|
"\n"
|
||||||
|
"Usage:\n"
|
||||||
|
">>> from mapnik import Map, Image, LabelCollisionDetector, render_with_detector, load_map\n"
|
||||||
|
">>> m = Map(256,256)\n"
|
||||||
|
">>> load_map(m,'mapfile.xml')\n"
|
||||||
|
">>> im = Image(m.width,m.height)\n"
|
||||||
|
">>> detector = LabelCollisionDetector(m)\n"
|
||||||
|
">>> render_with_detector(m, im, detector)\n"
|
||||||
|
));
|
||||||
|
|
||||||
def("render_layer", &render_layer2,
|
def("render_layer", &render_layer2,
|
||||||
(arg("map"),arg("image"),args("layer"))
|
(arg("map"),arg("image"),args("layer"))
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -35,6 +36,6 @@ info_dialog::info_dialog(QVector<QPair<QString,QString> > const& info, QWidget *
|
||||||
QTableWidgetItem *keyItem = new QTableWidgetItem(info[i].first);
|
QTableWidgetItem *keyItem = new QTableWidgetItem(info[i].first);
|
||||||
QTableWidgetItem *valueItem = new QTableWidgetItem(info[i].second);
|
QTableWidgetItem *valueItem = new QTableWidgetItem(info[i].second);
|
||||||
ui.tableWidget->setItem(i,0,keyItem);
|
ui.tableWidget->setItem(i,0,keyItem);
|
||||||
ui.tableWidget->setItem(i,1,valueItem);
|
ui.tableWidget->setItem(i,1,valueItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -28,15 +29,15 @@ layer_info_dialog::layer_info_dialog(mapnik::layer& lay, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
ui.tableWidget->setHorizontalHeaderItem(0,new QTableWidgetItem("Name"));
|
ui.tableWidget->setHorizontalHeaderItem(0,new QTableWidgetItem("Name"));
|
||||||
ui.tableWidget->setHorizontalHeaderItem(1,new QTableWidgetItem("Value"));
|
ui.tableWidget->setHorizontalHeaderItem(1,new QTableWidgetItem("Value"));
|
||||||
|
|
||||||
// Layer name
|
// Layer name
|
||||||
ui.layerNameEdit->setText(QString(lay.name().c_str()));
|
ui.layerNameEdit->setText(QString(lay.name().c_str()));
|
||||||
|
|
||||||
// Named Styles : TODO!!!
|
// Named Styles : TODO!!!
|
||||||
|
|
||||||
// Datasource
|
// Datasource
|
||||||
mapnik::datasource_ptr ds = lay.datasource();
|
mapnik::datasource_ptr ds = lay.datasource();
|
||||||
if (ds)
|
if (ds)
|
||||||
|
@ -57,10 +58,10 @@ layer_info_dialog::layer_info_dialog(mapnik::layer& lay, QWidget *parent)
|
||||||
QTableWidgetItem *keyItem = new QTableWidgetItem(QString(pos->first.c_str()));
|
QTableWidgetItem *keyItem = new QTableWidgetItem(QString(pos->first.c_str()));
|
||||||
QTableWidgetItem *valueItem = new QTableWidgetItem(QString((*result).c_str()));
|
QTableWidgetItem *valueItem = new QTableWidgetItem(QString((*result).c_str()));
|
||||||
ui.tableWidget->setItem(index,0,keyItem);
|
ui.tableWidget->setItem(index,0,keyItem);
|
||||||
ui.tableWidget->setItem(index,1,valueItem);
|
ui.tableWidget->setItem(index,1,valueItem);
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -37,7 +38,7 @@ void LayerDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||||
else
|
else
|
||||||
painter->setBrush(QBrush(QColor(255, 0, 0, 64)));
|
painter->setBrush(QBrush(QColor(255, 0, 0, 64)));
|
||||||
|
|
||||||
|
|
||||||
painter->drawRoundRect(option.rect,4,4);
|
painter->drawRoundRect(option.rect,4,4);
|
||||||
|
|
||||||
if (option.state & QStyle::State_Selected)
|
if (option.state & QStyle::State_Selected)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -32,11 +33,11 @@ class QPainter;
|
||||||
class LayerDelegate : public QAbstractItemDelegate
|
class LayerDelegate : public QAbstractItemDelegate
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LayerDelegate(QObject *parent = 0);
|
LayerDelegate(QObject *parent = 0);
|
||||||
void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const;
|
const QModelIndex &index) const;
|
||||||
QSize sizeHint(const QStyleOptionViewItem &option,
|
QSize sizeHint(const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index ) const;
|
const QModelIndex &index ) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -61,7 +62,7 @@ QVariant LayerListModel::data(QModelIndex const& index,int role) const
|
||||||
{
|
{
|
||||||
if (map_->layers().at(index.row()).isActive())
|
if (map_->layers().at(index.row()).isActive())
|
||||||
return QVariant(Qt::Checked);
|
return QVariant(Qt::Checked);
|
||||||
else
|
else
|
||||||
return QVariant(Qt::Unchecked);
|
return QVariant(Qt::Unchecked);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -75,7 +76,7 @@ QVariant LayerListModel::headerData(int section, Qt::Orientation orientation,
|
||||||
{
|
{
|
||||||
if (role != Qt::DisplayRole)
|
if (role != Qt::DisplayRole)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
if (orientation == Qt::Horizontal)
|
if (orientation == Qt::Horizontal)
|
||||||
return QString("TODO Column %1").arg(section);
|
return QString("TODO Column %1").arg(section);
|
||||||
else
|
else
|
||||||
|
@ -86,22 +87,22 @@ bool LayerListModel::setData(const QModelIndex &index,
|
||||||
const QVariant &value, int role)
|
const QVariant &value, int role)
|
||||||
{
|
{
|
||||||
if (!map_) return false;
|
if (!map_) return false;
|
||||||
|
|
||||||
if (index.isValid() && role == Qt::CheckStateRole)
|
if (index.isValid() && role == Qt::CheckStateRole)
|
||||||
{
|
{
|
||||||
int status = value.toInt();
|
int status = value.toInt();
|
||||||
std::vector<mapnik::layer> & layers = const_cast<std::vector<mapnik::layer>& >(map_->layers());
|
std::vector<mapnik::layer> & layers = const_cast<std::vector<mapnik::layer>& >(map_->layers());
|
||||||
layers.at(index.row()).setActive(status);
|
layers.at(index.row()).setActive(status);
|
||||||
emit dataChanged(index, index);
|
emit dataChanged(index, index);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags LayerListModel::flags(QModelIndex const& index) const
|
Qt::ItemFlags LayerListModel::flags(QModelIndex const& index) const
|
||||||
{
|
{
|
||||||
Qt::ItemFlags flags = QAbstractItemModel::flags(index);
|
Qt::ItemFlags flags = QAbstractItemModel::flags(index);
|
||||||
|
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
flags |= Qt::ItemIsUserCheckable;
|
flags |= Qt::ItemIsUserCheckable;
|
||||||
return flags;
|
return flags;
|
||||||
|
@ -121,4 +122,4 @@ boost::optional<mapnik::layer&> LayerListModel::map_layer(int i)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -36,10 +37,10 @@ class LayerListModel : public QAbstractListModel
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation,
|
QVariant headerData(int section, Qt::Orientation orientation,
|
||||||
int role = Qt::DisplayRole) const;
|
int role = Qt::DisplayRole) const;
|
||||||
bool setData(const QModelIndex &index, const QVariant &value,
|
bool setData(const QModelIndex &index, const QVariant &value,
|
||||||
int role = Qt::EditRole);
|
int role = Qt::EditRole);
|
||||||
Qt::ItemFlags flags(QModelIndex const& index) const;
|
Qt::ItemFlags flags(QModelIndex const& index) const;
|
||||||
boost::optional<mapnik::layer&> map_layer(int i);
|
boost::optional<mapnik::layer&> map_layer(int i);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -41,7 +42,7 @@ LayerTab::LayerTab(QWidget* parent)
|
||||||
|
|
||||||
void LayerTab::paintEvent(QPaintEvent *e)
|
void LayerTab::paintEvent(QPaintEvent *e)
|
||||||
{
|
{
|
||||||
QListView::paintEvent(e);
|
QListView::paintEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerTab::dataChanged(const QModelIndex &topLeft,
|
void LayerTab::dataChanged(const QModelIndex &topLeft,
|
||||||
|
@ -55,7 +56,7 @@ void LayerTab::dataChanged(const QModelIndex &topLeft,
|
||||||
void LayerTab::selectionChanged(const QItemSelection & selected, const QItemSelection &)
|
void LayerTab::selectionChanged(const QItemSelection & selected, const QItemSelection &)
|
||||||
{
|
{
|
||||||
QModelIndexList list = selected.indexes();
|
QModelIndexList list = selected.indexes();
|
||||||
if (list.size() != 0)
|
if (list.size() != 0)
|
||||||
{
|
{
|
||||||
std::cout << "SELECTED LAYER ->" << list[0].row() << "\n";
|
std::cout << "SELECTED LAYER ->" << list[0].row() << "\n";
|
||||||
emit layerSelected(list[0].row());
|
emit layerSelected(list[0].row());
|
||||||
|
@ -69,7 +70,7 @@ void LayerTab::layerInfo()
|
||||||
if (indexes.size() > 0)
|
if (indexes.size() > 0)
|
||||||
{
|
{
|
||||||
qDebug("id = %d",indexes[0].row());
|
qDebug("id = %d",indexes[0].row());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +82,7 @@ void LayerTab::layerInfo2(QModelIndex const& index)
|
||||||
unsigned i = index.row();
|
unsigned i = index.row();
|
||||||
LayerListModel * model = static_cast<LayerListModel*>(this->model());
|
LayerListModel * model = static_cast<LayerListModel*>(this->model());
|
||||||
boost::optional<mapnik::layer&> layer = model->map_layer(i);
|
boost::optional<mapnik::layer&> layer = model->map_layer(i);
|
||||||
|
|
||||||
if (layer)
|
if (layer)
|
||||||
{
|
{
|
||||||
layer_info_dialog dlg(*layer,this);
|
layer_info_dialog dlg(*layer,this);
|
||||||
|
@ -91,7 +92,7 @@ void LayerTab::layerInfo2(QModelIndex const& index)
|
||||||
|
|
||||||
StyleTab::StyleTab(QWidget*)
|
StyleTab::StyleTab(QWidget*)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StyleTab::contextMenuEvent(QContextMenuEvent * event )
|
void StyleTab::contextMenuEvent(QContextMenuEvent * event )
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -33,10 +34,10 @@ class LayerTab : public QListView
|
||||||
void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e);
|
||||||
signals:
|
signals:
|
||||||
void update_mapwidget();
|
void update_mapwidget();
|
||||||
void layerSelected(int) const;
|
void layerSelected(int) const;
|
||||||
public slots:
|
public slots:
|
||||||
void layerInfo();
|
void layerInfo();
|
||||||
void layerInfo2(QModelIndex const&);
|
void layerInfo2(QModelIndex const&);
|
||||||
protected slots:
|
protected slots:
|
||||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
||||||
void selectionChanged(const QItemSelection & selected, const QItemSelection &);
|
void selectionChanged(const QItemSelection & selected, const QItemSelection &);
|
||||||
|
@ -51,4 +52,4 @@ protected:
|
||||||
void contextMenuEvent(QContextMenuEvent * event );
|
void contextMenuEvent(QContextMenuEvent * event );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -34,13 +35,13 @@ int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
using mapnik::datasource_cache;
|
using mapnik::datasource_cache;
|
||||||
using mapnik::freetype_engine;
|
using mapnik::freetype_engine;
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName("Mapnik");
|
QCoreApplication::setOrganizationName("Mapnik");
|
||||||
QCoreApplication::setOrganizationDomain("mapnik.org");
|
QCoreApplication::setOrganizationDomain("mapnik.org");
|
||||||
QCoreApplication::setApplicationName("Viewer");
|
QCoreApplication::setApplicationName("Viewer");
|
||||||
|
|
||||||
QSettings settings("viewer.ini",QSettings::IniFormat);
|
QSettings settings("viewer.ini",QSettings::IniFormat);
|
||||||
|
|
||||||
// register input plug-ins
|
// register input plug-ins
|
||||||
QString plugins_dir = settings.value("mapnik/plugins_dir",
|
QString plugins_dir = settings.value("mapnik/plugins_dir",
|
||||||
QVariant("/usr/local/lib/mapnik2/input/")).toString();
|
QVariant("/usr/local/lib/mapnik2/input/")).toString();
|
||||||
|
@ -54,8 +55,8 @@ int main( int argc, char **argv )
|
||||||
freetype_engine::register_fonts(font_dir.toStdString());
|
freetype_engine::register_fonts(font_dir.toStdString());
|
||||||
}
|
}
|
||||||
settings.endArray();
|
settings.endArray();
|
||||||
|
|
||||||
QApplication app( argc, argv );
|
QApplication app( argc, argv );
|
||||||
MainWindow window;
|
MainWindow window;
|
||||||
window.show();
|
window.show();
|
||||||
if (argc > 1) window.open(argv[1]);
|
if (argc > 1) window.open(argv[1]);
|
||||||
|
@ -82,5 +83,5 @@ int main( int argc, char **argv )
|
||||||
double scaling_factor = QString(argv[3]).toDouble(&ok);
|
double scaling_factor = QString(argv[3]).toDouble(&ok);
|
||||||
if (ok) window.set_scaling_factor(scaling_factor);
|
if (ok) window.set_scaling_factor(scaling_factor);
|
||||||
}
|
}
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -47,42 +48,42 @@
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
: filename_(),
|
: filename_(),
|
||||||
default_extent_(-20037508.3428,-20037508.3428,20037508.3428,20037508.3428)
|
default_extent_(-20037508.3428,-20037508.3428,20037508.3428,20037508.3428)
|
||||||
{
|
{
|
||||||
mapWidget_ = new MapWidget(this);
|
mapWidget_ = new MapWidget(this);
|
||||||
QSplitter *splitter = new QSplitter(this);
|
QSplitter *splitter = new QSplitter(this);
|
||||||
QTabWidget *tabWidget=new QTabWidget;
|
QTabWidget *tabWidget=new QTabWidget;
|
||||||
layerTab_ = new LayerTab;
|
layerTab_ = new LayerTab;
|
||||||
layerTab_->setFocusPolicy(Qt::NoFocus);
|
layerTab_->setFocusPolicy(Qt::NoFocus);
|
||||||
layerTab_->setIconSize(QSize(16,16));
|
layerTab_->setIconSize(QSize(16,16));
|
||||||
|
|
||||||
//LayerDelegate *delegate = new LayerDelegate(this);
|
//LayerDelegate *delegate = new LayerDelegate(this);
|
||||||
//layerTab_->setItemDelegate(delegate);
|
//layerTab_->setItemDelegate(delegate);
|
||||||
//layerTab_->setItemDelegate(new QItemDelegate(this));
|
//layerTab_->setItemDelegate(new QItemDelegate(this));
|
||||||
//layerTab_->setViewMode(QListView::IconMode);
|
//layerTab_->setViewMode(QListView::IconMode);
|
||||||
|
|
||||||
layerTab_->setFlow(QListView::TopToBottom);
|
layerTab_->setFlow(QListView::TopToBottom);
|
||||||
tabWidget->addTab(layerTab_,tr("Layers"));
|
tabWidget->addTab(layerTab_,tr("Layers"));
|
||||||
|
|
||||||
// Styles tab
|
// Styles tab
|
||||||
styleTab_ = new StyleTab;
|
styleTab_ = new StyleTab;
|
||||||
tabWidget->addTab(styleTab_,tr("Styles"));
|
tabWidget->addTab(styleTab_,tr("Styles"));
|
||||||
splitter->addWidget(tabWidget);
|
splitter->addWidget(tabWidget);
|
||||||
splitter->addWidget(mapWidget_);
|
splitter->addWidget(mapWidget_);
|
||||||
QList<int> list;
|
QList<int> list;
|
||||||
list.push_back(200);
|
list.push_back(200);
|
||||||
list.push_back(600);
|
list.push_back(600);
|
||||||
splitter->setSizes(list);
|
splitter->setSizes(list);
|
||||||
|
|
||||||
mapWidget_->setFocusPolicy(Qt::StrongFocus);
|
mapWidget_->setFocusPolicy(Qt::StrongFocus);
|
||||||
mapWidget_->setFocus();
|
mapWidget_->setFocus();
|
||||||
|
|
||||||
//setCentralWidget(mapWidget_);
|
//setCentralWidget(mapWidget_);
|
||||||
setCentralWidget(splitter);
|
setCentralWidget(splitter);
|
||||||
createActions();
|
createActions();
|
||||||
createMenus();
|
createMenus();
|
||||||
createToolBars();
|
createToolBars();
|
||||||
createContextMenu();
|
createContextMenu();
|
||||||
|
|
||||||
setWindowTitle(tr("Mapnik Viewer"));
|
setWindowTitle(tr("Mapnik Viewer"));
|
||||||
status=new QStatusBar(this);
|
status=new QStatusBar(this);
|
||||||
status->showMessage(tr(""));
|
status->showMessage(tr(""));
|
||||||
|
@ -91,11 +92,11 @@ MainWindow::MainWindow()
|
||||||
|
|
||||||
//connect mapview to layerlist
|
//connect mapview to layerlist
|
||||||
connect(mapWidget_, SIGNAL(mapViewChanged()),layerTab_, SLOT(update()));
|
connect(mapWidget_, SIGNAL(mapViewChanged()),layerTab_, SLOT(update()));
|
||||||
// slider
|
// slider
|
||||||
connect(slider_,SIGNAL(valueChanged(int)),mapWidget_,SLOT(zoomToLevel(int)));
|
connect(slider_,SIGNAL(valueChanged(int)),mapWidget_,SLOT(zoomToLevel(int)));
|
||||||
//
|
//
|
||||||
connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT(updateMap()));
|
connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT(updateMap()));
|
||||||
connect(layerTab_,SIGNAL(layerSelected(int)),
|
connect(layerTab_,SIGNAL(layerSelected(int)),
|
||||||
mapWidget_,SLOT(layerSelected(int)));
|
mapWidget_,SLOT(layerSelected(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,21 +129,21 @@ void MainWindow::open(QString const& path)
|
||||||
{
|
{
|
||||||
filename_ = path;
|
filename_ = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filename_.isEmpty())
|
if (!filename_.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
||||||
load_map_file(filename_);
|
load_map_file(filename_);
|
||||||
setWindowTitle(tr("%1 - Mapnik Viewer").arg(filename_));
|
setWindowTitle(tr("%1 - Mapnik Viewer").arg(filename_));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::reload()
|
void MainWindow::reload()
|
||||||
{
|
{
|
||||||
if (!filename_.isEmpty())
|
if (!filename_.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
||||||
mapnik::box2d<double> bbox = mapWidget_->getMap()->get_current_extent();
|
mapnik::box2d<double> bbox = mapWidget_->getMap()->get_current_extent();
|
||||||
load_map_file(filename_);
|
load_map_file(filename_);
|
||||||
mapWidget_->zoomToBox(bbox);
|
mapWidget_->zoomToBox(bbox);
|
||||||
|
@ -157,7 +158,7 @@ void MainWindow::save()
|
||||||
initialPath,
|
initialPath,
|
||||||
tr("%1 Files (*.xml)")
|
tr("%1 Files (*.xml)")
|
||||||
.arg(QString("Mapnik definition")));
|
.arg(QString("Mapnik definition")));
|
||||||
if (!filename.isEmpty())
|
if (!filename.isEmpty())
|
||||||
{
|
{
|
||||||
std::cout<<"saving "<< filename.toStdString() << std::endl;
|
std::cout<<"saving "<< filename.toStdString() << std::endl;
|
||||||
mapnik::save_map(*mapWidget_->getMap(),filename.toStdString());
|
mapnik::save_map(*mapWidget_->getMap(),filename.toStdString());
|
||||||
|
@ -166,16 +167,16 @@ void MainWindow::save()
|
||||||
|
|
||||||
void MainWindow::load_map_file(QString const& filename)
|
void MainWindow::load_map_file(QString const& filename)
|
||||||
{
|
{
|
||||||
std::cout<<"loading "<< filename.toStdString() << std::endl;
|
std::cout<<"loading "<< filename.toStdString() << std::endl;
|
||||||
unsigned width = mapWidget_->width();
|
unsigned width = mapWidget_->width();
|
||||||
unsigned height = mapWidget_->height();
|
unsigned height = mapWidget_->height();
|
||||||
boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height));
|
boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height));
|
||||||
mapWidget_->setMap(map);
|
mapWidget_->setMap(map);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mapnik::load_map(*map,filename.toStdString());
|
mapnik::load_map(*map,filename.toStdString());
|
||||||
}
|
}
|
||||||
catch (mapnik::config_error & ex)
|
catch (mapnik::config_error & ex)
|
||||||
{
|
{
|
||||||
std::cout << ex.what() << "\n";
|
std::cout << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
|
@ -195,7 +196,7 @@ void MainWindow::zoom_to_box()
|
||||||
|
|
||||||
void MainWindow::pan()
|
void MainWindow::pan()
|
||||||
{
|
{
|
||||||
mapWidget_->setTool(MapWidget::Pan);
|
mapWidget_->setTool(MapWidget::Pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::info()
|
void MainWindow::info()
|
||||||
|
@ -240,7 +241,7 @@ void MainWindow::export_as()
|
||||||
tr("%1 Files (*.%2);;All Files (*)")
|
tr("%1 Files (*.%2);;All Files (*)")
|
||||||
.arg(QString(fileFormat.toUpper()))
|
.arg(QString(fileFormat.toUpper()))
|
||||||
.arg(QString(fileFormat)));
|
.arg(QString(fileFormat)));
|
||||||
if (!fileName.isEmpty())
|
if (!fileName.isEmpty())
|
||||||
{
|
{
|
||||||
QPixmap const& pix = mapWidget_->pixmap();
|
QPixmap const& pix = mapWidget_->pixmap();
|
||||||
pix.save(fileName);
|
pix.save(fileName);
|
||||||
|
@ -248,8 +249,8 @@ void MainWindow::export_as()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::print()
|
void MainWindow::print()
|
||||||
{
|
{
|
||||||
|
|
||||||
//Q_ASSERT(mapWidget_->pixmap());
|
//Q_ASSERT(mapWidget_->pixmap());
|
||||||
//QPrintDialog dialog(&printer, this);
|
//QPrintDialog dialog(&printer, this);
|
||||||
//if (dialog.exec()) {
|
//if (dialog.exec()) {
|
||||||
|
@ -264,31 +265,31 @@ void MainWindow::print()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::createActions()
|
void MainWindow::createActions()
|
||||||
{
|
{
|
||||||
//exportAct = new QAction(tr("&Export as ..."),this);
|
//exportAct = new QAction(tr("&Export as ..."),this);
|
||||||
//exportAct->setShortcut(tr("Ctrl+E"));
|
//exportAct->setShortcut(tr("Ctrl+E"));
|
||||||
//connect(exportAct, SIGNAL(triggered()), this, SLOT(export_as()));
|
//connect(exportAct, SIGNAL(triggered()), this, SLOT(export_as()));
|
||||||
zoomAllAct = new QAction(QIcon(":/images/home.png"),tr("Zoom All"),this);
|
zoomAllAct = new QAction(QIcon(":/images/home.png"),tr("Zoom All"),this);
|
||||||
connect(zoomAllAct, SIGNAL(triggered()), this, SLOT(zoom_all()));
|
connect(zoomAllAct, SIGNAL(triggered()), this, SLOT(zoom_all()));
|
||||||
|
|
||||||
zoomBoxAct = new QAction(QIcon(":/images/zoombox.png"),tr("Zoom To Box"),this);
|
zoomBoxAct = new QAction(QIcon(":/images/zoombox.png"),tr("Zoom To Box"),this);
|
||||||
zoomBoxAct->setCheckable(true);
|
zoomBoxAct->setCheckable(true);
|
||||||
connect(zoomBoxAct, SIGNAL(triggered()), this, SLOT(zoom_to_box()));
|
connect(zoomBoxAct, SIGNAL(triggered()), this, SLOT(zoom_to_box()));
|
||||||
|
|
||||||
panAct = new QAction(QIcon(":/images/pan.png"),tr("Pan"),this);
|
panAct = new QAction(QIcon(":/images/pan.png"),tr("Pan"),this);
|
||||||
panAct->setCheckable(true);
|
panAct->setCheckable(true);
|
||||||
connect(panAct, SIGNAL(triggered()), this, SLOT(pan()));
|
connect(panAct, SIGNAL(triggered()), this, SLOT(pan()));
|
||||||
|
|
||||||
infoAct = new QAction(QIcon(":/images/info.png"),tr("Info"),this);
|
infoAct = new QAction(QIcon(":/images/info.png"),tr("Info"),this);
|
||||||
infoAct->setCheckable(true);
|
infoAct->setCheckable(true);
|
||||||
connect(infoAct, SIGNAL(triggered()), this, SLOT(info()));
|
connect(infoAct, SIGNAL(triggered()), this, SLOT(info()));
|
||||||
|
|
||||||
toolsGroup=new QActionGroup(this);
|
toolsGroup=new QActionGroup(this);
|
||||||
toolsGroup->addAction(zoomBoxAct);
|
toolsGroup->addAction(zoomBoxAct);
|
||||||
toolsGroup->addAction(panAct);
|
toolsGroup->addAction(panAct);
|
||||||
toolsGroup->addAction(infoAct);
|
toolsGroup->addAction(infoAct);
|
||||||
zoomBoxAct->setChecked(true);
|
zoomBoxAct->setChecked(true);
|
||||||
|
|
||||||
openAct=new QAction(tr("Open Map definition"),this);
|
openAct=new QAction(tr("Open Map definition"),this);
|
||||||
connect(openAct,SIGNAL(triggered()),this,SLOT(open()));
|
connect(openAct,SIGNAL(triggered()),this,SLOT(open()));
|
||||||
saveAct=new QAction(tr("Save Map definition"),this);
|
saveAct=new QAction(tr("Save Map definition"),this);
|
||||||
|
@ -302,27 +303,27 @@ void MainWindow::createActions()
|
||||||
connect(panUpAct, SIGNAL(triggered()), this, SLOT(pan_up()));
|
connect(panUpAct, SIGNAL(triggered()), this, SLOT(pan_up()));
|
||||||
panDownAct = new QAction(QIcon(":/images/down.png"),tr("&Pan Down"),this);
|
panDownAct = new QAction(QIcon(":/images/down.png"),tr("&Pan Down"),this);
|
||||||
connect(panDownAct, SIGNAL(triggered()), this, SLOT(pan_down()));
|
connect(panDownAct, SIGNAL(triggered()), this, SLOT(pan_down()));
|
||||||
|
|
||||||
reloadAct = new QAction(QIcon(":/images/reload.png"),tr("Reload"),this);
|
reloadAct = new QAction(QIcon(":/images/reload.png"),tr("Reload"),this);
|
||||||
connect(reloadAct, SIGNAL(triggered()), this, SLOT(reload()));
|
connect(reloadAct, SIGNAL(triggered()), this, SLOT(reload()));
|
||||||
|
|
||||||
layerInfo = new QAction(QIcon(":/images/info.png"),tr("&Layer info"),layerTab_);
|
layerInfo = new QAction(QIcon(":/images/info.png"),tr("&Layer info"),layerTab_);
|
||||||
connect(layerInfo, SIGNAL(triggered()), layerTab_,SLOT(layerInfo()));
|
connect(layerInfo, SIGNAL(triggered()), layerTab_,SLOT(layerInfo()));
|
||||||
connect(layerTab_, SIGNAL(doubleClicked(QModelIndex const&)), layerTab_,SLOT(layerInfo2(QModelIndex const&)));
|
connect(layerTab_, SIGNAL(doubleClicked(QModelIndex const&)), layerTab_,SLOT(layerInfo2(QModelIndex const&)));
|
||||||
foreach (QByteArray format, QImageWriter::supportedImageFormats())
|
foreach (QByteArray format, QImageWriter::supportedImageFormats())
|
||||||
{
|
{
|
||||||
QString text = tr("%1...").arg(QString(format).toUpper());
|
QString text = tr("%1...").arg(QString(format).toUpper());
|
||||||
|
|
||||||
QAction *action = new QAction(text, this);
|
QAction *action = new QAction(text, this);
|
||||||
action->setData(format);
|
action->setData(format);
|
||||||
connect(action, SIGNAL(triggered()), this, SLOT(export_as()));
|
connect(action, SIGNAL(triggered()), this, SLOT(export_as()));
|
||||||
exportAsActs.append(action);
|
exportAsActs.append(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
printAct = new QAction(QIcon(":/images/print.png"),tr("&Print ..."),this);
|
printAct = new QAction(QIcon(":/images/print.png"),tr("&Print ..."),this);
|
||||||
printAct->setShortcut(tr("Ctrl+E"));
|
printAct->setShortcut(tr("Ctrl+E"));
|
||||||
connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
|
connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
|
||||||
|
|
||||||
exitAct = new QAction(tr("E&xit"), this);
|
exitAct = new QAction(tr("E&xit"), this);
|
||||||
exitAct->setShortcut(tr("Ctrl+Q"));
|
exitAct->setShortcut(tr("Ctrl+Q"));
|
||||||
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
|
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
|
||||||
|
@ -335,8 +336,8 @@ void MainWindow::createMenus()
|
||||||
{
|
{
|
||||||
exportMenu = new QMenu(tr("&Export As"), this);
|
exportMenu = new QMenu(tr("&Export As"), this);
|
||||||
foreach (QAction *action, exportAsActs)
|
foreach (QAction *action, exportAsActs)
|
||||||
exportMenu->addAction(action);
|
exportMenu->addAction(action);
|
||||||
|
|
||||||
fileMenu = new QMenu(tr("&File"),this);
|
fileMenu = new QMenu(tr("&File"),this);
|
||||||
fileMenu->addAction(openAct);
|
fileMenu->addAction(openAct);
|
||||||
fileMenu->addAction(saveAct);
|
fileMenu->addAction(saveAct);
|
||||||
|
@ -345,7 +346,7 @@ void MainWindow::createMenus()
|
||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
fileMenu->addAction(exitAct);
|
fileMenu->addAction(exitAct);
|
||||||
menuBar()->addMenu(fileMenu);
|
menuBar()->addMenu(fileMenu);
|
||||||
|
|
||||||
helpMenu = new QMenu(tr("&Help"), this);
|
helpMenu = new QMenu(tr("&Help"), this);
|
||||||
helpMenu->addAction(aboutAct);
|
helpMenu->addAction(aboutAct);
|
||||||
menuBar()->addMenu(helpMenu);
|
menuBar()->addMenu(helpMenu);
|
||||||
|
@ -377,10 +378,10 @@ void MainWindow::createToolBars()
|
||||||
|
|
||||||
void MainWindow::set_default_extent(double x0,double y0, double x1, double y1)
|
void MainWindow::set_default_extent(double x0,double y0, double x1, double y1)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
boost::shared_ptr<mapnik::Map> map_ptr = mapWidget_->getMap();
|
boost::shared_ptr<mapnik::Map> map_ptr = mapWidget_->getMap();
|
||||||
if (map_ptr)
|
if (map_ptr)
|
||||||
{
|
{
|
||||||
mapnik::projection prj(map_ptr->srs());
|
mapnik::projection prj(map_ptr->srs());
|
||||||
prj.forward(x0,y0);
|
prj.forward(x0,y0);
|
||||||
|
@ -401,7 +402,7 @@ void MainWindow::set_scaling_factor(double scaling_factor)
|
||||||
void MainWindow::zoom_all()
|
void MainWindow::zoom_all()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<mapnik::Map> map_ptr = mapWidget_->getMap();
|
boost::shared_ptr<mapnik::Map> map_ptr = mapWidget_->getMap();
|
||||||
if (map_ptr)
|
if (map_ptr)
|
||||||
{
|
{
|
||||||
map_ptr->zoom_all();
|
map_ptr->zoom_all();
|
||||||
mapnik::box2d<double> const& ext = map_ptr->get_current_extent();
|
mapnik::box2d<double> const& ext = map_ptr->get_current_extent();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -67,7 +68,7 @@ private:
|
||||||
void createToolBars();
|
void createToolBars();
|
||||||
void createContextMenu();
|
void createContextMenu();
|
||||||
void load_map_file(QString const& filename);
|
void load_map_file(QString const& filename);
|
||||||
|
|
||||||
|
|
||||||
QString currentPath;
|
QString currentPath;
|
||||||
QString filename_;
|
QString filename_;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -63,7 +64,7 @@ double scales [] = {279541132.014,
|
||||||
1066.36479192,
|
1066.36479192,
|
||||||
533.182395962};
|
533.182395962};
|
||||||
|
|
||||||
MapWidget::MapWidget(QWidget *parent)
|
MapWidget::MapWidget(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
map_(),
|
map_(),
|
||||||
selected_(1),
|
selected_(1),
|
||||||
|
@ -90,9 +91,9 @@ void MapWidget::setTool(eTool tool)
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::paintEvent(QPaintEvent*)
|
void MapWidget::paintEvent(QPaintEvent*)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
||||||
if (drag_)
|
if (drag_)
|
||||||
{
|
{
|
||||||
if (cur_tool_ == ZoomToBox)
|
if (cur_tool_ == ZoomToBox)
|
||||||
|
@ -119,7 +120,7 @@ void MapWidget::paintEvent(QPaintEvent*)
|
||||||
}
|
}
|
||||||
painter.end();
|
painter.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::resizeEvent(QResizeEvent * ev)
|
void MapWidget::resizeEvent(QResizeEvent * ev)
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
|
@ -128,10 +129,10 @@ void MapWidget::resizeEvent(QResizeEvent * ev)
|
||||||
updateMap();
|
updateMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::mousePressEvent(QMouseEvent* e)
|
void MapWidget::mousePressEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
if (e->button()==Qt::LeftButton)
|
if (e->button()==Qt::LeftButton)
|
||||||
{
|
{
|
||||||
if (cur_tool_ == ZoomToBox || cur_tool_==Pan)
|
if (cur_tool_ == ZoomToBox || cur_tool_==Pan)
|
||||||
{
|
{
|
||||||
|
@ -142,17 +143,17 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
||||||
else if (cur_tool_==Info)
|
else if (cur_tool_==Info)
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
QVector<QPair<QString,QString> > info;
|
QVector<QPair<QString,QString> > info;
|
||||||
|
|
||||||
projection map_proj(map_->srs()); // map projection
|
projection map_proj(map_->srs()); // map projection
|
||||||
double scale_denom = scale_denominator(*map_,map_proj.is_geographic());
|
double scale_denom = scale_denominator(*map_,map_proj.is_geographic());
|
||||||
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
|
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
|
||||||
|
|
||||||
for (unsigned index = 0; index < map_->layer_count();++index)
|
for (unsigned index = 0; index < map_->layer_count();++index)
|
||||||
{
|
{
|
||||||
if (int(index) != selectedLayer_) continue;
|
if (int(index) != selectedLayer_) continue;
|
||||||
|
|
||||||
layer & layer = map_->layers()[index];
|
layer & layer = map_->layers()[index];
|
||||||
if (!layer.isVisible(scale_denom)) continue;
|
if (!layer.isVisible(scale_denom)) continue;
|
||||||
std::string name = layer.name();
|
std::string name = layer.name();
|
||||||
|
@ -163,11 +164,11 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
||||||
mapnik::proj_transform prj_trans(map_proj,layer_proj);
|
mapnik::proj_transform prj_trans(map_proj,layer_proj);
|
||||||
//std::auto_ptr<mapnik::memory_datasource> data(new mapnik::memory_datasource);
|
//std::auto_ptr<mapnik::memory_datasource> data(new mapnik::memory_datasource);
|
||||||
mapnik::featureset_ptr fs = map_->query_map_point(index,x,y);
|
mapnik::featureset_ptr fs = map_->query_map_point(index,x,y);
|
||||||
|
|
||||||
if (fs)
|
if (fs)
|
||||||
{
|
{
|
||||||
feature_ptr feat = fs->next();
|
feature_ptr feat = fs->next();
|
||||||
if (feat)
|
if (feat)
|
||||||
{
|
{
|
||||||
std::map<std::string,mapnik::value> const& props = feat->props();
|
std::map<std::string,mapnik::value> const& props = feat->props();
|
||||||
std::map<std::string,mapnik::value>::const_iterator itr=props.begin();
|
std::map<std::string,mapnik::value>::const_iterator itr=props.begin();
|
||||||
|
@ -180,10 +181,10 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
typedef mapnik::coord_transform2<mapnik::CoordTransform,mapnik::geometry_type> path_type;
|
typedef mapnik::coord_transform2<mapnik::CoordTransform,mapnik::geometry_type> path_type;
|
||||||
|
|
||||||
for (unsigned i=0; i<feat->num_geometries();++i)
|
for (unsigned i=0; i<feat->num_geometries();++i)
|
||||||
{
|
{
|
||||||
mapnik::geometry_type & geom = feat->get_geometry(i);
|
mapnik::geometry_type & geom = feat->get_geometry(i);
|
||||||
path_type path(t,geom,prj_trans);
|
path_type path(t,geom,prj_trans);
|
||||||
if (geom.num_points() > 0)
|
if (geom.num_points() > 0)
|
||||||
{
|
{
|
||||||
|
@ -208,7 +209,7 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.size() > 0)
|
if (info.size() > 0)
|
||||||
{
|
{
|
||||||
info_dialog info_dlg(info,this);
|
info_dialog info_dlg(info,this);
|
||||||
|
@ -216,34 +217,34 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove annotation layer
|
// remove annotation layer
|
||||||
map_->layers().erase(remove_if(map_->layers().begin(),
|
map_->layers().erase(remove_if(map_->layers().begin(),
|
||||||
map_->layers().end(),
|
map_->layers().end(),
|
||||||
bind(&layer::name,_1) == "*annotations*")
|
bind(&layer::name,_1) == "*annotations*")
|
||||||
, map_->layers().end());
|
, map_->layers().end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (e->button()==Qt::RightButton)
|
else if (e->button()==Qt::RightButton)
|
||||||
{
|
{
|
||||||
//updateMap();
|
//updateMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::mouseMoveEvent(QMouseEvent* e)
|
void MapWidget::mouseMoveEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
if (cur_tool_ == ZoomToBox || cur_tool_==Pan)
|
if (cur_tool_ == ZoomToBox || cur_tool_==Pan)
|
||||||
{
|
{
|
||||||
end_x_ = e->x();
|
end_x_ = e->x();
|
||||||
end_y_ = e->y();
|
end_y_ = e->y();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::mouseReleaseEvent(QMouseEvent* e)
|
void MapWidget::mouseReleaseEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
if (e->button()==Qt::LeftButton)
|
if (e->button()==Qt::LeftButton)
|
||||||
{
|
{
|
||||||
end_x_ = e->x();
|
end_x_ = e->x();
|
||||||
end_y_ = e->y();
|
end_y_ = e->y();
|
||||||
|
@ -252,7 +253,7 @@ void MapWidget::mouseReleaseEvent(QMouseEvent* e)
|
||||||
drag_=false;
|
drag_=false;
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
|
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
|
||||||
box2d<double> box = t.backward(box2d<double>(start_x_,start_y_,end_x_,end_y_));
|
box2d<double> box = t.backward(box2d<double>(start_x_,start_y_,end_x_,end_y_));
|
||||||
map_->zoom_to_box(box);
|
map_->zoom_to_box(box);
|
||||||
updateMap();
|
updateMap();
|
||||||
|
@ -267,7 +268,7 @@ void MapWidget::mouseReleaseEvent(QMouseEvent* e)
|
||||||
int cy = int(0.5 * map_->height());
|
int cy = int(0.5 * map_->height());
|
||||||
int dx = end_x_ - start_x_;
|
int dx = end_x_ - start_x_;
|
||||||
int dy = end_y_ - start_y_;
|
int dy = end_y_ - start_y_;
|
||||||
map_->pan(cx - dx ,cy - dy);
|
map_->pan(cx - dx ,cy - dy);
|
||||||
updateMap();
|
updateMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,10 +276,10 @@ void MapWidget::mouseReleaseEvent(QMouseEvent* e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MapWidget::keyPressEvent(QKeyEvent *e)
|
void MapWidget::keyPressEvent(QKeyEvent *e)
|
||||||
{
|
{
|
||||||
std::cout << "key pressed:"<< e->key()<<"\n";
|
std::cout << "key pressed:"<< e->key()<<"\n";
|
||||||
switch (e->key()) {
|
switch (e->key()) {
|
||||||
case Qt::Key_Minus:
|
case Qt::Key_Minus:
|
||||||
zoomOut();
|
zoomOut();
|
||||||
break;
|
break;
|
||||||
|
@ -294,10 +295,10 @@ void MapWidget::keyPressEvent(QKeyEvent *e)
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
panDown();
|
panDown();
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Left:
|
case Qt::Key_Left:
|
||||||
panLeft();
|
panLeft();
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Right:
|
case Qt::Key_Right:
|
||||||
panRight();
|
panRight();
|
||||||
break;
|
break;
|
||||||
|
@ -309,7 +310,7 @@ void MapWidget::keyPressEvent(QKeyEvent *e)
|
||||||
break;
|
break;
|
||||||
case 51:
|
case 51:
|
||||||
zoomToLevel(12);
|
zoomToLevel(12);
|
||||||
break;
|
break;
|
||||||
case 52:
|
case 52:
|
||||||
zoomToLevel(13);
|
zoomToLevel(13);
|
||||||
break;
|
break;
|
||||||
|
@ -318,7 +319,7 @@ void MapWidget::keyPressEvent(QKeyEvent *e)
|
||||||
break;
|
break;
|
||||||
case 54:
|
case 54:
|
||||||
zoomToLevel(15);
|
zoomToLevel(15);
|
||||||
break;
|
break;
|
||||||
case 55:
|
case 55:
|
||||||
zoomToLevel(16);
|
zoomToLevel(16);
|
||||||
break;
|
break;
|
||||||
|
@ -327,12 +328,12 @@ void MapWidget::keyPressEvent(QKeyEvent *e)
|
||||||
break;
|
break;
|
||||||
case 57:
|
case 57:
|
||||||
zoomToLevel(18);
|
zoomToLevel(18);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
QWidget::keyPressEvent(e);
|
QWidget::keyPressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::zoomToBox(mapnik::box2d<double> const& bbox)
|
void MapWidget::zoomToBox(mapnik::box2d<double> const& bbox)
|
||||||
|
@ -344,7 +345,7 @@ void MapWidget::zoomToBox(mapnik::box2d<double> const& bbox)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::defaultView()
|
void MapWidget::defaultView()
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
|
@ -354,7 +355,7 @@ void MapWidget::defaultView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::zoomIn()
|
void MapWidget::zoomIn()
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
|
@ -363,7 +364,7 @@ void MapWidget::zoomIn()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::zoomOut()
|
void MapWidget::zoomOut()
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
|
@ -406,12 +407,12 @@ void MapWidget::panLeft()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::panRight()
|
void MapWidget::panRight()
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
double cx = 0.5*map_->width();
|
double cx = 0.5*map_->width();
|
||||||
double cy = 0.5*map_->height();
|
double cy = 0.5*map_->height();
|
||||||
map_->pan(int(cx + cx * 0.25),int(cy));
|
map_->pan(int(cx + cx * 0.25),int(cy));
|
||||||
updateMap();
|
updateMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,11 +426,11 @@ void MapWidget::zoomToLevel(int level)
|
||||||
std::cerr << "scale denominator = " << scale_denom << "\n";
|
std::cerr << "scale denominator = " << scale_denom << "\n";
|
||||||
mapnik::box2d<double> ext = map_->get_current_extent();
|
mapnik::box2d<double> ext = map_->get_current_extent();
|
||||||
double width = static_cast<double>(map_->width());
|
double width = static_cast<double>(map_->width());
|
||||||
double height= static_cast<double>(map_->height());
|
double height= static_cast<double>(map_->height());
|
||||||
mapnik::coord2d pt = ext.center();
|
mapnik::coord2d pt = ext.center();
|
||||||
|
|
||||||
double res = scale_denom * 0.00028;
|
double res = scale_denom * 0.00028;
|
||||||
|
|
||||||
mapnik::box2d<double> box(pt.x - 0.5 * width * res,
|
mapnik::box2d<double> box(pt.x - 0.5 * width * res,
|
||||||
pt.y - 0.5 * height*res,
|
pt.y - 0.5 * height*res,
|
||||||
pt.x + 0.5 * width * res,
|
pt.x + 0.5 * width * res,
|
||||||
|
@ -439,37 +440,37 @@ void MapWidget::zoomToLevel(int level)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::export_to_file(unsigned ,unsigned ,std::string const&,std::string const&)
|
void MapWidget::export_to_file(unsigned ,unsigned ,std::string const&,std::string const&)
|
||||||
{
|
{
|
||||||
//image_32 image(width,height);
|
//image_32 image(width,height);
|
||||||
//agg_renderer renderer(map,image);
|
//agg_renderer renderer(map,image);
|
||||||
//renderer.apply();
|
//renderer.apply();
|
||||||
//image.saveToFile(filename,type);
|
//image.saveToFile(filename,type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::set_scaling_factor(double scaling_factor)
|
void MapWidget::set_scaling_factor(double scaling_factor)
|
||||||
{
|
{
|
||||||
scaling_factor_ = scaling_factor;
|
scaling_factor_ = scaling_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidget::updateMap()
|
void MapWidget::updateMap()
|
||||||
{
|
{
|
||||||
if (map_)
|
if (map_)
|
||||||
{
|
{
|
||||||
unsigned width=map_->width();
|
unsigned width=map_->width();
|
||||||
unsigned height=map_->height();
|
unsigned height=map_->height();
|
||||||
|
|
||||||
image_32 buf(width,height);
|
image_32 buf(width,height);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mapnik::agg_renderer<image_32> ren(*map_,buf,scaling_factor_);
|
mapnik::agg_renderer<image_32> ren(*map_,buf,scaling_factor_);
|
||||||
ren.apply();
|
ren.apply();
|
||||||
|
|
||||||
QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
|
QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
|
||||||
pix_=QPixmap::fromImage(image.rgbSwapped());
|
pix_=QPixmap::fromImage(image.rgbSwapped());
|
||||||
projection prj(map_->srs()); // map projection
|
projection prj(map_->srs()); // map projection
|
||||||
|
|
||||||
box2d<double> ext = map_->get_current_extent();
|
box2d<double> ext = map_->get_current_extent();
|
||||||
double x0 = ext.minx();
|
double x0 = ext.minx();
|
||||||
double y0 = ext.miny();
|
double y0 = ext.miny();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -32,19 +33,19 @@
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
#include <mapnik/map.hpp>
|
#include <mapnik/map.hpp>
|
||||||
|
|
||||||
class MapWidget : public QWidget
|
class MapWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum eTool
|
enum eTool
|
||||||
{
|
{
|
||||||
ZoomToBox = 1,
|
ZoomToBox = 1,
|
||||||
Pan,
|
Pan,
|
||||||
Info,
|
Info,
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<mapnik::Map> map_;
|
boost::shared_ptr<mapnik::Map> map_;
|
||||||
int selected_;
|
int selected_;
|
||||||
QPixmap pix_;
|
QPixmap pix_;
|
||||||
|
@ -64,7 +65,7 @@ public:
|
||||||
void setTool(eTool tool);
|
void setTool(eTool tool);
|
||||||
boost::shared_ptr<mapnik::Map> getMap();
|
boost::shared_ptr<mapnik::Map> getMap();
|
||||||
inline QPixmap const& pixmap() const { return pix_;}
|
inline QPixmap const& pixmap() const { return pix_;}
|
||||||
void setMap(boost::shared_ptr<mapnik::Map> map);
|
void setMap(boost::shared_ptr<mapnik::Map> map);
|
||||||
void defaultView();
|
void defaultView();
|
||||||
void zoomToBox(mapnik::box2d<double> const& box);
|
void zoomToBox(mapnik::box2d<double> const& box);
|
||||||
void zoomIn();
|
void zoomIn();
|
||||||
|
@ -80,7 +81,7 @@ public slots:
|
||||||
void layerSelected(int);
|
void layerSelected(int);
|
||||||
signals:
|
signals:
|
||||||
void mapViewChanged();
|
void mapViewChanged();
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent* ev);
|
void paintEvent(QPaintEvent* ev);
|
||||||
void resizeEvent(QResizeEvent* ev);
|
void resizeEvent(QResizeEvent* ev);
|
||||||
void mousePressEvent(QMouseEvent* e);
|
void mousePressEvent(QMouseEvent* e);
|
||||||
|
@ -89,8 +90,8 @@ protected:
|
||||||
void keyPressEvent(QKeyEvent *e);
|
void keyPressEvent(QKeyEvent *e);
|
||||||
void export_to_file(unsigned width,
|
void export_to_file(unsigned width,
|
||||||
unsigned height,
|
unsigned height,
|
||||||
std::string const& filename,
|
std::string const& filename,
|
||||||
std::string const& type);
|
std::string const& type);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAP_WIDGET_HPP
|
#endif // MAP_WIDGET_HPP
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -38,60 +39,60 @@ class node : private boost::noncopyable
|
||||||
virtual QIcon icon() const=0;
|
virtual QIcon icon() const=0;
|
||||||
virtual ~node_base() {}
|
virtual ~node_base() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct wrap : public node_base
|
struct wrap : public node_base
|
||||||
{
|
{
|
||||||
wrap(T const& obj)
|
wrap(T const& obj)
|
||||||
: obj_(obj) {}
|
: obj_(obj) {}
|
||||||
|
|
||||||
~wrap() {}
|
~wrap() {}
|
||||||
|
|
||||||
QString name () const
|
QString name () const
|
||||||
{
|
{
|
||||||
return obj_.name();
|
return obj_.name();
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon icon() const
|
QIcon icon() const
|
||||||
{
|
{
|
||||||
return obj_.icon();
|
return obj_.icon();
|
||||||
}
|
}
|
||||||
|
|
||||||
T obj_;
|
T obj_;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
node ( T const& obj, node * parent=0)
|
node ( T const& obj, node * parent=0)
|
||||||
: impl_(new wrap<T>(obj)),
|
: impl_(new wrap<T>(obj)),
|
||||||
parent_(parent)
|
parent_(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QString name() const
|
QString name() const
|
||||||
{
|
{
|
||||||
return impl_->name();
|
return impl_->name();
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon icon() const
|
QIcon icon() const
|
||||||
{
|
{
|
||||||
return impl_->icon();
|
return impl_->icon();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned num_children() const
|
unsigned num_children() const
|
||||||
{
|
{
|
||||||
return children_.count();
|
return children_.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
node * child(unsigned row) const
|
node * child(unsigned row) const
|
||||||
{
|
{
|
||||||
return children_.value(row);
|
return children_.value(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
node * parent() const
|
node * parent() const
|
||||||
{
|
{
|
||||||
return parent_;
|
return parent_;
|
||||||
}
|
}
|
||||||
|
|
||||||
node * add_child(node * child)
|
node * add_child(node * child)
|
||||||
{
|
{
|
||||||
children_.push_back(child);
|
children_.push_back(child);
|
||||||
|
@ -104,12 +105,12 @@ public:
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
~node()
|
~node()
|
||||||
{
|
{
|
||||||
qDeleteAll(children_);
|
qDeleteAll(children_);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::scoped_ptr<node_base> impl_;
|
boost::scoped_ptr<node_base> impl_;
|
||||||
QList<node*> children_;
|
QList<node*> children_;
|
||||||
|
@ -124,7 +125,7 @@ struct symbolizer_info : public boost::static_visitor<QString>
|
||||||
boost::ignore_unused_variable_warning(sym);
|
boost::ignore_unused_variable_warning(sym);
|
||||||
return QString("PointSymbolizer");
|
return QString("PointSymbolizer");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString operator() (mapnik::line_symbolizer const& sym) const
|
QString operator() (mapnik::line_symbolizer const& sym) const
|
||||||
{
|
{
|
||||||
boost::ignore_unused_variable_warning(sym);
|
boost::ignore_unused_variable_warning(sym);
|
||||||
|
@ -148,19 +149,19 @@ struct symbolizer_info : public boost::static_visitor<QString>
|
||||||
boost::ignore_unused_variable_warning(sym);
|
boost::ignore_unused_variable_warning(sym);
|
||||||
return QString("PolygonSymbolizer");
|
return QString("PolygonSymbolizer");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString operator() (mapnik::text_symbolizer const& sym) const
|
QString operator() (mapnik::text_symbolizer const& sym) const
|
||||||
{
|
{
|
||||||
boost::ignore_unused_variable_warning(sym);
|
boost::ignore_unused_variable_warning(sym);
|
||||||
return QString("TextSymbolizer");
|
return QString("TextSymbolizer");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString operator() (mapnik::shield_symbolizer const& sym) const
|
QString operator() (mapnik::shield_symbolizer const& sym) const
|
||||||
{
|
{
|
||||||
boost::ignore_unused_variable_warning(sym);
|
boost::ignore_unused_variable_warning(sym);
|
||||||
return QString("ShieldSymbolizer");
|
return QString("ShieldSymbolizer");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
QString operator() (T const& ) const
|
QString operator() (T const& ) const
|
||||||
{
|
{
|
||||||
|
@ -200,14 +201,14 @@ struct symbolizer_icon : public boost::static_visitor<QIcon>
|
||||||
QPixmap pix(48,16);
|
QPixmap pix(48,16);
|
||||||
pix.fill();
|
pix.fill();
|
||||||
QPainter painter(&pix);
|
QPainter painter(&pix);
|
||||||
mapnik::stroke const& strk = sym.get_stroke();
|
mapnik::stroke const& strk = sym.get_stroke();
|
||||||
mapnik::color const& col = strk.get_color();
|
mapnik::color const& col = strk.get_color();
|
||||||
QPen pen(QColor(col.red(),col.green(),col.blue(),col.alpha()));
|
QPen pen(QColor(col.red(),col.green(),col.blue(),col.alpha()));
|
||||||
pen.setWidth(strk.get_width());
|
pen.setWidth(strk.get_width());
|
||||||
painter.setPen(pen);
|
painter.setPen(pen);
|
||||||
painter.drawLine(0,7,47,7);
|
painter.drawLine(0,7,47,7);
|
||||||
//painter.drawLine(7,15,12,0);
|
//painter.drawLine(7,15,12,0);
|
||||||
//painter.drawLine(12,0,8,15);
|
//painter.drawLine(12,0,8,15);
|
||||||
return QIcon(pix);
|
return QIcon(pix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,13 +225,13 @@ public:
|
||||||
symbolizer_node(mapnik::symbolizer const & sym)
|
symbolizer_node(mapnik::symbolizer const & sym)
|
||||||
: sym_(sym) {}
|
: sym_(sym) {}
|
||||||
~symbolizer_node(){}
|
~symbolizer_node(){}
|
||||||
|
|
||||||
QString name() const
|
QString name() const
|
||||||
{
|
{
|
||||||
//return QString("Symbolizer:fixme");
|
//return QString("Symbolizer:fixme");
|
||||||
return boost::apply_visitor(symbolizer_info(),sym_);
|
return boost::apply_visitor(symbolizer_info(),sym_);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon icon() const
|
QIcon icon() const
|
||||||
{
|
{
|
||||||
return boost::apply_visitor(symbolizer_icon(),sym_);//QIcon(":/images/filter.png");
|
return boost::apply_visitor(symbolizer_icon(),sym_);//QIcon(":/images/filter.png");
|
||||||
|
@ -248,15 +249,15 @@ public:
|
||||||
QString name() const
|
QString name() const
|
||||||
{
|
{
|
||||||
mapnik::expression_ptr filter = rule_.get_filter();
|
mapnik::expression_ptr filter = rule_.get_filter();
|
||||||
|
|
||||||
return QString(mapnik::to_expression_string(*filter).c_str());
|
return QString(mapnik::to_expression_string(*filter).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon icon() const
|
QIcon icon() const
|
||||||
{
|
{
|
||||||
return QIcon(":/images/filter.png");
|
return QIcon(":/images/filter.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString name_;
|
QString name_;
|
||||||
mapnik::rule const& rule_;
|
mapnik::rule const& rule_;
|
||||||
|
@ -268,19 +269,19 @@ public:
|
||||||
style_node(QString name, mapnik::feature_type_style const& style)
|
style_node(QString name, mapnik::feature_type_style const& style)
|
||||||
: name_(name),
|
: name_(name),
|
||||||
style_(style) {}
|
style_(style) {}
|
||||||
|
|
||||||
~style_node() {}
|
~style_node() {}
|
||||||
|
|
||||||
QString name() const
|
QString name() const
|
||||||
{
|
{
|
||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon icon() const
|
QIcon icon() const
|
||||||
{
|
{
|
||||||
return QIcon(":/images/style.png");
|
return QIcon(":/images/style.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString name_;
|
QString name_;
|
||||||
mapnik::feature_type_style const& style_;
|
mapnik::feature_type_style const& style_;
|
||||||
|
@ -292,26 +293,26 @@ public:
|
||||||
explicit map_node(boost::shared_ptr<mapnik::Map> map)
|
explicit map_node(boost::shared_ptr<mapnik::Map> map)
|
||||||
: map_(map) {}
|
: map_(map) {}
|
||||||
~map_node() {}
|
~map_node() {}
|
||||||
|
|
||||||
QString name() const
|
QString name() const
|
||||||
{
|
{
|
||||||
return QString("Map");
|
return QString("Map");
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon icon() const
|
QIcon icon() const
|
||||||
{
|
{
|
||||||
return QIcon(":/images/map.png");
|
return QIcon(":/images/map.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<mapnik::Map> map_;
|
boost::shared_ptr<mapnik::Map> map_;
|
||||||
};
|
};
|
||||||
|
|
||||||
StyleModel::StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent)
|
StyleModel::StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent)
|
||||||
: QAbstractItemModel(parent),
|
: QAbstractItemModel(parent),
|
||||||
root_(new node(map_node(map)))
|
root_(new node(map_node(map)))
|
||||||
{
|
{
|
||||||
typedef std::map<std::string,mapnik::feature_type_style> style_type;
|
typedef std::map<std::string,mapnik::feature_type_style> style_type;
|
||||||
style_type const & styles = map->styles();
|
style_type const & styles = map->styles();
|
||||||
style_type::const_iterator itr = styles.begin();
|
style_type::const_iterator itr = styles.begin();
|
||||||
style_type::const_iterator end = styles.end();
|
style_type::const_iterator end = styles.end();
|
||||||
|
@ -329,22 +330,22 @@ StyleModel::StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent)
|
||||||
rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
|
rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyleModel::~StyleModel() {}
|
StyleModel::~StyleModel() {}
|
||||||
|
|
||||||
// interface
|
// interface
|
||||||
QModelIndex StyleModel::index (int row, int col, QModelIndex const& parent) const
|
QModelIndex StyleModel::index (int row, int col, QModelIndex const& parent) const
|
||||||
{
|
{
|
||||||
// qDebug("index() row=%d col=%d parent::internalId() = %lld", row,col,parent.internalId());
|
// qDebug("index() row=%d col=%d parent::internalId() = %lld", row,col,parent.internalId());
|
||||||
node * parent_node;
|
node * parent_node;
|
||||||
|
|
||||||
if (!parent.isValid())
|
if (!parent.isValid())
|
||||||
parent_node = root_.get();
|
parent_node = root_.get();
|
||||||
else
|
else
|
||||||
parent_node = static_cast<node*>(parent.internalPointer());
|
parent_node = static_cast<node*>(parent.internalPointer());
|
||||||
|
|
||||||
node * child_node = parent_node->child(row);
|
node * child_node = parent_node->child(row);
|
||||||
if (child_node)
|
if (child_node)
|
||||||
return createIndex(row,col,child_node);
|
return createIndex(row,col,child_node);
|
||||||
|
@ -358,7 +359,7 @@ QModelIndex StyleModel::parent (QModelIndex const& index) const
|
||||||
node * parent_node = child_node->parent();
|
node * parent_node = child_node->parent();
|
||||||
if (parent_node == root_.get())
|
if (parent_node == root_.get())
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
return createIndex(parent_node->row(),0,parent_node);
|
return createIndex(parent_node->row(),0,parent_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +390,7 @@ QVariant StyleModel::data(const QModelIndex & index, int role) const
|
||||||
{
|
{
|
||||||
if (role == Qt::DisplayRole)
|
if (role == Qt::DisplayRole)
|
||||||
{
|
{
|
||||||
|
|
||||||
return QVariant(cur_node->name());
|
return QVariant(cur_node->name());
|
||||||
}
|
}
|
||||||
else if ( role == Qt::DecorationRole)
|
else if ( role == Qt::DecorationRole)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* This file is part of Mapnik (c++ mapping toolkit)
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
* Copyright (C) 2007 Artem Pavlenko
|
*
|
||||||
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* Mapnik is free software; you can redistribute it and/or
|
* Mapnik is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -32,11 +33,11 @@ class StyleModel : public QAbstractItemModel
|
||||||
public:
|
public:
|
||||||
StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent=0);
|
StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent=0);
|
||||||
~StyleModel();
|
~StyleModel();
|
||||||
// interface
|
// interface
|
||||||
QModelIndex index (int row, int col, QModelIndex const& parent = QModelIndex()) const;
|
QModelIndex index (int row, int col, QModelIndex const& parent = QModelIndex()) const;
|
||||||
QModelIndex parent (QModelIndex const& child) const;
|
QModelIndex parent (QModelIndex const& child) const;
|
||||||
int rowCount( QModelIndex const& parent = QModelIndex()) const;
|
int rowCount( QModelIndex const& parent = QModelIndex()) const;
|
||||||
int columnCount( QModelIndex const& parent = QModelIndex()) const;
|
int columnCount( QModelIndex const& parent = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
|
||||||
private:
|
private:
|
||||||
//boost::shared_ptr<mapnik::Map> map_;
|
//boost::shared_ptr<mapnik::Map> map_;
|
||||||
|
|
2
deps/agg/include/agg_path_storage.h
vendored
2
deps/agg/include/agg_path_storage.h
vendored
|
@ -736,7 +736,7 @@ namespace agg
|
||||||
template<class VertexSource>
|
template<class VertexSource>
|
||||||
void join_path(VertexSource& vs, unsigned path_id = 0)
|
void join_path(VertexSource& vs, unsigned path_id = 0)
|
||||||
{
|
{
|
||||||
double x, y;
|
double x=0.0, y=0.0;
|
||||||
unsigned cmd;
|
unsigned cmd;
|
||||||
vs.rewind(path_id);
|
vs.rewind(path_id);
|
||||||
cmd = vs.vertex(&x, &y);
|
cmd = vs.vertex(&x, &y);
|
||||||
|
|
111
deps/agg/include/agg_rasterizer_outline_aa.h
vendored
111
deps/agg/include/agg_rasterizer_outline_aa.h
vendored
|
@ -323,68 +323,65 @@ namespace agg
|
||||||
int y2;
|
int y2;
|
||||||
int lprev;
|
int lprev;
|
||||||
|
|
||||||
if(close_polygon)
|
if(close_polygon && (m_src_vertices.size() >= 3))
|
||||||
{
|
{
|
||||||
if(m_src_vertices.size() >= 3)
|
dv.idx = 2;
|
||||||
|
|
||||||
|
v = &m_src_vertices[m_src_vertices.size() - 1];
|
||||||
|
x1 = v->x;
|
||||||
|
y1 = v->y;
|
||||||
|
lprev = v->len;
|
||||||
|
|
||||||
|
v = &m_src_vertices[0];
|
||||||
|
x2 = v->x;
|
||||||
|
y2 = v->y;
|
||||||
|
dv.lcurr = v->len;
|
||||||
|
line_parameters prev(x1, y1, x2, y2, lprev);
|
||||||
|
|
||||||
|
v = &m_src_vertices[1];
|
||||||
|
dv.x1 = v->x;
|
||||||
|
dv.y1 = v->y;
|
||||||
|
dv.lnext = v->len;
|
||||||
|
dv.curr = line_parameters(x2, y2, dv.x1, dv.y1, dv.lcurr);
|
||||||
|
|
||||||
|
v = &m_src_vertices[dv.idx];
|
||||||
|
dv.x2 = v->x;
|
||||||
|
dv.y2 = v->y;
|
||||||
|
dv.next = line_parameters(dv.x1, dv.y1, dv.x2, dv.y2, dv.lnext);
|
||||||
|
|
||||||
|
dv.xb1 = 0;
|
||||||
|
dv.yb1 = 0;
|
||||||
|
dv.xb2 = 0;
|
||||||
|
dv.yb2 = 0;
|
||||||
|
|
||||||
|
switch(m_line_join)
|
||||||
{
|
{
|
||||||
dv.idx = 2;
|
case outline_no_join:
|
||||||
|
dv.flags = 3;
|
||||||
|
break;
|
||||||
|
|
||||||
v = &m_src_vertices[m_src_vertices.size() - 1];
|
case outline_miter_join:
|
||||||
x1 = v->x;
|
case outline_round_join:
|
||||||
y1 = v->y;
|
dv.flags =
|
||||||
lprev = v->len;
|
(prev.diagonal_quadrant() == dv.curr.diagonal_quadrant()) |
|
||||||
|
((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1);
|
||||||
|
break;
|
||||||
|
|
||||||
v = &m_src_vertices[0];
|
case outline_miter_accurate_join:
|
||||||
x2 = v->x;
|
dv.flags = 0;
|
||||||
y2 = v->y;
|
break;
|
||||||
dv.lcurr = v->len;
|
|
||||||
line_parameters prev(x1, y1, x2, y2, lprev);
|
|
||||||
|
|
||||||
v = &m_src_vertices[1];
|
|
||||||
dv.x1 = v->x;
|
|
||||||
dv.y1 = v->y;
|
|
||||||
dv.lnext = v->len;
|
|
||||||
dv.curr = line_parameters(x2, y2, dv.x1, dv.y1, dv.lcurr);
|
|
||||||
|
|
||||||
v = &m_src_vertices[dv.idx];
|
|
||||||
dv.x2 = v->x;
|
|
||||||
dv.y2 = v->y;
|
|
||||||
dv.next = line_parameters(dv.x1, dv.y1, dv.x2, dv.y2, dv.lnext);
|
|
||||||
|
|
||||||
dv.xb1 = 0;
|
|
||||||
dv.yb1 = 0;
|
|
||||||
dv.xb2 = 0;
|
|
||||||
dv.yb2 = 0;
|
|
||||||
|
|
||||||
switch(m_line_join)
|
|
||||||
{
|
|
||||||
case outline_no_join:
|
|
||||||
dv.flags = 3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case outline_miter_join:
|
|
||||||
case outline_round_join:
|
|
||||||
dv.flags =
|
|
||||||
(prev.diagonal_quadrant() == dv.curr.diagonal_quadrant()) |
|
|
||||||
((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case outline_miter_accurate_join:
|
|
||||||
dv.flags = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((dv.flags & 1) == 0 && m_line_join != outline_round_join)
|
|
||||||
{
|
|
||||||
bisectrix(prev, dv.curr, &dv.xb1, &dv.yb1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if((dv.flags & 2) == 0 && m_line_join != outline_round_join)
|
|
||||||
{
|
|
||||||
bisectrix(dv.curr, dv.next, &dv.xb2, &dv.yb2);
|
|
||||||
}
|
|
||||||
draw(dv, 0, m_src_vertices.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((dv.flags & 1) == 0 && m_line_join != outline_round_join)
|
||||||
|
{
|
||||||
|
bisectrix(prev, dv.curr, &dv.xb1, &dv.yb1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if((dv.flags & 2) == 0 && m_line_join != outline_round_join)
|
||||||
|
{
|
||||||
|
bisectrix(dv.curr, dv.next, &dv.xb2, &dv.yb2);
|
||||||
|
}
|
||||||
|
draw(dv, 0, m_src_vertices.size());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
4
deps/agg/src/agg_rounded_rect.cpp
vendored
4
deps/agg/src/agg_rounded_rect.cpp
vendored
|
@ -78,8 +78,8 @@ namespace agg
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void rounded_rect::normalize_radius()
|
void rounded_rect::normalize_radius()
|
||||||
{
|
{
|
||||||
double dx = fabs(m_y2 - m_y1);
|
double dx = fabs(m_x2 - m_x1);
|
||||||
double dy = fabs(m_x2 - m_x1);
|
double dy = fabs(m_y2 - m_y1);
|
||||||
|
|
||||||
double k = 1.0;
|
double k = 1.0;
|
||||||
double t;
|
double t;
|
||||||
|
|
|
@ -15,11 +15,33 @@ Look through the code to get an idea, and do not hesitate to ask questions.
|
||||||
|
|
||||||
Also read the design philosophy page for the motivations that lead to code decisions.
|
Also read the design philosophy page for the motivations that lead to code decisions.
|
||||||
|
|
||||||
|
Templates are good, within reason. We seek to use templates were possible for flexible code, but not in cases where functional
|
||||||
|
patterns would be just as concise and clear.
|
||||||
|
|
||||||
In general we use Boost, it makes more possible in C++. It is a big build time dependency (as in time to compile against and # of headers) but ultimately compiles to small object code and is very fast (particularly spirit). It also has no dependencies itself (it's really an extension to the C++ language) so requiring it is much easier than requiring a hard dependency that itself has other dependencies. This is a big reason that we prefer AGG to Cairo as our primary renderer. Also AGG, besides producing the best visual output, strikes an excellent balance between speed and thread safety by using very lightweight objects. Cairo not so much.
|
In general we use Boost, it makes more possible in C++. It is a big build time dependency (as in time to compile against and # of headers) but ultimately compiles to small object code and is very fast (particularly spirit). It also has no dependencies itself (it's really an extension to the C++ language) so requiring it is much easier than requiring a hard dependency that itself has other dependencies. This is a big reason that we prefer AGG to Cairo as our primary renderer. Also AGG, besides producing the best visual output, strikes an excellent balance between speed and thread safety by using very lightweight objects. Cairo not so much.
|
||||||
|
|
||||||
You will also notice that we don't use many of the standard geo libraries when we could. For instance we don't use GDAL, OGR, or GEOS anywhere in core, and only leverage them in optional plugins. We feel we can often write code that is faster and more thread safe than these libraries but that still does the job. If this ever changes we can adapt and start using these libraries or others as dependencies - nothing is nicer than standing on the shoulders of giants when it makes sense.
|
You will also notice that we don't use many of the standard geo libraries when we could. For instance we don't use GDAL, OGR, or GEOS anywhere in core, and only leverage them in optional plugins. We feel we can often write code that is faster and more thread safe than these libraries but that still does the job. If this ever changes we can adapt and start using these libraries or others as dependencies - nothing is nicer than standing on the shoulders of giants when it makes sense.
|
||||||
|
|
||||||
|
|
||||||
|
## Code commits best practices.
|
||||||
|
|
||||||
|
#### Big changes - awesome as pull requests
|
||||||
|
|
||||||
|
We love big, aggressive refactoring - but ideally in branches. Even if the changes should go directly into the mainline code and are stable, very big changes are useful to see as a group and branches are cheap. So, branch and commit then create a pull request against master so that other developers can take a quick look. This is a great way for informal code review when a full issue is not warrented.
|
||||||
|
|
||||||
|
#### Commits that fix issues should note the issue #
|
||||||
|
|
||||||
|
git commit plugins/input/ogr/ -m "implemented sql query in OGR plugin (closes #472)"
|
||||||
|
|
||||||
|
#### Commits that relate to issues should reference them:
|
||||||
|
|
||||||
|
git commit tests/python_tests/sqlite_test.py -m "more robust sqlite tests - refs #928"
|
||||||
|
|
||||||
|
#### Commits that add a new feature or fix should be added to the CHANGELOG
|
||||||
|
|
||||||
|
Ideally the CHANGELOG can be a very concise place to look for the most important recent development and should not read like a full commit log. So, some developers may prefer to weekly or monthly look back over their commits and summarize all at once with additions to the CHANGELOG. Other developers may prefer to add as they go.
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Mapnik is licensed LGPL, which means that you are a free to use the code in any of your applications whether they be open source or not. It also means that if you contribute code to Mapnik that others are free to continue using Mapnik in the same way, even with your new additions. If you choose to redistribute an application using Mapnik just make sure to provide any source code modifications you make back to the community. For the actual details see the full LGPL license in the COPYING doc.
|
Mapnik is licensed LGPL, which means that you are a free to use the code in any of your applications whether they be open source or not. It also means that if you contribute code to Mapnik that others are free to continue using Mapnik in the same way, even with your new additions. If you choose to redistribute an application using Mapnik just make sure to provide any source code modifications you make back to the community. For the actual details see the full LGPL license in the COPYING doc.
|
||||||
|
@ -67,13 +89,19 @@ If you see bits of code around that do not follow these please don't hesitate to
|
||||||
|
|
||||||
#### Indentation is four spaces
|
#### Indentation is four spaces
|
||||||
|
|
||||||
|
#### Use C++ style casts
|
||||||
|
|
||||||
|
static_cast<int>(value); // yes
|
||||||
|
|
||||||
|
(int)value; // no
|
||||||
|
|
||||||
#### Shared pointers should be created with [boost::make_shared](http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/make_shared.html) where possible
|
#### Shared pointers should be created with [boost::make_shared](http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/make_shared.html) where possible
|
||||||
|
|
||||||
#### Function definitions should not be separated from their arguments:
|
#### Function definitions should not be separated from their arguments:
|
||||||
|
|
||||||
void foo(int a) { ... } // please
|
void foo(int a) // please
|
||||||
|
|
||||||
void foo (int a) { ... } // no
|
void foo (int a) // no
|
||||||
|
|
||||||
#### Separate arguments by a single space:
|
#### Separate arguments by a single space:
|
||||||
|
|
||||||
|
@ -87,7 +115,18 @@ If you see bits of code around that do not follow these please don't hesitate to
|
||||||
|
|
||||||
if(a==b) // no
|
if(a==b) // no
|
||||||
|
|
||||||
#### Braces should ideally be on a separate line:
|
#### Braces should always be used:
|
||||||
|
|
||||||
|
if (!file)
|
||||||
|
{
|
||||||
|
throw mapnik::datasource_exception("not found"); // please
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!file)
|
||||||
|
throw mapnik::datasource_exception("not found"); // no
|
||||||
|
|
||||||
|
|
||||||
|
#### Braces should be on a separate line:
|
||||||
|
|
||||||
if (a == b)
|
if (a == b)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,15 +19,16 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_AGG_PATTERN_SOURCE_HPP
|
#ifndef MAPNIK_AGG_PATTERN_SOURCE_HPP
|
||||||
#define MAPNIK_AGG_PATTERN_SOURCE_HPP
|
#define MAPNIK_AGG_PATTERN_SOURCE_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/image_data.hpp>
|
#include <mapnik/image_data.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
|
||||||
// agg
|
// agg
|
||||||
#include "agg_color_rgba.h"
|
#include "agg_color_rgba.h"
|
||||||
|
|
||||||
|
@ -61,4 +62,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_AGG_PATTERN_SOURCE_HPP
|
#endif // MAPNIK_AGG_PATTERN_SOURCE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,12 +19,14 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_AGG_RASTERIZER_HPP
|
#ifndef MAPNIK_AGG_RASTERIZER_HPP
|
||||||
#define MAPNIK_AGG_RASTERIZER_HPP
|
#define MAPNIK_AGG_RASTERIZER_HPP
|
||||||
|
|
||||||
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
|
||||||
|
// agg
|
||||||
#include "agg_rasterizer_scanline_aa.h"
|
#include "agg_rasterizer_scanline_aa.h"
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
@ -33,4 +35,4 @@ struct rasterizer : agg::rasterizer_scanline_aa<>, boost::noncopyable {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_AGG_RASTERIZER_HPP
|
#endif // MAPNIK_AGG_RASTERIZER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_AGG_RENDERER_HPP
|
||||||
|
#define MAPNIK_AGG_RENDERER_HPP
|
||||||
#ifndef AGG_RENDERER_HPP
|
|
||||||
#define AGG_RENDERER_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
@ -40,6 +38,7 @@
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
// forward declare so that
|
// forward declare so that
|
||||||
|
@ -61,7 +60,11 @@ class MAPNIK_DECL agg_renderer : public feature_style_processor<agg_renderer<T>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// create with default, empty placement detector
|
||||||
agg_renderer(Map const& m, T & pixmap, double scale_factor=1.0, unsigned offset_x=0, unsigned offset_y=0);
|
agg_renderer(Map const& m, T & pixmap, double scale_factor=1.0, unsigned offset_x=0, unsigned offset_y=0);
|
||||||
|
// create with external placement detector, possibly non-empty
|
||||||
|
agg_renderer(Map const &m, T & pixmap, boost::shared_ptr<label_collision_detector4> detector,
|
||||||
|
double scale_factor=1.0, unsigned offset_x=0, unsigned offset_y=0);
|
||||||
~agg_renderer();
|
~agg_renderer();
|
||||||
void start_map_processing(Map const& map);
|
void start_map_processing(Map const& map);
|
||||||
void end_map_processing(Map const& map);
|
void end_map_processing(Map const& map);
|
||||||
|
@ -122,9 +125,11 @@ private:
|
||||||
CoordTransform t_;
|
CoordTransform t_;
|
||||||
freetype_engine font_engine_;
|
freetype_engine font_engine_;
|
||||||
face_manager<freetype_engine> font_manager_;
|
face_manager<freetype_engine> font_manager_;
|
||||||
label_collision_detector4 detector_;
|
boost::shared_ptr<label_collision_detector4> detector_;
|
||||||
boost::scoped_ptr<rasterizer> ras_ptr;
|
boost::scoped_ptr<rasterizer> ras_ptr;
|
||||||
|
|
||||||
|
void setup(Map const &m);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //AGG_RENDERER_HPP
|
#endif // MAPNIK_AGG_RENDERER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_ARROW_HPP
|
||||||
|
#define MAPNIK_ARROW_HPP
|
||||||
#ifndef ARROW_HPP
|
|
||||||
#define ARROW_HPP
|
|
||||||
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
|
|
||||||
|
@ -44,4 +42,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ARROW_HPP
|
#endif // MAPNIK_ARROW_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,15 +20,18 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_ATTRIBUTE_HPP
|
#ifndef MAPNIK_ATTRIBUTE_HPP
|
||||||
#define MAPNIK_ATTRIBUTE_HPP
|
#define MAPNIK_ATTRIBUTE_HPP
|
||||||
|
|
||||||
|
// mapnik
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
|
||||||
|
static mapnik::value _null_value;
|
||||||
|
|
||||||
struct attribute
|
struct attribute
|
||||||
{
|
{
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
@ -38,7 +41,13 @@ struct attribute
|
||||||
template <typename V ,typename F>
|
template <typename V ,typename F>
|
||||||
V value(F const& f) const
|
V value(F const& f) const
|
||||||
{
|
{
|
||||||
return f[name_];
|
typedef typename F::const_iterator const_iterator;
|
||||||
|
const_iterator itr = f.find(name_);
|
||||||
|
if (itr != f.end())
|
||||||
|
{
|
||||||
|
return itr->second;
|
||||||
|
}
|
||||||
|
return _null_value;
|
||||||
}
|
}
|
||||||
std::string const& name() const { return name_;}
|
std::string const& name() const { return name_;}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,20 +20,20 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_ATTRIBUTE_COLLECTOR_HPP
|
||||||
|
#define MAPNIK_ATTRIBUTE_COLLECTOR_HPP
|
||||||
#ifndef ATTRIBUTE_COLLECTOR_HPP
|
|
||||||
#define ATTRIBUTE_COLLECTOR_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
#include <mapnik/rule.hpp>
|
#include <mapnik/rule.hpp>
|
||||||
#include <mapnik/path_expression_grammar.hpp>
|
#include <mapnik/path_expression_grammar.hpp>
|
||||||
#include <mapnik/parse_path.hpp>
|
#include <mapnik/parse_path.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
#include <boost/concept_check.hpp>
|
#include <boost/concept_check.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -271,4 +271,4 @@ private:
|
||||||
|
|
||||||
} // namespace mapnik
|
} // namespace mapnik
|
||||||
|
|
||||||
#endif //ATTRIBUTE_COLLECTOR_HPP
|
#endif // MAPNIK_ATTRIBUTE_COLLECTOR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_ATTRIBUTE_DESCRIPTOR_HPP
|
||||||
|
#define MAPNIK_ATTRIBUTE_DESCRIPTOR_HPP
|
||||||
#ifndef ATTRIBUTE_DESCRIPTOR
|
|
||||||
#define ATTRIBUTE_DESCRIPTOR
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -118,4 +116,4 @@ operator << (std::basic_ostream<charT,traits>& out,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ATTRIBUTE_DESCRIPTOR_HPP
|
#endif // MAPNIK_ATTRIBUTE_DESCRIPTOR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,16 +20,16 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: box2d.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
|
||||||
|
|
||||||
#ifndef MAPNIK_BOX2D_HPP
|
#ifndef MAPNIK_BOX2D_HPP
|
||||||
#define MAPNIK_BOX2D_HPP
|
#define MAPNIK_BOX2D_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Tom Hughes
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,10 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#if defined(HAVE_CAIRO)
|
#if defined(HAVE_CAIRO)
|
||||||
|
|
||||||
#ifndef CAIRO_RENDERER_HPP
|
#ifndef MAPNIK_CAIRO_RENDERER_HPP
|
||||||
#define CAIRO_RENDERER_HPP
|
#define MAPNIK_CAIRO_RENDERER_HPP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
@ -152,6 +148,6 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // MAPNIK_CAIRO_RENDERER_HPP
|
||||||
|
|
||||||
#endif //CAIRO_RENDERER_HPP
|
#endif
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: color.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_COLOR_HPP
|
||||||
|
#define MAPNIK_COLOR_HPP
|
||||||
#ifndef COLOR_HPP
|
|
||||||
#define COLOR_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
@ -32,6 +30,7 @@
|
||||||
//boost
|
//boost
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
@ -141,4 +140,4 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //COLOR_HPP
|
#endif // MAPNIK_COLOR_HPP
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_COLOR_FACTORY_HPP
|
#ifndef MAPNIK_COLOR_FACTORY_HPP
|
||||||
#define MAPNIK_COLOR_FACTORY_HPP
|
#define MAPNIK_COLOR_FACTORY_HPP
|
||||||
|
|
||||||
|
@ -120,4 +118,4 @@ public:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //MAPNIK_COLOR_FACTORY_HPP
|
#endif // MAPNIK_COLOR_FACTORY_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,8 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_HPP
|
#ifndef MAPNIK_CONFIG_HPP
|
||||||
#define CONFIG_HPP
|
#define MAPNIK_CONFIG_HPP
|
||||||
|
|
||||||
// Windows DLL support
|
// Windows DLL support
|
||||||
|
|
||||||
|
@ -47,4 +47,5 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PROJ_ENVELOPE_POINTS 20
|
#define PROJ_ENVELOPE_POINTS 20
|
||||||
#endif // CONFIG_HPP
|
|
||||||
|
#endif // MAPNIK_CONFIG_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,8 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef MAPNIK_CONFIG_ERROR_INCLUDED
|
#ifndef MAPNIK_CONFIG_ERROR_HPP
|
||||||
#define MAPNIK_CONFIG_ERROR_INCLUDED
|
#define MAPNIK_CONFIG_ERROR_HPP
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -54,4 +54,4 @@ protected:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // MAPNIK_CONFIG_ERROR_INCLUDED
|
#endif // MAPNIK_CONFIG_ERROR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,12 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: coord.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_COORD_HPP
|
||||||
|
#define MAPNIK_COORD_HPP
|
||||||
#ifndef COORD_HPP
|
|
||||||
#define COORD_HPP
|
|
||||||
|
|
||||||
|
// boost
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
@ -187,4 +188,4 @@ operator << (std::basic_ostream<charT,traits>& out,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // COORD_HPP
|
#endif // MAPNIK_COORD_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,13 +20,12 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: coord_array.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_COORD_ARRAY_HPP
|
||||||
|
#define MAPNIK_COORD_ARRAY_HPP
|
||||||
#ifndef COORD_ARRAY_HPP
|
|
||||||
#define COORD_ARRAY_HPP
|
|
||||||
|
|
||||||
//mapnik
|
//mapnik
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
@ -89,4 +88,4 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif //COORD_ARRAY_HPP
|
#endif // MAPNIK_COORD_ARRAY_HPP
|
||||||
|
|
|
@ -20,22 +20,23 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
#ifndef MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
||||||
#define MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
#define MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/color.hpp>
|
#include <mapnik/color.hpp>
|
||||||
|
|
||||||
// spirit2
|
// spirit2
|
||||||
#include <boost/config/warning_disable.hpp>
|
#include <boost/config/warning_disable.hpp>
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/spirit/include/qi.hpp>
|
||||||
#include <boost/spirit/include/qi_action.hpp>
|
#include <boost/spirit/include/qi_action.hpp>
|
||||||
|
|
||||||
// phoenix
|
// phoenix
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/spirit/include/phoenix_core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/spirit/include/phoenix_operator.hpp>
|
||||||
#include <boost/spirit/include/phoenix_fusion.hpp>
|
#include <boost/spirit/include/phoenix_fusion.hpp>
|
||||||
#include <boost/spirit/include/phoenix_function.hpp>
|
#include <boost/spirit/include/phoenix_function.hpp>
|
||||||
|
|
||||||
// fusion
|
// fusion
|
||||||
#include <boost/fusion/include/adapt_struct.hpp>
|
#include <boost/fusion/include/adapt_struct.hpp>
|
||||||
#include <boost/fusion/include/adapt_adt.hpp>
|
#include <boost/fusion/include/adapt_adt.hpp>
|
||||||
|
@ -387,4 +388,4 @@ struct css_color_grammar : qi::grammar<Iterator, color(), ascii_space_type>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
#endif // MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,22 +20,23 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_CSS_COLOR_GRAMMAR_DEPRECATED_HPP
|
||||||
|
#define MAPNIK_CSS_COLOR_GRAMMAR_DEPRECATED_HPP
|
||||||
#ifndef MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
|
||||||
#define MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/color.hpp>
|
#include <mapnik/color.hpp>
|
||||||
|
|
||||||
// spirit2
|
// spirit2
|
||||||
#include <boost/config/warning_disable.hpp>
|
#include <boost/config/warning_disable.hpp>
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/spirit/include/qi.hpp>
|
||||||
#include <boost/spirit/include/qi_action.hpp>
|
#include <boost/spirit/include/qi_action.hpp>
|
||||||
|
|
||||||
// phoenix
|
// phoenix
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/spirit/include/phoenix_core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/spirit/include/phoenix_operator.hpp>
|
||||||
#include <boost/spirit/include/phoenix_fusion.hpp>
|
#include <boost/spirit/include/phoenix_fusion.hpp>
|
||||||
#include <boost/spirit/include/phoenix_function.hpp>
|
#include <boost/spirit/include/phoenix_function.hpp>
|
||||||
|
|
||||||
// fusion
|
// fusion
|
||||||
#include <boost/fusion/include/adapt_struct.hpp>
|
#include <boost/fusion/include/adapt_struct.hpp>
|
||||||
|
|
||||||
|
@ -45,7 +46,6 @@
|
||||||
// stl
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
//BOOST_FUSION_ADAPT_CLASS(
|
//BOOST_FUSION_ADAPT_CLASS(
|
||||||
// mapnik::color,
|
// mapnik::color,
|
||||||
// (unsigned, unsigned, obj.red(), obj.set_red(val))
|
// (unsigned, unsigned, obj.red(), obj.set_red(val))
|
||||||
|
@ -417,4 +417,4 @@ struct css_color_grammar : qi::grammar<Iterator, css(), ascii_space_type>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_CSS_COLOR_GRAMMAR_HPP
|
#endif // MAPNIK_CSS_COLOR_GRAMMAR_DEPRECATED_HPP
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,90 +20,90 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: ctrans.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_CTRANS_HPP
|
||||||
|
#define MAPNIK_CTRANS_HPP
|
||||||
#ifndef CTRANS_HPP
|
|
||||||
#define CTRANS_HPP
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/vertex.hpp>
|
#include <mapnik/vertex.hpp>
|
||||||
#include <mapnik/coord_array.hpp>
|
#include <mapnik/coord_array.hpp>
|
||||||
#include <mapnik/proj_transform.hpp>
|
#include <mapnik/proj_transform.hpp>
|
||||||
|
|
||||||
namespace mapnik {
|
// boost
|
||||||
|
#include <boost/math/constants/constants.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
const double pi = boost::math::constants::pi<double>();
|
||||||
|
const double pi_by_2 = pi/2.0;
|
||||||
|
|
||||||
|
namespace mapnik
|
||||||
|
{
|
||||||
|
|
||||||
typedef coord_array<coord2d> CoordinateArray;
|
typedef coord_array<coord2d> CoordinateArray;
|
||||||
|
|
||||||
template <typename Transform,typename Geometry>
|
|
||||||
|
template <typename Transform, typename Geometry>
|
||||||
struct MAPNIK_DECL coord_transform
|
struct MAPNIK_DECL coord_transform
|
||||||
{
|
{
|
||||||
coord_transform(Transform const& t, Geometry& geom)
|
coord_transform(Transform const& t, Geometry& geom)
|
||||||
: t_(t), geom_(geom) {}
|
: t_(t), geom_(geom) {}
|
||||||
|
|
||||||
unsigned vertex(double *x , double *y) const
|
unsigned vertex(double *x, double *y) const
|
||||||
{
|
{
|
||||||
unsigned command = geom_.vertex(x,y);
|
unsigned command = geom_.vertex(x, y);
|
||||||
t_.forward(x,y);
|
t_.forward(x, y);
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rewind (unsigned pos)
|
void rewind(unsigned pos)
|
||||||
{
|
{
|
||||||
geom_.rewind(pos);
|
geom_.rewind(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Transform const& t_;
|
Transform const& t_;
|
||||||
Geometry& geom_;
|
Geometry& geom_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Transform,typename Geometry>
|
|
||||||
|
template <typename Transform, typename Geometry>
|
||||||
struct MAPNIK_DECL coord_transform2
|
struct MAPNIK_DECL coord_transform2
|
||||||
{
|
{
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef typename Geometry::value_type value_type;
|
typedef typename Geometry::value_type value_type;
|
||||||
|
|
||||||
coord_transform2(Transform const& t,
|
coord_transform2(Transform const& t,
|
||||||
Geometry const& geom,
|
Geometry const& geom,
|
||||||
proj_transform const& prj_trans)
|
proj_transform const& prj_trans)
|
||||||
: t_(t),
|
: t_(t),
|
||||||
geom_(geom),
|
geom_(geom),
|
||||||
prj_trans_(prj_trans) {}
|
prj_trans_(prj_trans) {}
|
||||||
|
|
||||||
unsigned vertex(double * x , double * y) const
|
unsigned vertex(double *x, double *y) const
|
||||||
{
|
{
|
||||||
unsigned command(SEG_MOVETO);
|
unsigned command = SEG_MOVETO;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
bool skipped_points = false;
|
bool skipped_points = false;
|
||||||
while (!ok)
|
double z = 0;
|
||||||
|
while (!ok && command != SEG_END)
|
||||||
{
|
{
|
||||||
command = geom_.vertex(x,y);
|
command = geom_.vertex(x, y);
|
||||||
double z=0;
|
ok = prj_trans_.backward(*x, *y, z);
|
||||||
ok = prj_trans_.backward(*x,*y,z);
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
skipped_points = true;
|
skipped_points = true;
|
||||||
}
|
}
|
||||||
ok = ok || (command == SEG_END);
|
|
||||||
}
|
}
|
||||||
if (skipped_points && (command == SEG_LINETO))
|
if (skipped_points && (command == SEG_LINETO))
|
||||||
{
|
{
|
||||||
command = SEG_MOVETO;
|
command = SEG_MOVETO;
|
||||||
}
|
}
|
||||||
t_.forward(x,y);
|
t_.forward(x, y);
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*unsigned vertex(double * x , double * y) const
|
void rewind(unsigned pos)
|
||||||
{
|
|
||||||
unsigned command = geom_.vertex(x,y);
|
|
||||||
double z=0;
|
|
||||||
prj_trans_.backward(*x,*y,z);
|
|
||||||
t_.forward(x,y);
|
|
||||||
return command;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
void rewind (unsigned pos)
|
|
||||||
{
|
{
|
||||||
geom_.rewind(pos);
|
geom_.rewind(pos);
|
||||||
}
|
}
|
||||||
|
@ -112,42 +112,42 @@ struct MAPNIK_DECL coord_transform2
|
||||||
{
|
{
|
||||||
return geom_;
|
return geom_;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Transform const& t_;
|
Transform const& t_;
|
||||||
Geometry const& geom_;
|
Geometry const& geom_;
|
||||||
proj_transform const& prj_trans_;
|
proj_transform const& prj_trans_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename Transform,typename Geometry>
|
template <typename Transform, typename Geometry>
|
||||||
struct MAPNIK_DECL coord_transform3
|
struct MAPNIK_DECL coord_transform3
|
||||||
{
|
{
|
||||||
coord_transform3(Transform const& t,
|
coord_transform3(Transform const& t,
|
||||||
Geometry const& geom,
|
Geometry const& geom,
|
||||||
proj_transform const& prj_trans,
|
proj_transform const& prj_trans,
|
||||||
int dx, int dy)
|
int dx, int dy)
|
||||||
: t_(t),
|
: t_(t),
|
||||||
geom_(geom),
|
geom_(geom),
|
||||||
prj_trans_(prj_trans),
|
prj_trans_(prj_trans),
|
||||||
dx_(dx), dy_(dy) {}
|
dx_(dx), dy_(dy) {}
|
||||||
|
|
||||||
unsigned vertex(double * x , double * y) const
|
unsigned vertex(double *x, double *y) const
|
||||||
{
|
{
|
||||||
unsigned command = geom_.vertex(x,y);
|
unsigned command = geom_.vertex(x, y);
|
||||||
double z=0;
|
double z = 0;
|
||||||
prj_trans_.backward(*x,*y,z);
|
prj_trans_.backward(*x, *y, z);
|
||||||
t_.forward(x,y);
|
t_.forward(x, y);
|
||||||
*x+=dx_;
|
*x += dx_;
|
||||||
*y+=dy_;
|
*y += dy_;
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rewind (unsigned pos)
|
void rewind(unsigned pos)
|
||||||
{
|
{
|
||||||
geom_.rewind(pos);
|
geom_.rewind(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Transform const& t_;
|
Transform const& t_;
|
||||||
Geometry const& geom_;
|
Geometry const& geom_;
|
||||||
|
@ -155,7 +155,226 @@ private:
|
||||||
int dx_;
|
int dx_;
|
||||||
int dy_;
|
int dy_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// TODO - expose this and make chainable
|
||||||
|
template <typename Transform,typename Geometry>
|
||||||
|
struct MAPNIK_DECL coord_transform_parallel
|
||||||
|
{
|
||||||
|
typedef std::size_t size_type;
|
||||||
|
typedef typename Geometry::value_type value_type;
|
||||||
|
|
||||||
|
coord_transform_parallel(Transform const& t,
|
||||||
|
Geometry const& geom,
|
||||||
|
proj_transform const& prj_trans )
|
||||||
|
: t_(t),
|
||||||
|
geom_(geom),
|
||||||
|
prj_trans_(prj_trans),
|
||||||
|
offset_(0.0),
|
||||||
|
threshold_(10),
|
||||||
|
m_status(initial) {}
|
||||||
|
|
||||||
|
enum status
|
||||||
|
{
|
||||||
|
initial,
|
||||||
|
start,
|
||||||
|
first,
|
||||||
|
process,
|
||||||
|
last_vertex,
|
||||||
|
angle_joint,
|
||||||
|
end
|
||||||
|
};
|
||||||
|
|
||||||
|
double get_offset() const
|
||||||
|
{
|
||||||
|
return offset_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_offset(double offset)
|
||||||
|
{
|
||||||
|
offset_ = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int get_threshold() const
|
||||||
|
{
|
||||||
|
return threshold_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_threshold(unsigned int t)
|
||||||
|
{
|
||||||
|
threshold_ = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned vertex(double * x , double * y)
|
||||||
|
{
|
||||||
|
double z=0;
|
||||||
|
|
||||||
|
if (offset_==0.0)
|
||||||
|
{
|
||||||
|
unsigned command = geom_.vertex(x,y);
|
||||||
|
prj_trans_.backward(*x,*y,z);
|
||||||
|
t_.forward(x,y);
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(true){
|
||||||
|
switch(m_status)
|
||||||
|
{
|
||||||
|
case end:
|
||||||
|
return SEG_END;
|
||||||
|
break;
|
||||||
|
case initial:
|
||||||
|
m_pre_cmd = geom_.vertex(x,y);
|
||||||
|
prj_trans_.backward(*x,*y,z);
|
||||||
|
t_.forward(x,y);
|
||||||
|
m_pre_x = *x;
|
||||||
|
m_pre_y = *y;
|
||||||
|
//m_status = (m_pre_cmd!=SEG_END)?start:end; //
|
||||||
|
case start:
|
||||||
|
m_cur_cmd = geom_.vertex(&m_cur_x, &m_cur_y);
|
||||||
|
prj_trans_.backward(m_cur_x,m_cur_y,z);
|
||||||
|
t_.forward(&m_cur_x,&m_cur_y);
|
||||||
|
case first:
|
||||||
|
angle_a = atan2((m_pre_y-m_cur_y),(m_pre_x-m_cur_x));
|
||||||
|
dx_pre = cos(angle_a + pi_by_2);
|
||||||
|
dy_pre = sin(angle_a + pi_by_2);
|
||||||
|
#ifdef MAPNIK_DEBUG
|
||||||
|
std::clog << "offsetting line by: " << offset_ << "\n";
|
||||||
|
std::clog << "initial dx=" << (dx_pre * offset_) << " dy=" << (dy_pre * offset_) << "\n";
|
||||||
|
#endif
|
||||||
|
*x = m_pre_x + (dx_pre * offset_);
|
||||||
|
*y = m_pre_y + (dy_pre * offset_);
|
||||||
|
m_status = process;
|
||||||
|
return SEG_MOVETO;
|
||||||
|
case process:
|
||||||
|
switch(m_cur_cmd)
|
||||||
|
{
|
||||||
|
case SEG_LINETO:
|
||||||
|
m_next_cmd = geom_.vertex(&m_next_x, &m_next_y);
|
||||||
|
prj_trans_.backward(m_next_x,m_next_y,z);
|
||||||
|
t_.forward(&m_next_x,&m_next_y);
|
||||||
|
switch(m_next_cmd)
|
||||||
|
{
|
||||||
|
case SEG_LINETO:
|
||||||
|
m_status = angle_joint;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_status = last_vertex;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SEG_END:
|
||||||
|
m_status = end;
|
||||||
|
return SEG_END;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case last_vertex:
|
||||||
|
dx_curr = cos(angle_a + pi_by_2);
|
||||||
|
dy_curr = sin(angle_a + pi_by_2);
|
||||||
|
*x = m_cur_x + (dx_curr * offset_);
|
||||||
|
*y = m_cur_y + (dy_curr * offset_);
|
||||||
|
m_status = end;
|
||||||
|
return m_cur_cmd;
|
||||||
|
case angle_joint:
|
||||||
|
angle_b = atan2((m_cur_y-m_next_y),(m_cur_x-m_next_x));
|
||||||
|
h = tan((angle_b - angle_a)/2.0);
|
||||||
|
|
||||||
|
if (fabs(h) < threshold_)
|
||||||
|
{
|
||||||
|
dx_curr = cos(angle_a + pi_by_2);
|
||||||
|
dy_curr = sin(angle_a + pi_by_2);
|
||||||
|
*x = m_cur_x + (dx_curr * offset_) - h * (dy_curr * offset_);
|
||||||
|
*y = m_cur_y + (dy_curr * offset_) + h * (dx_curr * offset_);
|
||||||
|
}
|
||||||
|
else // skip sharp spikes
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef MAPNIK_DEBUG
|
||||||
|
dx_curr = cos(angle_a + pi_by_2);
|
||||||
|
dy_curr = sin(angle_a + pi_by_2);
|
||||||
|
sin_curve = dx_curr*dy_pre-dy_curr*dx_pre;
|
||||||
|
std::clog << "angle a: " << angle_a << "\n";
|
||||||
|
std::clog << "angle b: " << angle_b << "\n";
|
||||||
|
std::clog << "h: " << h << "\n";
|
||||||
|
std::clog << "sin_curve: " << sin_curve << "\n";
|
||||||
|
#endif
|
||||||
|
m_status = process;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// alternate sharp spike fix, but suboptimal...
|
||||||
|
|
||||||
|
/*
|
||||||
|
sin_curve = dx_curr*dy_pre-dy_curr*dx_pre;
|
||||||
|
cos_curve = -dx_pre*dx_curr-dy_pre*dy_curr;
|
||||||
|
|
||||||
|
#ifdef MAPNIK_DEBUG
|
||||||
|
std::clog << "sin_curve value: " << sin_curve << "\n";
|
||||||
|
#endif
|
||||||
|
if(sin_curve > -0.3 && sin_curve < 0.3) {
|
||||||
|
angle_b = atan2((m_cur_y-m_next_y),(m_cur_x-m_next_x));
|
||||||
|
h = tan((angle_b - angle_a)/2.0);
|
||||||
|
*x = m_cur_x + (dx_curr * offset_) - h * (dy_curr * offset_);
|
||||||
|
*y = m_cur_y + (dy_curr * offset_) + h * (dx_curr * offset_);
|
||||||
|
} else {
|
||||||
|
if (angle_b - angle_a > 0)
|
||||||
|
h = -1.0*(1.0+cos_curve)/sin_curve;
|
||||||
|
else
|
||||||
|
h = (1.0+cos_curve)/sin_curve;
|
||||||
|
*x = m_cur_x + (dx_curr + base_shift*dy_curr)*offset_;
|
||||||
|
*y = m_cur_y + (dy_curr - base_shift*dx_curr)*offset_;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
m_pre_x = *x;
|
||||||
|
m_pre_x = *y;
|
||||||
|
m_cur_x = m_next_x;
|
||||||
|
m_cur_y = m_next_y;
|
||||||
|
angle_a = angle_b;
|
||||||
|
m_pre_cmd = m_cur_cmd;
|
||||||
|
m_cur_cmd = m_next_cmd;
|
||||||
|
m_status = process;
|
||||||
|
return m_pre_cmd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void rewind (unsigned pos)
|
||||||
|
{
|
||||||
|
geom_.rewind(pos);
|
||||||
|
m_status = initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Transform const& t_;
|
||||||
|
Geometry const& geom_;
|
||||||
|
proj_transform const& prj_trans_;
|
||||||
|
int offset_;
|
||||||
|
unsigned int threshold_;
|
||||||
|
status m_status;
|
||||||
|
double dx_pre;
|
||||||
|
double dy_pre;
|
||||||
|
double dx_curr;
|
||||||
|
double dy_curr;
|
||||||
|
double sin_curve;
|
||||||
|
double cos_curve;
|
||||||
|
double angle_a;
|
||||||
|
double angle_b;
|
||||||
|
double h;
|
||||||
|
unsigned m_pre_cmd;
|
||||||
|
double m_pre_x;
|
||||||
|
double m_pre_y;
|
||||||
|
unsigned m_cur_cmd;
|
||||||
|
double m_cur_x;
|
||||||
|
double m_cur_y;
|
||||||
|
unsigned m_next_cmd;
|
||||||
|
double m_next_x;
|
||||||
|
double m_next_y;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class CoordTransform
|
class CoordTransform
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -166,71 +385,74 @@ private:
|
||||||
box2d<double> extent_;
|
box2d<double> extent_;
|
||||||
double offset_x_;
|
double offset_x_;
|
||||||
double offset_y_;
|
double offset_y_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CoordTransform(int width,int height,const box2d<double>& extent,
|
CoordTransform(int width, int height, const box2d<double>& extent,
|
||||||
double offset_x = 0, double offset_y = 0)
|
double offset_x = 0, double offset_y = 0)
|
||||||
:width_(width),height_(height),extent_(extent),offset_x_(offset_x),offset_y_(offset_y)
|
: width_(width), height_(height), extent_(extent),
|
||||||
|
offset_x_(offset_x), offset_y_(offset_y)
|
||||||
{
|
{
|
||||||
sx_ = (double(width_))/extent_.width();
|
sx_ = static_cast<double>(width_) / extent_.width();
|
||||||
sy_ = (double(height_))/extent_.height();
|
sy_ = static_cast<double>(height_) / extent_.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int width() const
|
inline int width() const
|
||||||
{
|
{
|
||||||
return width_;
|
return width_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int height() const
|
inline int height() const
|
||||||
{
|
{
|
||||||
return height_;
|
return height_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double scale_x() const
|
inline double scale_x() const
|
||||||
{
|
{
|
||||||
return sx_;
|
return sx_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double scale_y() const
|
inline double scale_y() const
|
||||||
{
|
{
|
||||||
return sy_;
|
return sy_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void forward(double * x, double * y) const
|
inline void forward(double *x, double *y) const
|
||||||
{
|
{
|
||||||
*x = (*x - extent_.minx()) * sx_ - offset_x_;
|
*x = (*x - extent_.minx()) * sx_ - offset_x_;
|
||||||
*y = (extent_.maxy() - *y) * sy_ - offset_y_;
|
*y = (extent_.maxy() - *y) * sy_ - offset_y_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void backward(double * x, double * y) const
|
inline void backward(double *x, double *y) const
|
||||||
{
|
{
|
||||||
*x = extent_.minx() + (*x + offset_x_)/sx_;
|
*x = extent_.minx() + (*x + offset_x_) / sx_;
|
||||||
*y = extent_.maxy() - (*y + offset_y_)/sy_;
|
*y = extent_.maxy() - (*y + offset_y_) / sy_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline coord2d& forward(coord2d& c) const
|
inline coord2d& forward(coord2d& c) const
|
||||||
{
|
{
|
||||||
forward(&c.x,&c.y);
|
forward(&c.x, &c.y);
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline coord2d& backward(coord2d& c) const
|
|
||||||
{
|
|
||||||
backward(&c.x,&c.y);
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline box2d<double> forward(const box2d<double>& e,proj_transform const& prj_trans) const
|
inline coord2d& backward(coord2d& c) const
|
||||||
|
{
|
||||||
|
backward(&c.x, &c.y);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline box2d<double> forward(const box2d<double>& e,
|
||||||
|
proj_transform const& prj_trans) const
|
||||||
{
|
{
|
||||||
double x0 = e.minx();
|
double x0 = e.minx();
|
||||||
double y0 = e.miny();
|
double y0 = e.miny();
|
||||||
double x1 = e.maxx();
|
double x1 = e.maxx();
|
||||||
double y1 = e.maxy();
|
double y1 = e.maxy();
|
||||||
double z = 0.0;
|
double z = 0.0;
|
||||||
prj_trans.backward(x0,y0,z);
|
prj_trans.backward(x0, y0, z);
|
||||||
forward(&x0,&y0);
|
forward(&x0, &y0);
|
||||||
prj_trans.backward(x1,y1,z);
|
prj_trans.backward(x1, y1, z);
|
||||||
forward(&x1,&y1);
|
forward(&x1, &y1);
|
||||||
return box2d<double>(x0,y0,x1,y1);
|
return box2d<double>(x0, y0, x1, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline box2d<double> forward(const box2d<double>& e) const
|
inline box2d<double> forward(const box2d<double>& e) const
|
||||||
|
@ -239,23 +461,24 @@ public:
|
||||||
double y0 = e.miny();
|
double y0 = e.miny();
|
||||||
double x1 = e.maxx();
|
double x1 = e.maxx();
|
||||||
double y1 = e.maxy();
|
double y1 = e.maxy();
|
||||||
forward(&x0,&y0);
|
forward(&x0, &y0);
|
||||||
forward(&x1,&y1);
|
forward(&x1, &y1);
|
||||||
return box2d<double>(x0,y0,x1,y1);
|
return box2d<double>(x0, y0, x1, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline box2d<double> backward(const box2d<double>& e,proj_transform const& prj_trans) const
|
inline box2d<double> backward(const box2d<double>& e,
|
||||||
|
proj_transform const& prj_trans) const
|
||||||
{
|
{
|
||||||
double x0 = e.minx();
|
double x0 = e.minx();
|
||||||
double y0 = e.miny();
|
double y0 = e.miny();
|
||||||
double x1 = e.maxx();
|
double x1 = e.maxx();
|
||||||
double y1 = e.maxy();
|
double y1 = e.maxy();
|
||||||
double z = 0.0;
|
double z = 0.0;
|
||||||
backward(&x0,&y0);
|
backward(&x0, &y0);
|
||||||
prj_trans.forward(x0,y0,z);
|
prj_trans.forward(x0, y0, z);
|
||||||
backward(&x1,&y1);
|
backward(&x1, &y1);
|
||||||
prj_trans.forward(x1,y1,z);
|
prj_trans.forward(x1, y1, z);
|
||||||
return box2d<double>(x0,y0,x1,y1);
|
return box2d<double>(x0, y0, x1, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline box2d<double> backward(const box2d<double>& e) const
|
inline box2d<double> backward(const box2d<double>& e) const
|
||||||
|
@ -264,28 +487,29 @@ public:
|
||||||
double y0 = e.miny();
|
double y0 = e.miny();
|
||||||
double x1 = e.maxx();
|
double x1 = e.maxx();
|
||||||
double y1 = e.maxy();
|
double y1 = e.maxy();
|
||||||
backward(&x0,&y0);
|
backward(&x0, &y0);
|
||||||
backward(&x1,&y1);
|
backward(&x1, &y1);
|
||||||
return box2d<double>(x0,y0,x1,y1);
|
return box2d<double>(x0, y0, x1, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline CoordinateArray& forward(CoordinateArray& coords) const
|
inline CoordinateArray& forward(CoordinateArray& coords) const
|
||||||
{
|
{
|
||||||
for (unsigned i=0;i<coords.size();++i)
|
for (unsigned i = 0; i < coords.size(); ++i)
|
||||||
{
|
{
|
||||||
forward(coords[i]);
|
forward(coords[i]);
|
||||||
}
|
}
|
||||||
return coords;
|
return coords;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline CoordinateArray& backward(CoordinateArray& coords) const
|
inline CoordinateArray& backward(CoordinateArray& coords) const
|
||||||
{
|
{
|
||||||
for (unsigned i=0;i<coords.size();++i)
|
for (unsigned i = 0; i < coords.size(); ++i)
|
||||||
{
|
{
|
||||||
backward(coords[i]);
|
backward(coords[i]);
|
||||||
}
|
}
|
||||||
return coords;
|
return coords;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline box2d<double> const& extent() const
|
inline box2d<double> const& extent() const
|
||||||
{
|
{
|
||||||
return extent_;
|
return extent_;
|
||||||
|
@ -293,4 +517,4 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //CTRANS_HPP
|
#endif // MAPNIK_CTRANS_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,9 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: datasource.hpp 43 2005-04-22 18:52:47Z pavlenko $
|
#ifndef MAPNIK_DATASOURCE_HPP
|
||||||
|
#define MAPNIK_DATASOURCE_HPP
|
||||||
|
|
||||||
#ifndef DATASOURCE_HPP
|
|
||||||
#define DATASOURCE_HPP
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/ctrans.hpp>
|
#include <mapnik/ctrans.hpp>
|
||||||
|
@ -31,9 +30,11 @@
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/query.hpp>
|
#include <mapnik/query.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -142,6 +143,7 @@ typedef boost::shared_ptr<datasource> datasource_ptr;
|
||||||
delete ds; \
|
delete ds; \
|
||||||
} \
|
} \
|
||||||
//
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //DATASOURCE_HPP
|
#endif // MAPNIK_DATASOURCE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,18 +20,18 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: datasource_cache.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_DATASOURCE_CACHE_HPP
|
||||||
|
#define MAPNIK_DATASOURCE_CACHE_HPP
|
||||||
#ifndef DATASOURCE_CACHE_HPP
|
|
||||||
#define DATASOURCE_CACHE_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
#include <mapnik/params.hpp>
|
#include <mapnik/params.hpp>
|
||||||
#include <mapnik/plugin.hpp>
|
#include <mapnik/plugin.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
@ -57,4 +57,4 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //DATASOURCE_CACHE_HPP
|
#endif // MAPNIK_DATASOURCE_CACHE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_DISTANCE_HPP
|
||||||
|
#define MAPNIK_DISTANCE_HPP
|
||||||
#ifndef DISTANCE_HPP
|
|
||||||
#define DISTANCE_HPP
|
|
||||||
|
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
|
|
||||||
|
@ -52,4 +50,4 @@ public:
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // GEO_UTILS_HPP
|
#endif // MAPNIK_DISTANCE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_ELLIPSOID_HPP
|
#ifndef MAPNIK_ELLIPSOID_HPP
|
||||||
#define MAPNIK_ELLIPSOID_HPP
|
#define MAPNIK_ELLIPSOID_HPP
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,11 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef MAPNIK_ENUMERATION_INCLUDED
|
#ifndef MAPNIK_ENUMERATION_HPP
|
||||||
#define MAPNIK_ENUMERATION_INCLUDED
|
#define MAPNIK_ENUMERATION_HPP
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -325,4 +327,4 @@ operator>>(std::istream & is, mapnik::enumeration<ENUM, THE_MAX> & e)
|
||||||
template <> std::string name ::our_name_ = #name; \
|
template <> std::string name ::our_name_ = #name; \
|
||||||
template <> bool name ::our_verified_flag_( name ::verify(__FILE__, __LINE__));
|
template <> bool name ::our_verified_flag_( name ::verify(__FILE__, __LINE__));
|
||||||
|
|
||||||
#endif // MAPNIK_ENUMERATION_INCLUDED
|
#endif // MAPNIK_ENUMERATION_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,11 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_EXPRESSION_EVALUATOR_HPP
|
#ifndef MAPNIK_EXPRESSION_EVALUATOR_HPP
|
||||||
#define MAPNIK_EXPRESSION_EVALUATOR_HPP
|
#define MAPNIK_EXPRESSION_EVALUATOR_HPP
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
//#include <boost/regex/config.hpp>
|
|
||||||
#if defined(BOOST_REGEX_HAS_ICU)
|
#if defined(BOOST_REGEX_HAS_ICU)
|
||||||
#include <boost/regex/icu.hpp>
|
#include <boost/regex/icu.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,7 +40,11 @@ struct evaluate : boost::static_visitor<T1>
|
||||||
explicit evaluate(feature_type const& f)
|
explicit evaluate(feature_type const& f)
|
||||||
: feature_(f) {}
|
: feature_(f) {}
|
||||||
|
|
||||||
value_type operator() (value_type x) const { return x; }
|
value_type operator() (value_type x) const
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
value_type operator() (attribute const& attr) const
|
value_type operator() (attribute const& attr) const
|
||||||
{
|
{
|
||||||
return attr.value<value_type,feature_type>(feature_);
|
return attr.value<value_type,feature_type>(feature_);
|
||||||
|
@ -104,4 +105,4 @@ struct evaluate : boost::static_visitor<T1>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_EXPRESSION_EVALUATOR_HPP
|
#endif // MAPNIK_EXPRESSION_EVALUATOR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_EXPRESSIONS_GRAMMAR_HPP
|
#ifndef MAPNIK_EXPRESSIONS_GRAMMAR_HPP
|
||||||
#define MAPNIK_EXPRESSIONS_GRAMMAR_HPP
|
#define MAPNIK_EXPRESSIONS_GRAMMAR_HPP
|
||||||
|
|
||||||
|
@ -34,12 +32,15 @@
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/concept_check.hpp>
|
#include <boost/concept_check.hpp>
|
||||||
//spirit2
|
|
||||||
|
// spirit2
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/spirit/include/qi.hpp>
|
||||||
#include <boost/spirit/include/qi_action.hpp>
|
#include <boost/spirit/include/qi_action.hpp>
|
||||||
//fusion
|
|
||||||
|
// fusion
|
||||||
#include <boost/fusion/include/adapt_struct.hpp>
|
#include <boost/fusion/include/adapt_struct.hpp>
|
||||||
//phoenix
|
|
||||||
|
// phoenix
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/spirit/include/phoenix_core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_object.hpp>
|
#include <boost/spirit/include/phoenix_object.hpp>
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/spirit/include/phoenix_operator.hpp>
|
||||||
|
@ -222,11 +223,13 @@ struct expression_grammar : qi::grammar<Iterator, expr_node(), space_type>
|
||||||
| '(' >> expr [_val = _1 ] >> ')'
|
| '(' >> expr [_val = _1 ] >> ')'
|
||||||
;
|
;
|
||||||
|
|
||||||
attr %= '[' >> +(char_ - ']') >> ']';
|
|
||||||
#if BOOST_VERSION > 104200
|
#if BOOST_VERSION > 104200
|
||||||
ustring %= '\'' >> no_skip[*~char_('\'')] >> '\'';
|
ustring %= '\'' >> no_skip[*~char_('\'')] >> '\'';
|
||||||
|
attr %= '[' >> no_skip[+~char_(']')] >> ']';
|
||||||
#else
|
#else
|
||||||
ustring %= '\'' >> lexeme[*(char_-'\'')] >> '\'';
|
ustring %= '\'' >> lexeme[*(char_-'\'')] >> '\'';
|
||||||
|
attr %= '[' >> lexeme[+(char_ - ']')] >> ']';
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,12 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef MAPNIK_EXPRESSION_NODE_HPP
|
#ifndef MAPNIK_EXPRESSION_NODE_HPP
|
||||||
#define MAPNIK_EXPRESSION_NODE_HPP
|
#define MAPNIK_EXPRESSION_NODE_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/value.hpp>
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/attribute.hpp>
|
#include <mapnik/attribute.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_EXPRESSION_STRING_HPP
|
#ifndef MAPNIK_EXPRESSION_STRING_HPP
|
||||||
#define MAPNIK_EXPRESSION_STRING_HPP
|
#define MAPNIK_EXPRESSION_STRING_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/expression_node.hpp>
|
#include <mapnik/expression_node.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,13 +20,12 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: factory.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_FACTORY_HPP
|
||||||
|
#define MAPNIK_FACTORY_HPP
|
||||||
#ifndef FACTORY_HPP
|
|
||||||
#define FACTORY_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -89,4 +88,4 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FACTORY_HPP
|
#endif // MAPNIK_FACTORY_HPP
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef FASTMATH_HPP
|
#ifndef MAPNIK_FASTMATH_HPP
|
||||||
#define FASTMATH_HPP
|
#define MAPNIK_FASTMATH_HPP
|
||||||
|
|
||||||
/* Timings:
|
/* Timings:
|
||||||
* fast_sin(not inlined) 8.95s
|
* fast_sin(not inlined) 8.95s
|
||||||
|
@ -109,4 +109,4 @@ static inline double fast_atan2(double y, double x)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FASTMATH_HPP
|
#endif // MAPNIK_FASTMATH_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,9 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: feature.hpp 40 2005-04-13 20:20:46Z pavlenko $
|
#ifndef MAPNIK_FEATURE_HPP
|
||||||
|
#define MAPNIK_FEATURE_HPP
|
||||||
|
|
||||||
#ifndef FEATURE_HPP
|
|
||||||
#define FEATURE_HPP
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/value.hpp>
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
|
@ -36,9 +35,9 @@
|
||||||
#else
|
#else
|
||||||
#include <boost/property_map.hpp>
|
#include <boost/property_map.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
@ -66,6 +65,7 @@ private:
|
||||||
std::map<std::string,value> props_;
|
std::map<std::string,value> props_;
|
||||||
public:
|
public:
|
||||||
typedef std::map<std::string,value>::iterator iterator;
|
typedef std::map<std::string,value>::iterator iterator;
|
||||||
|
typedef std::map<std::string,value>::const_iterator const_iterator;
|
||||||
explicit feature(int id)
|
explicit feature(int id)
|
||||||
: properties(props_),
|
: properties(props_),
|
||||||
id_(id),
|
id_(id),
|
||||||
|
@ -146,7 +146,7 @@ public:
|
||||||
{
|
{
|
||||||
return props_;
|
return props_;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator begin()
|
iterator begin()
|
||||||
{
|
{
|
||||||
return props_.begin();
|
return props_.begin();
|
||||||
|
@ -156,12 +156,27 @@ public:
|
||||||
{
|
{
|
||||||
return props_.end();
|
return props_.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const_iterator begin() const
|
||||||
|
{
|
||||||
|
return props_.begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
const_iterator end() const
|
||||||
|
{
|
||||||
|
return props_.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
const_iterator find(std::string const& key) const
|
||||||
|
{
|
||||||
|
return props_.find(key);
|
||||||
|
}
|
||||||
|
|
||||||
std::string to_string() const
|
std::string to_string() const
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "feature (" << std::endl;
|
ss << "feature "
|
||||||
ss << " id:" << id_ << std::endl;
|
<< id_ << " (" << std::endl;
|
||||||
for (std::map<std::string,value>::const_iterator itr=props_.begin();
|
for (std::map<std::string,value>::const_iterator itr=props_.begin();
|
||||||
itr != props_.end();++itr)
|
itr != props_.end();++itr)
|
||||||
{
|
{
|
||||||
|
@ -181,4 +196,4 @@ inline std::ostream& operator<< (std::ostream & out,Feature const& f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FEATURE_HPP
|
#endif // MAPNIK_FEATURE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,12 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FEATURE_FACTORY_HPP
|
||||||
|
#define MAPNIK_FEATURE_FACTORY_HPP
|
||||||
#ifndef FEATURE_FACTORY_HPP
|
|
||||||
#define FEATURE_FACTORY_HPP
|
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
|
||||||
|
// boost
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
//#include <boost/pool/pool_alloc.hpp>
|
//#include <boost/pool/pool_alloc.hpp>
|
||||||
|
|
||||||
|
@ -39,8 +40,7 @@ struct feature_factory
|
||||||
//return boost::allocate_shared<Feature>(boost::fast_pool_allocator<Feature>(),fid);
|
//return boost::allocate_shared<Feature>(boost::fast_pool_allocator<Feature>(),fid);
|
||||||
return boost::make_shared<Feature>(fid);
|
return boost::make_shared<Feature>(fid);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FEATURE_FACTORY_HPP
|
#endif // MAPNIK_FEATURE_FACTORY_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FEATURE_LAYER_DESC_HPP
|
||||||
|
#define MAPNIK_FEATURE_LAYER_DESC_HPP
|
||||||
#ifndef FEATURE_LAYER_DESC_HPP
|
|
||||||
#define FEATURE_LAYER_DESC_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/attribute_descriptor.hpp>
|
#include <mapnik/attribute_descriptor.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -106,4 +105,4 @@ operator << (std::basic_ostream<charT,traits>& out,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FEATURE_LAYER_DESC_HPP
|
#endif // MAPNIK_FEATURE_LAYER_DESC_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FEATURE_STYLE_PROCESSOR_HPP
|
||||||
|
#define MAPNIK_FEATURE_STYLE_PROCESSOR_HPP
|
||||||
#ifndef FEATURE_STYLE_PROCESSOR_HPP
|
|
||||||
#define FEATURE_STYLE_PROCESSOR_HPP
|
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -74,4 +72,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FEATURE_STYLE_PROCESSOR_HPP
|
#endif // MAPNIK_FEATURE_STYLE_PROCESSOR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,14 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FEATURE_TYPE_STYLE_HPP
|
||||||
|
#define MAPNIK_FEATURE_TYPE_STYLE_HPP
|
||||||
|
|
||||||
#ifndef FEATURE_TYPE_STYLE_HPP
|
|
||||||
#define FEATURE_TYPE_STYLE_HPP
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/rule.hpp>
|
#include <mapnik/rule.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/enumeration.hpp>
|
#include <mapnik/enumeration.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -69,4 +69,4 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FEATURE_TYPE_STYLE_HPP
|
#endif // MAPNIK_FEATURE_TYPE_STYLE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,17 +20,16 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FILL_HPP
|
||||||
|
#define MAPNIK_FILL_HPP
|
||||||
#ifndef FILL_HPP
|
|
||||||
#define FILL_HPP
|
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
|
||||||
class fill
|
class fill
|
||||||
{
|
{
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FILL_HPP
|
#endif // MAPNIK_FILL_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_FILTER_FACTORY_HPP
|
#ifndef MAPNIK_FILTER_FACTORY_HPP
|
||||||
#define MAPNIK_FILTER_FACTORY_HPP
|
#define MAPNIK_FILTER_FACTORY_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/expression_node.hpp>
|
#include <mapnik/expression_node.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -41,4 +40,4 @@ MAPNIK_DECL expression_ptr parse_expression (std::string const& wkt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_FILTER_FACTORY_HPP
|
#endif // MAPNIK_FILTER_FACTORY_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,11 +20,10 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_FILTER_FEATURESET_HPP
|
#ifndef MAPNIK_FILTER_FEATURESET_HPP
|
||||||
#define MAPNIK_FILTER_FEATURESET_HPP
|
#define MAPNIK_FILTER_FEATURESET_HPP
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
@ -54,4 +53,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_FILTER_FEATURESET_HPP
|
#endif // MAPNIK_FILTER_FEATURESET_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,9 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FONT_ENGINE_FREETYPE_HPP
|
||||||
|
#define MAPNIK_FONT_ENGINE_FREETYPE_HPP
|
||||||
|
|
||||||
#ifndef FONT_ENGINE_FREETYPE_HPP
|
|
||||||
#define FONT_ENGINE_FREETYPE_HPP
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/color.hpp>
|
#include <mapnik/color.hpp>
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
|
@ -50,7 +49,6 @@ extern "C"
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -121,7 +119,13 @@ public:
|
||||||
{
|
{
|
||||||
if (! FT_Set_Pixel_Sizes( face_, 0, size ))
|
if (! FT_Set_Pixel_Sizes( face_, 0, size ))
|
||||||
return true;
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool set_character_sizes(float size)
|
||||||
|
{
|
||||||
|
if ( !FT_Set_Char_Size(face_,0,(FT_F26Dot6)(size * (1<<6)),0,0))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,6 +190,14 @@ public:
|
||||||
(*face)->set_pixel_sizes(size);
|
(*face)->set_pixel_sizes(size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_character_sizes(float size)
|
||||||
|
{
|
||||||
|
for (std::vector<face_ptr>::iterator face = faces_.begin(); face != faces_.end(); ++face)
|
||||||
|
{
|
||||||
|
(*face)->set_character_sizes(size);
|
||||||
|
}
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
std::vector<face_ptr> faces_;
|
std::vector<face_ptr> faces_;
|
||||||
std::map<unsigned, dimension_t> dimension_cache_;
|
std::map<unsigned, dimension_t> dimension_cache_;
|
||||||
|
@ -200,7 +212,7 @@ public:
|
||||||
|
|
||||||
void init(double radius)
|
void init(double radius)
|
||||||
{
|
{
|
||||||
FT_Stroker_Set(s_, (FT_Fixed) radius * (1<<6),
|
FT_Stroker_Set(s_, (FT_Fixed) (radius * (1<<6)),
|
||||||
FT_STROKER_LINECAP_ROUND,
|
FT_STROKER_LINECAP_ROUND,
|
||||||
FT_STROKER_LINEJOIN_ROUND,
|
FT_STROKER_LINEJOIN_ROUND,
|
||||||
0);
|
0);
|
||||||
|
@ -334,11 +346,17 @@ struct text_renderer : private boost::noncopyable
|
||||||
halo_radius_(0.0),
|
halo_radius_(0.0),
|
||||||
opacity_(1.0) {}
|
opacity_(1.0) {}
|
||||||
|
|
||||||
|
|
||||||
void set_pixel_size(unsigned size)
|
void set_pixel_size(unsigned size)
|
||||||
{
|
{
|
||||||
faces_->set_pixel_sizes(size);
|
faces_->set_pixel_sizes(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_character_size(float size)
|
||||||
|
{
|
||||||
|
faces_->set_character_sizes(size);
|
||||||
|
}
|
||||||
|
|
||||||
void set_fill(mapnik::color const& fill)
|
void set_fill(mapnik::color const& fill)
|
||||||
{
|
{
|
||||||
fill_=fill;
|
fill_=fill;
|
||||||
|
@ -602,4 +620,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FONT_ENGINE_FREETYPE_HPP
|
#endif // MAPNIK_FONT_ENGINE_FREETYPE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_FONT_SET_HPP
|
||||||
|
#define MAPNIK_FONT_SET_HPP
|
||||||
#ifndef FONT_SET_HPP
|
|
||||||
#define FONT_SET_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
@ -52,4 +50,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FONT_SET_HPP
|
#endif // MAPNIK_FONT_SET_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: gamma.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_GAMMA_HPP
|
||||||
|
#define MAPNIK_GAMMA_HPP
|
||||||
#ifndef GAMMA_HPP
|
|
||||||
#define GAMMA_HPP
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
@ -50,4 +48,4 @@ struct MAPNIK_DECL gamma
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //GAMMA_HPP
|
#endif // MAPNIK_GAMMA_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,15 +20,16 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: geom_util.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_GEOM_UTIL_HPP
|
||||||
|
#define MAPNIK_GEOM_UTIL_HPP
|
||||||
|
|
||||||
#ifndef GEOM_UTIL_HPP
|
|
||||||
#define GEOM_UTIL_HPP
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/vertex.hpp>
|
#include <mapnik/vertex.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
@ -217,4 +218,4 @@ struct filter_at_point
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //GEOM_UTIL_HPP
|
#endif // MAPNIK_GEOM_UTIL_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,15 +20,14 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: geometry.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_GEOMETRY_HPP
|
||||||
|
#define MAPNIK_GEOMETRY_HPP
|
||||||
#ifndef GEOMETRY_HPP
|
|
||||||
#define GEOMETRY_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/vertex_vector.hpp>
|
#include <mapnik/vertex_vector.hpp>
|
||||||
#include <mapnik/ctrans.hpp>
|
#include <mapnik/ctrans.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
@ -68,27 +67,7 @@ public:
|
||||||
{
|
{
|
||||||
return type_;
|
return type_;
|
||||||
}
|
}
|
||||||
|
|
||||||
double area() const
|
|
||||||
{
|
|
||||||
double sum = 0.0;
|
|
||||||
double x(0);
|
|
||||||
double y(0);
|
|
||||||
rewind(0);
|
|
||||||
double xs = x;
|
|
||||||
double ys = y;
|
|
||||||
for (unsigned i=0;i<num_points();++i)
|
|
||||||
{
|
|
||||||
double x0(0);
|
|
||||||
double y0(0);
|
|
||||||
vertex(&x0,&y0);
|
|
||||||
sum += x * y0 - y * x0;
|
|
||||||
x = x0;
|
|
||||||
y = y0;
|
|
||||||
}
|
|
||||||
return (sum + x * ys - y * xs) * 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
box2d<double> envelope() const
|
box2d<double> envelope() const
|
||||||
{
|
{
|
||||||
box2d<double> result;
|
box2d<double> result;
|
||||||
|
@ -412,4 +391,4 @@ typedef boost::ptr_vector<geometry_type> geometry_containter;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //GEOMETRY_HPP
|
#endif // MAPNIK_GEOMETRY_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,14 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_GLOBAL_HPP
|
||||||
|
#define MAPNIK_GLOBAL_HPP
|
||||||
#ifndef GLOBAL_HPP
|
|
||||||
#define GLOBAL_HPP
|
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
#include <boost/detail/endian.hpp>
|
#include <boost/detail/endian.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
@ -183,4 +182,4 @@ inline double round (double val)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif //GLOBAL_HPP
|
#endif // MAPNIK_GLOBAL_HPP
|
||||||
|
|
|
@ -1,5 +1,27 @@
|
||||||
#ifndef GLYPH_SYMBOLIZER_HPP
|
/*****************************************************************************
|
||||||
#define GLYPH_SYMBOLIZER_HPP
|
*
|
||||||
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 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
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef MAPNIK_GLYPH_SYMBOLIZER_HPP
|
||||||
|
#define MAPNIK_GLYPH_SYMBOLIZER_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/enumeration.hpp>
|
#include <mapnik/enumeration.hpp>
|
||||||
|
@ -190,4 +212,4 @@ private:
|
||||||
|
|
||||||
} // end mapnik namespace
|
} // end mapnik namespace
|
||||||
|
|
||||||
#endif
|
#endif // MAPNIK_GLYPH_SYMBOLIZER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,11 +19,11 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef GRADIENT_HPP
|
#ifndef MAPNIK_GRADIENT_HPP
|
||||||
#define GRADIENT_HPP
|
#define MAPNIK_GRADIENT_HPP
|
||||||
|
|
||||||
|
// agg
|
||||||
#include <agg_trans_affine.h>
|
#include <agg_trans_affine.h>
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
@ -104,4 +104,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //GRADIENT_HPP
|
#endif // MAPNIK_GRADIENT_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: graphics.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_GRAPHICS_HPP
|
||||||
|
#define MAPNIK_GRAPHICS_HPP
|
||||||
#ifndef GRAPHICS_HPP
|
|
||||||
#define GRAPHICS_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/color.hpp>
|
#include <mapnik/color.hpp>
|
||||||
|
@ -520,4 +518,5 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif //GRAPHICS_HPP
|
|
||||||
|
#endif // MAPNIK_GRAPHICS_HPP
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef MAPNIK_GRID_PIXFMT_HPP
|
#ifndef MAPNIK_GRID_PIXFMT_HPP
|
||||||
#define MAPNIK_GRID_PIXFMT_HPP
|
#define MAPNIK_GRID_PIXFMT_HPP
|
||||||
|
|
||||||
#include <string.h>
|
#include <string>
|
||||||
#include "agg_basics.h"
|
#include "agg_basics.h"
|
||||||
#include <mapnik/grid/grid_pixel.hpp>
|
#include <mapnik/grid/grid_pixel.hpp>
|
||||||
#include <mapnik/grid/grid_rendering_buffer.hpp>
|
#include <mapnik/grid/grid_rendering_buffer.hpp>
|
||||||
|
|
|
@ -50,7 +50,10 @@ static inline void scale_grid(mapnik::grid::data_type & target,
|
||||||
int th2 = target_height/2;
|
int th2 = target_height/2;
|
||||||
int offs_x = rint((source_width-target_width-x_off_f*2*source_width)/2);
|
int offs_x = rint((source_width-target_width-x_off_f*2*source_width)/2);
|
||||||
int offs_y = rint((source_height-target_height-y_off_f*2*source_height)/2);
|
int offs_y = rint((source_height-target_height-y_off_f*2*source_height)/2);
|
||||||
unsigned yprt, yprt1, xprt, xprt1;
|
unsigned yprt(0);
|
||||||
|
unsigned yprt1(0);
|
||||||
|
unsigned xprt(0);
|
||||||
|
unsigned xprt1(0);
|
||||||
|
|
||||||
//no scaling or subpixel offset
|
//no scaling or subpixel offset
|
||||||
if (target_height == source_height && target_width == source_width && offs_x == 0 && offs_y == 0){
|
if (target_height == source_height && target_width == source_width && offs_x == 0 && offs_y == 0){
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,10 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef _HEXTREE_HPP_
|
#ifndef MAPNIK_HEXTREE_HPP
|
||||||
#define _HEXTREE_HPP_
|
#define MAPNIK_HEXTREE_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
|
@ -455,4 +454,4 @@ private:
|
||||||
};
|
};
|
||||||
} // namespace mapnik
|
} // namespace mapnik
|
||||||
|
|
||||||
#endif // _HEXTREE_HPP_
|
#endif // MAPNIK_HEXTREE_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,11 +20,10 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_HIT_TEST_FILTER_HPP
|
||||||
|
#define MAPNIK_HIT_TEST_FILTER_HPP
|
||||||
#ifndef HIT_TEST_FILTER_HPP
|
|
||||||
#define HIT_TEST_FILTER_HPP
|
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
@ -54,4 +53,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HIT_TEST_FILTER_HPP
|
#endif // MAPNIK_HIT_TEST_FILTER_HPP
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_IMAGE_COMPOSITING_HPP
|
||||||
|
#define MAPNIK_IMAGE_COMPOSITING_HPP
|
||||||
#ifndef IMAGE_COMPOSITING_HPP
|
|
||||||
#define IMAGE_COMPOSITING_HPP
|
|
||||||
|
|
||||||
// agg
|
// agg
|
||||||
#include "agg_rendering_buffer.h"
|
#include "agg_rendering_buffer.h"
|
||||||
|
@ -186,4 +184,4 @@ void composite(T1 & im, T2 & im2, composite_mode_e mode)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // IMAGE_COMPOSITING_HPP
|
#endif // MAPNIK_IMAGE_COMPOSITING_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,12 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: image_data.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_IMAGE_DATA_HPP
|
||||||
|
#define MAPNIK_IMAGE_DATA_HPP
|
||||||
#ifndef IMAGE_DATA_HPP
|
|
||||||
#define IMAGE_DATA_HPP
|
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
@ -139,4 +140,4 @@ typedef ImageData<unsigned> image_data_32;
|
||||||
typedef ImageData<byte> image_data_8;
|
typedef ImageData<byte> image_data_8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //IMAGE_DATA_HPP
|
#endif // MAPNIK_IMAGE_DATA_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,13 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: image_reader.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_IMAGE_READER_HPP
|
||||||
|
#define MAPNIK_IMAGE_READER_HPP
|
||||||
|
|
||||||
#ifndef IMAGE_READER_HPP
|
|
||||||
#define IMAGE_READER_HPP
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/image_data.hpp>
|
#include <mapnik/image_data.hpp>
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -63,4 +63,4 @@ MAPNIK_DECL image_reader* get_image_reader(const std::string& file);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //IMAGE_READER_HPP
|
#endif // MAPNIK_IMAGE_READER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,10 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: image_util.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_IMAGE_UTIL_HPP
|
||||||
|
#define MAPNIK_IMAGE_UTIL_HPP
|
||||||
#ifndef IMAGE_UTIL_HPP
|
|
||||||
#define IMAGE_UTIL_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
|
@ -292,10 +290,13 @@ template MAPNIK_DECL std::string save_to_string<image_data_32>(image_data_32 con
|
||||||
rgba_palette const&);
|
rgba_palette const&);
|
||||||
|
|
||||||
template MAPNIK_DECL std::string save_to_string<image_view<image_data_32> > (image_view<image_data_32> const&,
|
template MAPNIK_DECL std::string save_to_string<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
std::string const&,
|
std::string const&);
|
||||||
|
|
||||||
|
template MAPNIK_DECL std::string save_to_string<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
|
std::string const&,
|
||||||
rgba_palette const&);
|
rgba_palette const&);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //IMAGE_UTIL_HPP
|
#endif // MAPNIK_IMAGE_UTIL_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,11 +20,8 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_IMAGE_VIEW_HPP
|
||||||
|
#define MAPNIK_IMAGE_VIEW_HPP
|
||||||
#ifndef IMAGE_VIEW_HPP
|
|
||||||
#define IMAGE_VIEW_HPP
|
|
||||||
|
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
|
||||||
|
@ -107,5 +104,5 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // IMAGE_VIEW_HPP
|
#endif // MAPNIK_IMAGE_VIEW_HPP
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_JPEG_IO_HPP
|
#ifndef MAPNIK_JPEG_IO_HPP
|
||||||
#define MAPNIK_JPEG_IO_HPP
|
#define MAPNIK_JPEG_IO_HPP
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,13 +20,12 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_LABEL_COLLISION_DETECTOR_HPP
|
||||||
|
#define MAPNIK_LABEL_COLLISION_DETECTOR_HPP
|
||||||
#ifndef LABEL_COLLISION_DETECTOR_HPP
|
|
||||||
#define LABEL_COLLISION_DETECTOR_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/quad_tree.hpp>
|
#include <mapnik/quad_tree.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unicode/unistr.h>
|
#include <unicode/unistr.h>
|
||||||
|
@ -69,7 +68,7 @@ class label_collision_detector2 : boost::noncopyable
|
||||||
typedef quad_tree<box2d<double> > tree_t;
|
typedef quad_tree<box2d<double> > tree_t;
|
||||||
tree_t tree_;
|
tree_t tree_;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit label_collision_detector2(box2d<double> const& extent)
|
explicit label_collision_detector2(box2d<double> const& extent)
|
||||||
: tree_(extent) {}
|
: tree_(extent) {}
|
||||||
|
|
||||||
|
@ -138,6 +137,7 @@ public:
|
||||||
//quad tree based label collission detector so labels dont appear within a given distance
|
//quad tree based label collission detector so labels dont appear within a given distance
|
||||||
class label_collision_detector4 : boost::noncopyable
|
class label_collision_detector4 : boost::noncopyable
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
struct label
|
struct label
|
||||||
{
|
{
|
||||||
label(box2d<double> const& b) : box(b) {}
|
label(box2d<double> const& b) : box(b) {}
|
||||||
|
@ -146,11 +146,13 @@ class label_collision_detector4 : boost::noncopyable
|
||||||
box2d<double> box;
|
box2d<double> box;
|
||||||
UnicodeString text;
|
UnicodeString text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
typedef quad_tree< label > tree_t;
|
typedef quad_tree< label > tree_t;
|
||||||
tree_t tree_;
|
tree_t tree_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef tree_t::query_iterator query_iterator;
|
||||||
|
|
||||||
explicit label_collision_detector4(box2d<double> const& extent)
|
explicit label_collision_detector4(box2d<double> const& extent)
|
||||||
: tree_(extent) {}
|
: tree_(extent) {}
|
||||||
|
@ -224,7 +226,10 @@ public:
|
||||||
{
|
{
|
||||||
return tree_.extent();
|
return tree_.extent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query_iterator begin() { return tree_.query_in_box(extent()); }
|
||||||
|
query_iterator end() { return tree_.query_end(); }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LABEL_COLLISION_DETECTOR_HPP
|
#endif // MAPNIK_LABEL_COLLISION_DETECTOR_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,10 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef LABEL_PLACEMENT_HPP
|
#ifndef MAPNIK_LABEL_PLACEMENT_HPP
|
||||||
#define LABEL_PLACEMENT_HPP
|
#define MAPNIK_LABEL_PLACEMENT_HPP
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
@ -51,4 +50,4 @@ public:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //LABEL_PLACEMENT_HPP
|
#endif // MAPNIK_LABEL_PLACEMENT_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,10 +19,10 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id: layer.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
|
||||||
|
|
||||||
#ifndef LAYER_HPP
|
#ifndef MAPNIK_LAYER_HPP
|
||||||
#define LAYER_HPP
|
#define MAPNIK_LAYER_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
|
@ -217,4 +217,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //LAYER_HPP
|
#endif // MAPNIK_LAYER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,11 +20,13 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LIBXML2_LOADER_INCLUDED
|
#ifndef MAPNIK_LIBXML2_LOADER_HPP
|
||||||
#define LIBXML2_LOADER_INCLUDED
|
#define MAPNIK_LIBXML2_LOADER_HPP
|
||||||
|
|
||||||
|
// boost
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
|
@ -33,4 +35,4 @@ void read_xml2( std::string const & filename, boost::property_tree::ptree & pt);
|
||||||
void read_xml2_string( std::string const & str, boost::property_tree::ptree & pt, std::string const & base_path="");
|
void read_xml2_string( std::string const & str, boost::property_tree::ptree & pt, std::string const & base_path="");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LIBXML2_LOADER_INCLUDED
|
#endif // MAPNIK_LIBXML2_LOADER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,10 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id: polygon_symbolizer.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
|
||||||
|
|
||||||
#ifndef LINE_PATTERN_SYMBOLIZER_HPP
|
#ifndef MAPNIK_LINE_PATTERN_SYMBOLIZER_HPP
|
||||||
#define LINE_PATTERN_SYMBOLIZER_HPP
|
#define MAPNIK_LINE_PATTERN_SYMBOLIZER_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/symbolizer.hpp>
|
#include <mapnik/symbolizer.hpp>
|
||||||
|
@ -38,4 +37,4 @@ struct MAPNIK_DECL line_pattern_symbolizer :
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LINE_PATTERN_SYMBOLIZER_HPP
|
#endif // MAPNIK_LINE_PATTERN_SYMBOLIZER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,11 +19,11 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id: line_symbolizer.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
|
||||||
|
|
||||||
#ifndef LINE_SYMBOLIZER_HPP
|
#ifndef MAPNIK_LINE_SYMBOLIZER_HPP
|
||||||
#define LINE_SYMBOLIZER_HPP
|
#define MAPNIK_LINE_SYMBOLIZER_HPP
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/stroke.hpp>
|
#include <mapnik/stroke.hpp>
|
||||||
#include <mapnik/symbolizer.hpp>
|
#include <mapnik/symbolizer.hpp>
|
||||||
#include <mapnik/enumeration.hpp>
|
#include <mapnik/enumeration.hpp>
|
||||||
|
@ -82,4 +82,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //LINE_SYMBOLIZER_HPP
|
#endif // MAPNIK_LINE_SYMBOLIZER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,16 +19,18 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
// $Id$
|
|
||||||
|
|
||||||
#ifndef MAP_LOADER_HPP
|
#ifndef MAPNIK_LOAD_MAP_HPP
|
||||||
#define MAP_LOADER_HPP
|
#define MAPNIK_LOAD_MAP_HPP
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/map.hpp>
|
#include <mapnik/map.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
|
@ -37,4 +39,4 @@ MAPNIK_DECL void load_map(Map & map, std::string const& filename, bool strict =
|
||||||
MAPNIK_DECL void load_map_string(Map & map, std::string const& str, bool strict = false, std::string const& base_path="");
|
MAPNIK_DECL void load_map_string(Map & map, std::string const& str, bool strict = false, std::string const& base_path="");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LOAD_MAP_HPP
|
#endif // MAPNIK_LOAD_MAP_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,13 +19,12 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
//$Id: map.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
|
||||||
|
|
||||||
#ifndef MAP_HPP
|
#ifndef MAPNIK_MAP_HPP
|
||||||
#define MAP_HPP
|
#define MAPNIK_MAP_HPP
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
@ -461,4 +460,4 @@ private:
|
||||||
DEFINE_ENUM(aspect_fix_mode_e,Map::aspect_fix_mode);
|
DEFINE_ENUM(aspect_fix_mode_e,Map::aspect_fix_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAP_HPP
|
#endif // MAPNIK_MAP_HPP
|
||||||
|
|
|
@ -20,21 +20,19 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
#ifndef MAPNIK_MAPPED_MEMORY_CACHE_HPP
|
||||||
|
#define MAPNIK_MAPPED_MEMORY_CACHE_HPP
|
||||||
#ifndef MEMORY_REGION_CACHE_HPP
|
|
||||||
#define MEMORY_REGION_CACHE_HPP
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/config.hpp>
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <boost/interprocess/mapped_region.hpp>
|
#include <boost/interprocess/mapped_region.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
#ifdef MAPNIK_THREADSAFE
|
#ifdef MAPNIK_THREADSAFE
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,5 +59,5 @@ struct MAPNIK_DECL mapped_memory_cache :
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // MAPNIK_MARKER_CACHE_HPP
|
#endif // MAPNIK_MAPPED_MEMORY_CACHE_HPP
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,18 +20,19 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id: image_data.hpp 39 2005-04-10 20:39:53Z pavlenko $
|
#ifndef MAPNIK_MARKER_HPP
|
||||||
|
#define MAPNIK_MARKER_HPP
|
||||||
#ifndef MARKER_HPP
|
|
||||||
#define MARKER_HPP
|
|
||||||
|
|
||||||
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/image_data.hpp>
|
#include <mapnik/image_data.hpp>
|
||||||
#include <mapnik/svg/svg_path_attributes.hpp>
|
#include <mapnik/svg/svg_path_attributes.hpp>
|
||||||
#include <mapnik/svg/svg_storage.hpp>
|
#include <mapnik/svg/svg_storage.hpp>
|
||||||
#include <mapnik/svg/svg_path_adapter.hpp>
|
#include <mapnik/svg/svg_path_adapter.hpp>
|
||||||
|
|
||||||
|
// agg
|
||||||
#include "agg_path_storage.h"
|
#include "agg_path_storage.h"
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
|
// stl
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
@ -125,4 +127,4 @@ private:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MARKER_HPP
|
#endif // MAPNIK_MARKER_HPP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Artem Pavlenko
|
* Copyright (C) 2011 Artem Pavlenko
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//$Id$
|
|
||||||
|
|
||||||
#ifndef MAPNIK_MARKER_CACHE_HPP
|
#ifndef MAPNIK_MARKER_CACHE_HPP
|
||||||
#define MAPNIK_MARKER_CACHE_HPP
|
#define MAPNIK_MARKER_CACHE_HPP
|
||||||
|
|
||||||
|
@ -32,8 +30,10 @@
|
||||||
#include <mapnik/svg/svg_path_attributes.hpp>
|
#include <mapnik/svg/svg_path_attributes.hpp>
|
||||||
#include <mapnik/svg/svg_storage.hpp>
|
#include <mapnik/svg/svg_storage.hpp>
|
||||||
#include <mapnik/svg/svg_path_adapter.hpp>
|
#include <mapnik/svg/svg_path_adapter.hpp>
|
||||||
|
|
||||||
// agg
|
// agg
|
||||||
#include "agg_path_storage.h"
|
#include "agg_path_storage.h"
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue