Compare commits

...

135 commits

Author SHA1 Message Date
Blake Thompson
af95ca85e9 Updated tests 2017-06-13 07:47:23 -05:00
Blake Thompson
061b29f108 Restoring the way filter factors operate so that select algorithms still are passed variables in the form of filter factor to change their operation. Added this operation to raster plugin where it never existed prior. Additionally added a test that was created for #3698 proving that it is not currently an issue 2017-06-13 07:31:17 -05:00
artemp
08d8746b3a update visual-data 2017-06-13 13:24:11 +02:00
artemp
d2627dfad8 tiff_reader - fix num_rows logic in read_stripped method ref #3679 2017-06-12 17:56:33 +02:00
artemp
bc528e4c8f Update SHA 2017-06-06 17:44:26 +02:00
artemp
2b42e174fd Update after #3696 2017-06-06 17:42:15 +02:00
Artem Pavlenko
0c1863aa7e Merge pull request #3696 from mapnik/raster_limit
Fixes bug in raster plugin
2017-06-06 17:25:05 +02:00
Blake Thompson
a35a064ce4 Fixes bug in raster plugin 2017-06-06 10:11:53 -05:00
artemp
735eeb4702 CHANGELOG - update release date + SHA [skip ci] 2017-06-05 16:26:51 +02:00
artemp
7660b9e74a update CHANGELOG for mapnik v3.0.14 release [skip ci] 2017-06-05 10:34:54 +02:00
artemp
5b88f687a1 Scons - update to 2.5.1 2017-06-05 10:29:21 +02:00
artemp
c4fb727076 bump version to 3.0.14 2017-06-02 20:25:13 +02:00
artemp
75e7a44c90 Merge branch 'webp_tests' into v3.0.x 2017-06-02 20:15:51 +02:00
Blake Thompson
3fcd54123c Updated data-visual with tiff changes 2017-06-02 12:38:39 -05:00
artemp
d6bf258f3a Merge branch 'webp_tests' into v3.0.x 2017-06-02 18:32:08 +02:00
Blake Thompson
20fd003618 Added new tests for webp data 2017-06-01 15:38:00 -05:00
artemp
9940193c0b return error code when no feature can be read from shapefile + update unit test (ref #3198) 2017-06-01 15:45:14 +02:00
artemp
9f19fa8943 freetype_engine : revert back to original APIs usage.
This reverts commit 1c101c3243.
2017-06-01 12:35:14 +02:00
Artem Pavlenko
98fa7699f3 Merge pull request #3688 from mapnik/font-engine-singleton
make font-engine-singleton to have better control over objects life-t…
2017-06-01 11:31:18 +02:00
artemp
c09f6a8434 freetype_engine - re-use base class mutex. 2017-06-01 10:51:59 +02:00
artemp
d1327dea88 freetype_engine - preserve original intetface via static methods + make impl methods private. 2017-06-01 10:45:09 +02:00
Dane Springmeyer
e4b5ddb1aa add missing include / fix windows compile 2017-05-31 12:50:27 -07:00
Dane Springmeyer
ce47610677 update font path in test file 2017-05-31 10:41:34 -07:00
artemp
648f9698a0 use sigleton interface when calling freetype_engine methods. 2017-05-30 12:53:20 +02:00
artemp
a054ee0a31 c++ minor formatting. 2017-05-29 12:33:32 +02:00
artemp
4d6a1c5cfc font_engine_freetype - remove default constructor and virtual destructor (??). 2017-05-29 10:46:40 +02:00
artemp
3b6f3ff36f c++ formatting 2017-05-29 10:46:21 +02:00
artemp
1c101c3243 make font-engine-singleton to have better control over objects life-time. 2017-05-26 16:52:50 +02:00
Dane Springmeyer
e6173385ca use latest version of mason 2017-05-25 11:31:16 -07:00
artemp
09933916d6 fix spelling 2017-05-19 14:40:47 +02:00
artemp
185d788ea4 Backport TIFF I/O fixes from master (ref #3669 #3670) 2017-05-19 13:47:11 +02:00
artemp
99a7fa5044 Revert "update visual data one more time." : wrong branch
This reverts commit de533ab712.
2017-05-17 21:21:02 +02:00
artemp
de533ab712 update visual data one more time. 2017-05-17 21:17:11 +02:00
Blake Thompson
125cd694b8 Updated changelog 2017-05-12 12:16:25 -05:00
Blake Thompson
5911fe6374 Merge pull request #3668 from mapnik/raster_overzoom_quest
Raster Overzoom Quest
2017-05-12 11:48:34 -05:00
Blake Thompson
b29e56051c Merge branch 'v3.0.x' into raster_overzoom_quest 2017-05-12 10:59:32 -05:00
Blake Thompson
7222129e6c Update visual test data to 3.0.x branch 2017-05-12 10:55:48 -05:00
artemp
ab783cbec4 Merge branch 'raster_overzoom_quest' of https://github.com/mapnik/mapnik into raster_overzoom_quest 2017-05-12 15:25:44 +02:00
Blake Thompson
baf6c9f321 Updated tests, changed boostrap to use latest released mason 2017-05-11 09:57:18 -05:00
Blake Thompson
e945eb74fe Merge pull request #3672 from mapnik/filter_factor_removal
Removed filter factor
2017-05-10 16:02:17 -05:00
Blake Thompson
bc9dcdc584 Updated visual test data 2017-05-10 13:31:11 -05:00
Dane Springmeyer
2fd1f098f5 update to latest 3.0.x test-data-visual branch 2017-05-10 10:06:31 -07:00
Blake Thompson
318be793f9 Removed filter factor 2017-05-10 09:04:29 -05:00
Blake Thompson
adacb16a2c Removed 0.5 limit on width and height in gdal plugin, added new visual tests 2017-05-09 12:15:03 -05:00
artemp
85d7f28610 remove QMAKE_MAC_SDK requirement - just use what is available 2017-05-09 09:54:51 +02:00
Blake Thompson
170e20e864 First attempt at making raster overzooming and scaling work correctly and handle offsets properly. 2017-05-08 22:37:35 -05:00
Dane Springmeyer
b53db334af link -ldl last 2017-04-19 18:30:34 -07:00
Dane Springmeyer
1632018a14 pgsql2sqlite:also link -ldl on linux 2017-04-19 18:10:03 -07:00
artemp
9f4a138b8b fix formatting 2017-04-06 10:43:12 +01:00
artemp
149d2ca0a1 Avoid using c++14 extensions as v3.0.x should only require c++11 compliant compiler (fixes #3645). 2017-03-29 10:09:48 +01:00
Dane Springmeyer
635af3f4a3 point at 3.0.x branch of visual test data - refs mapnik/test-data-visual#46 2017-03-28 15:47:12 -07:00
Dane Springmeyer
9c4613f934 remove explicit instantiation of 'image_view<mapnik::image<mapnik::null_t> >' that occurs after an explicit specialization has no effect [-Winstantiation-after-specialization] (clang 4.x) 2017-03-28 15:25:17 -07:00
Dane Springmeyer
520f3fd0a0 improve check padding script to see deps via submodules 2017-03-28 15:18:48 -07:00
artemp
15fb2debb0 fix compilation - auto args in lambda is c++14 oops 2017-03-23 16:21:38 +00:00
artemp
fa549b380a GeoJSON IO test - ensure geometries round-trip. 2017-03-23 15:01:50 +00:00
artemp
60d891f094 add "invalid" empty geometry tests 2017-03-22 15:07:07 +00:00
artemp
7caa0cffd4 from_geojson - catch all exceptions. 2017-03-22 15:06:34 +00:00
artemp
dbbf18c752 GeoJSON test - add empty geometries tests. 2017-03-22 14:41:08 +00:00
artemp
a1084e0c09 port GeoJSON parser/generator logic from master 2017-03-22 14:40:07 +00:00
Dane Springmeyer
c2fd522d0f remove mason latest publishing and triggered builds - refs #3639 2017-03-19 17:57:10 -07:00
Dane Springmeyer
dfccc5f6bb Merge pull request #3640 from mapnik/build-fixes
v3.0.x build fixes
2017-03-19 13:07:42 -07:00
Dane Springmeyer
284842a9d3 Merge pull request #3641 from mapnik/v3.0.x-more-dep-updates
Update mason deps
2017-03-19 12:39:30 -07:00
Dane Springmeyer
40753edadc Merge branch 'v3.0.x-more-dep-updates' into build-fixes 2017-03-19 12:38:57 -07:00
Dane Springmeyer
e0db6b9a47 consistently use pkg-config in both postgis plugin and pgsql2sqlite + use GDAL_CONFIG var in plugins 2017-03-18 19:40:18 -07:00
Dane Springmeyer
91515cad69 update sqlite, icu, ccache, and libpq 2017-03-18 19:39:09 -07:00
Dane Springmeyer
0c232313d6 update visual test down now that mapnik/test-data-visual#44 is merged 2017-03-10 16:51:46 -08:00
Dane Springmeyer
8665fc7313 Merge pull request #3614 from mapnik/3.0.x-mason-upgrades
3.0.x mason upgrades
2017-03-10 14:58:14 -08:00
Dane Springmeyer
08822729cc use zlib 1.2.8 package 2017-03-09 17:26:17 -08:00
Dane Springmeyer
f8e5f146ec update mason version 2017-03-09 17:20:31 -08:00
Dane Springmeyer
07de7155f1 upgrade to latest harfbuzz 2017-03-09 17:10:34 -08:00
Mickey Rose
3fbe7f61a6 load_map: avoid segfault when ShieldSymbolizer has invalid placements 2017-02-22 03:21:48 +01:00
Dane Springmeyer
3706fcf587 use mason v0.7.0 2017-02-09 18:00:01 -08:00
Dane Springmeyer
947ac81ee4 point at mason master until mason is tagged 2017-02-08 19:24:33 -08:00
Dane Springmeyer
163af7a40f update test-data - refs mapnik/test-data-visual#44 2017-02-08 17:31:46 -08:00
Dane Springmeyer
55e3e14f4d more code coverage adjustments 2017-02-08 15:05:48 -08:00
Dane Springmeyer
7483f6328c Add codecov.yml ignores 2017-02-08 15:02:47 -08:00
Dane Springmeyer
941a7eaf69 try codecov 2017-02-08 15:02:16 -08:00
artemp
489b7f2aca fix typo 2017-02-08 14:04:59 -08:00
artemp
4c22e631a7 remove remaining usage of deprecated dymamic exceptions: dtors are implicitely noexcept + qualify what methods with noexcept 2017-02-08 13:47:02 -08:00
artemp
2845cdc121 remove bogus throw() specifier from 'add_attribute' 2017-02-08 13:46:51 -08:00
artemp
0cd3bd8737 dynamic exceptions deprecated in c++11 and removed in c++17 (http://en.cppreference.com/w/cpp/language/except_spec) 2017-02-08 13:46:40 -08:00
Dane Springmeyer
85da8ef128 port fix for std::fread from master - a220bda05d 2017-02-08 13:33:41 -08:00
Dane Springmeyer
7affd674fd remove unused var [skip ci] 2017-02-08 13:31:13 -08:00
Dane Springmeyer
1f2de83531 also upgrade libpq 2017-02-08 13:04:35 -08:00
Dane Springmeyer
887964ae97 upgrade mason deps 2017-02-08 10:57:27 -08:00
artemp
c1267ebcd5 update CHANGELOG for mapnik v3.0.13 release [skip ci] 2017-02-08 14:06:42 +01:00
Dane Springmeyer
2a153c0d1f fix linking of postgis to boost_regex (when boost regex is statically linked to icu libs) 2017-02-07 12:54:12 -08:00
artemp
4f3e6f4846 update CHANGELOG 2017-02-06 16:00:00 +01:00
Artem Pavlenko
391a9f835b Merge pull request #3612 from mapnik/v3.0.x-3611
V3.0.x ref #3611
2017-02-06 14:26:01 +01:00
artemp
74e66bac58 test - update malformed featurecollection test (ref #3611) 2017-02-03 17:36:28 +01:00
artemp
d2d62bc95c Return failure on invalid bounding box when --validate-features option is used. (ref #3611) 2017-02-03 17:23:48 +01:00
artemp
8cc7060ef1 remove bounding box validity check (ref #3611) 2017-02-03 17:20:25 +01:00
Artem Pavlenko
e35bca7381 Merge pull request #3610 from mapnik/v3.0.x-3609
GeoJSON - backport positions grammar changes from master, fixes #3609
2017-02-03 11:28:22 +01:00
artemp
6cb3bce2d7 GeoJSON - backport positions grammar changes from master, fixes #3609 2017-02-03 11:22:24 +01:00
lightmare
17dcffaf78 Merge pull request #3583 from mapnik/v3.0.x-cherry-pr3566
v3.0.x cherry-pick #3566
2017-02-02 15:32:29 +01:00
Dane Springmeyer
1a268343a9 fix clang++ package name 2017-02-01 21:57:34 -08:00
Dane Springmeyer
7578534dc8 pass std::string to std::out_of_range 2017-02-01 21:54:27 -08:00
Dane Springmeyer
adcf611fab upgrad clang++ on circle too 2017-01-31 16:34:50 -08:00
Dane Springmeyer
8f06db6ac0 ensure mason check works via tag 2017-01-31 16:32:50 -08:00
Dane Springmeyer
401aade813 use clang++ 3.9.1 / pin mason to v0.5.0 2017-01-31 16:18:55 -08:00
artemp
ab206321b5 update version to 3.0.13 2017-01-20 14:40:35 +01:00
artemp
5db03aeb03 update test-data 2017-01-19 11:14:20 +01:00
artemp
2db538c470 update in prep for v3.0.13 release 2017-01-18 14:27:49 +01:00
artemp
8a3a380b3b fix blank line test for require headers.size() == 1 + reduce stderr verbosity. 2017-01-18 10:16:44 +01:00
artemp
ff4a1c1e9b use variant v1.1.5 2017-01-18 10:09:52 +01:00
Dane Springmeyer
7ce68e2c08 fix variant_io include 2017-01-04 15:22:36 -08:00
Dane Springmeyer
5b1c5f83cb Avoid -Winstantiation-after-specialization warnings 2017-01-04 15:08:08 -08:00
Dane Springmeyer
5d28a25ad3 Point as latest mason rather than branch 2017-01-04 11:45:55 -08:00
Artem Pavlenko
c71c1bc0a8 Merge pull request #3586 from lightmare/v3.0.x-groupsym-thunk-list
backport render_thunk_list change #3585 to v3.0.x branch
2017-01-04 10:30:05 +01:00
Mickey Rose
63128fdba1 can't store noncopyable list in std::vector
std::list can have a throwing move constructor.
std::vector of such lists makes copies when growing its storage array,
it doesn't move them.
render_thunk_list is noncopyable (because render_thunk is noncopyable),
and so can't be stored in std::vector in some STL implementations.
2017-01-03 22:53:39 +01:00
Mickey Rose
0a5495e442 change render_thunk_list to std::list<render_thunk>
Wrapping render_thunk in std::unique_ptr is one extra allocation per
element, with no purpose. The somewhat costly xyz_render_thunk move
constructor is only called once upon insertion, regardless of whether
we're emplacing render_thunk or unique_ptr.
2017-01-03 22:53:39 +01:00
Jiri Drbalek
b5c04cc132 find max element instead of std::sort 2017-01-02 03:53:53 +01:00
Jiri Drbalek
cdefee3524 remove redundant code 2017-01-02 03:53:53 +01:00
Dane Springmeyer
47443526a0 Merge pull request #3580 from mapnik/v3.0.x-cherry
Cherry pick stable commits from master into v3.0.x branch
2016-12-21 11:44:34 -08:00
Dane Springmeyer
a3b4e1f575 remove duplicate sudo:false from travis 2016-12-15 13:33:29 -08:00
Dane Springmeyer
283481b347 backport warnings fix from master for enumeration 2016-12-15 11:33:23 -08:00
Mickey Rose
fdd542a3c4 make mapnik_value_type_t C++11-friendly 2016-12-15 12:13:42 +01:00
Mickey Rose
06201e3842 bring C++14 type traits aliases for C++11 support 2016-12-15 12:12:12 +01:00
Dane Springmeyer
96ce2d8b3b update to latest variant 2016-12-14 18:25:41 -08:00
Mickey Rose
f00470dc02 simplify mapnik::value conversion rules
- fixes #3570

- avoids recursive exception-specification on value constructor
  by only constructing a temporary for arithmetic types (everything
  else passes a reference to the base variant constructor)

- also removes `is_same<decay_t<T>, value>` SFINAE check -- because
  we're only passing a reference down, explicitly forcing the compiler
  to use the implicitly-defined copy/move instead is pointless
2016-12-14 18:24:32 -08:00
artemp
dd5c134f01 update test to use std::unordered_map<mapnik::value, mapnik::value> 2016-12-14 18:24:29 -08:00
artemp
7c41b835ca use latest mapbox::variant 2016-12-14 18:24:26 -08:00
artemp
641cd6555e expand std::hash<mapnik::value> and operator== test for all types in mapnik::value 2016-12-14 18:24:22 -08:00
artemp
fa2d63c601 remove hash_combine (unused) 2016-12-14 18:24:19 -08:00
artemp
204d30e58d simplify hash calculation (we don't need combine with which(), using hash<T> is sufficient) 2016-12-14 18:24:15 -08:00
artemp
8dee1a9088 use mapbox namespace to fix name resolution 2016-12-14 18:23:02 -08:00
Mickey Rose
2b3fdf1bc9 fix #3526 GroupSymbolizer PairLayout with 3+ items 2016-12-14 18:21:52 -08:00
Jiri Drbalek
701a459427 duplicate code elimination 2016-12-14 18:21:30 -08:00
Dane Springmeyer
335c3e4265 allow visual test failures with g++ https://github.com/mapnik/mapnik/issues/3567 2016-12-14 18:21:18 -08:00
Dane Springmeyer
4cd55330dd avoid -Wshadow and 'unrecognized command line option' with gcc 2016-12-14 18:21:03 -08:00
Dane Springmeyer
b2f7bea7b5 try g++6 on precise 2016-12-14 18:20:52 -08:00
Dane Springmeyer
d5a9322a11 use clang 3.9, g++-6 2016-12-14 18:20:43 -08:00
Dane Springmeyer
d378ddbf66 mason packages are currently built with -D_GLIBCXX_USE_CXX11_ABI=0 2016-12-14 18:20:10 -08:00
Jiri Drbalek
27a0f3562d remove methods that are not referenced anywhere 2016-12-14 18:19:54 -08:00
artemp
4d4ea3a576 Fix clang >= 3.9.0 compilation by using mapbox::util::variant as alias (via deps/mapbox/variant => "types" branch) 2016-12-14 18:18:50 -08:00
283 changed files with 1818 additions and 1838 deletions

2
.gitmodules vendored
View file

@ -5,7 +5,7 @@
[submodule "test/data-visual"]
path = test/data-visual
url = https://github.com/mapnik/test-data-visual.git
branch = master
branch = 3.0.x
[submodule "deps/mapbox/variant"]
path = deps/mapbox/variant
url = https://github.com/mapbox/variant.git

View file

@ -10,8 +10,6 @@ env:
- CCACHE_COMPRESS=1
- HEAVY_JOBS="2"
- PREFIX=/tmp/mapnik
- secure: "D5CLP5lbyFru788iZO8RqDenY/YsHPREvr34zCEi93xMqOTxPmME/zyuEZSyjP5ZLyf8g/fxOuPYSDbOQ1QLwNDBWxB0JomWOahyimHKrMCrMcGHCjl//2W2mE+p9VwF5VLGgfy7CskGkS49Mye37FDK0ejwuq6MDI45DsH4Fkk="
- secure: "ZPHyAVL3ID5g3KEmwcnzG9z2tAQwSx526Qd3Y6tsZ3Yj+aSagVBiZQjZGKWgNX74lymtmYKnb2Md46apWLeImt6tjB3MWTu7WwWoZRnqUligz/8Nmg4Lgo7EOCkQcjN/gpA1i+cM5b+ZKDTZYOaHO6/+DAaunQzA7/p99hw/XYg="
- secure: "F6ivqDNMBQQnrDGA9+7IX+GDswuIqQQd7YPJdQqa2Ked9jddAQDeJClb05ig3JlwfOlYLGZOd43ZX0pKuMtI2Gbkwz211agGP9S3YunwlRg8iWtJlO5kYFUdKCmJNhjg4icfkGELCgwXn+zuEWFSLpkPcjqAFKFlQrIJeAJJgKM="
addons:
postgresql: "9.4"
@ -25,24 +23,32 @@ matrix:
- os: linux
sudo: false
compiler: ": clang"
env: JOBS=8 MASON_PUBLISH=true CXX="ccache clang++-3.8 -Qunused-arguments" CC="clang-3.8" TRIGGER=true
env: JOBS=4 CXX="ccache g++-6" CC="gcc-6"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test']
packages: [ 'libstdc++-5-dev', 'xutils-dev']
packages: [ 'libstdc++-6-dev', 'g++-6', 'xutils-dev']
- os: linux
sudo: false
compiler: ": clang"
env: JOBS=8 CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9" TRIGGER=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test']
packages: [ 'libstdc++-4.9-dev', 'xutils-dev']
- os: linux
sudo: false
compiler: ": clang-coverage"
env: JOBS=8 COVERAGE=true CXX="ccache clang++-3.8 -Qunused-arguments" CC="clang-3.8"
env: JOBS=8 COVERAGE=true CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'xutils-dev' ]
packages: ['libstdc++-4.9-dev', 'xutils-dev' ]
- os: osx
compiler: ": clang-osx"
# https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
osx_image: xcode7.3 # upgrades clang from 6 -> 7
env: JOBS=4 MASON_PUBLISH=true CXX="ccache clang++ -Qunused-arguments"
env: JOBS=4 CXX="ccache clang++ -Qunused-arguments"
before_install:
# workaround travis rvm bug
@ -52,18 +58,12 @@ before_install:
rvm get head || true
fi
- source scripts/travis-common.sh
- export PYTHONUSERBASE=$(pwd)/mason_packages/.link
- export PATH=${PREFIX}/bin:$(pwd)/mason_packages/.link/bin:${PYTHONUSERBASE}/bin:${PATH}
- export PATH=${PREFIX}/bin:$(pwd)/mason_packages/.link/bin:${PATH}
- export COVERAGE=${COVERAGE:-false}
- export MASON_PUBLISH=${MASON_PUBLISH:-false}
- export BENCH=${BENCH:-false}
- if [[ ${TRAVIS_BRANCH} != 'master' ]]; then export MASON_PUBLISH=false; fi
- if [[ ${TRAVIS_PULL_REQUEST} != 'false' ]]; then export MASON_PUBLISH=false; fi
- git_submodule_update --init --depth=10
install:
- on 'linux' export PYTHONPATH=${PYTHONUSERBASE}/lib/python2.7/site-packages
- on 'osx' export PYTHONPATH=${PYTHONUSERBASE}/lib/python/site-packages
- on 'osx' export DATA_PATH=$(brew --prefix)/var/postgres
- on 'osx' rm -rf ${DATA_PATH}
- on 'osx' initdb ${DATA_PATH} -E utf8
@ -72,16 +72,19 @@ install:
- on 'osx' createuser -s postgres
- psql -c 'create database template_postgis;' -U postgres
- psql -c 'create extension postgis;' -d template_postgis -U postgres
- enabled ${COVERAGE} pip install --user cpp-coveralls
- enabled ${COVERAGE} curl -S -f https://codecov.io/bash -o codecov
- enabled ${COVERAGE} chmod +x codecov
before_script:
- source bootstrap.sh
- |
if [[ $(uname -s) == 'Linux' ]]; then
mason install clang 3.8.0
export PATH=$(mason prefix clang 3.8.0)/bin:${PATH}
which clang++
export LLVM_COV="$(mason prefix clang 3.8.0)/bin/llvm-cov"
mason install clang++ 3.9.1
export PATH=$(mason prefix clang++ 3.9.1)/bin:${PATH}
mason install llvm-cov 3.9.1
export PATH=$(mason prefix llvm-cov 3.9.1)/bin:${PATH}
which llvm-cov
export LLVM_COV="$(mason prefix llvm-cov 3.9.1)/bin/llvm-cov"
fi
- ccache --version
- ccache -p || true
@ -98,14 +101,9 @@ script:
# (and might work) for the next build
- DURATION=2400
- scripts/travis-command-wrapper.py -s "date" -i 120 --deadline=$(( $(date +%s) + ${DURATION} )) make
- make test
- RESULT=0
- make test || RESULT=$?
# we allow visual failures with g++ for now: https://github.com/mapnik/mapnik/issues/3567
- if [[ ${RESULT} != 0 ]] && [[ ${CXX} =~ 'clang++' ]]; then false; fi;
- enabled ${COVERAGE} coverage
- enabled ${BENCH} make bench
after_success:
- enabled ${TRIGGER} trigger_downstream
- if enabled ${MASON_PUBLISH}; then
source ./.mason/mason.sh &&
./mason_latest.sh build &&
./mason_latest.sh publish;
fi
- enabled ${BENCH} make bench

View file

@ -6,6 +6,45 @@ Developers: Please commit along with changes.
For a complete change history, see the git log.
## 3.0.14
Released: June 5, 2017
(Packaged from 2b42e17)
#### Summary
- Fixed problems with high levels of overzooming in the GDAL and raster plugin where data would be slightly offset
- High levels of overzooming on raster data no longer results in the return of a transparent image.
- Fixed bug in `mapnik::util::file::data()` (a220bda05d2aa1)
- TIFF I/O - added support for grey scale multiband images + fixed and made generic `read_stripped` and `read_generic`.
- shapeindex - return error code when no features can read from shapefile (#3198)
- Upgrade Scons to `2.5.1`
- Fixed bug (typo) in `raster_featureset.cpp` (#3696)
## 3.0.13
Released: February 8, 2017
(Packaged from 2a153c0)
#### Summary
- Unbundle `unifont` font from distribution
- GeoJSON: improved parsing grammar avoiding temp synthesised attribute (#3507)
- GeoJSON: expose `num_features_to_query` datasource parameter + unit test (#3515)
- Fixed intersecting extents in different projections (PR #3525 )
- Fixed `blur` implementation by taking into account `scale_factor`
- postgis.input - use 2D box for pgraster bounding box (PR #3551)
- Fixed GroupSymbolizer PairLayout with 3+ items (#3526)
- Simplified `hash` implementation (204d30e58d3553278ab6bcda2d4122b0f13f6392)
- Simplified `mapnik::value` conversion rules (#3570)
- Changed `render_thunk_list` to `std::list<render_thunk>` (PR #3585)
- Upgraded to variant `v1.1.5`
- CSV.input - fixed `blank` line test (8a3a380b3b5c64681f2478b4f0d06f6a907f5eed)
- GeoJSON - handle empty elements in position grammar (ref #3609)
- mapnik-index - return failure on invalid bounding box (ref #3611)
## 3.0.12
Released: September 8, 2016

View file

@ -2,7 +2,7 @@
<!DOCTYPE Map[]>
<Map
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"
font-directory="../../fonts/dejavu-fonts-ttf-2.35/ttf/DejaVuSans.ttf"
font-directory="../../fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf"
background-color="#dfd8c9">
<Style name="marking" filter-mode="first">

View file

@ -11,7 +11,7 @@ todo
- shrink icu data
'
MASON_VERSION="new-pkgs"
MASON_VERSION="v0.11.1"
function setup_mason() {
if [[ ! -d ./.mason ]]; then
@ -19,7 +19,7 @@ function setup_mason() {
(cd ./.mason && git checkout ${MASON_VERSION})
else
echo "Updating to latest mason"
(cd ./.mason && git fetch && git checkout ${MASON_VERSION} && git pull)
(cd ./.mason && git fetch && git checkout ${MASON_VERSION} && git pull origin ${MASON_VERSION})
fi
export PATH=$(pwd)/.mason:$PATH
export CXX=${CXX:-clang++}
@ -44,45 +44,37 @@ function install() {
mason link $1 $2
}
ICU_VERSION="55.1"
ICU_VERSION="57.1"
function install_mason_deps() {
FAIL=0
install ccache 3.3.0 &
install zlib system &
install jpeg_turbo 1.5.0 libjpeg &
install libpng 1.6.24 libpng &
install libtiff 4.0.6 libtiff &
install libpq 9.5.2 &
install sqlite 3.14.1 libsqlite3 &
install expat 2.2.0 libexpat &
install icu ${ICU_VERSION} &
install proj 4.9.2 libproj &
install pixman 0.34.0 libpixman-1 &
install cairo 1.14.6 libcairo &
install protobuf 2.6.1 &
install ccache 3.3.1
install zlib 1.2.8
install jpeg_turbo 1.5.1 libjpeg
install libpng 1.6.28 libpng
install libtiff 4.0.7 libtiff
install libpq 9.6.2
install sqlite 3.17.0 libsqlite3
install expat 2.2.0 libexpat
install icu ${ICU_VERSION}
install proj 4.9.3 libproj
install pixman 0.34.0 libpixman-1
install cairo 1.14.8 libcairo
install protobuf 3.2.0
# technically protobuf is not a mapnik core dep, but installing
# here by default helps make mapnik-vector-tile builds easier
install webp 0.5.1 libwebp &
install gdal 2.1.1 libgdal &
install boost 1.61.0 &
install boost_libsystem 1.61.0 &
install boost_libfilesystem 1.61.0 &
install boost_libprogram_options 1.61.0 &
install boost_libregex_icu 1.61.0 &
install webp 0.6.0 libwebp
install libgdal 2.1.3 libgdal
install boost 1.63.0
install boost_libsystem 1.63.0
install boost_libfilesystem 1.63.0
install boost_libprogram_options 1.63.0
install boost_libregex_icu57 1.63.0
# technically boost thread and python are not a core dep, but installing
# here by default helps make python-mapnik builds easier
install boost_libthread 1.61.0 &
install boost_libpython 1.61.0 &
install freetype 2.6.5 libfreetype &
install harfbuzz 1.3.0 libharfbuzz &
for job in $(jobs -p)
do
wait $job || let "FAIL+=1"
done
if [[ "$FAIL" != "0" ]]; then
exit ${FAIL}
fi
install boost_libthread 1.63.0
install boost_libpython 1.63.0
install freetype 2.7.1 libfreetype
install harfbuzz 1.4.4-ft libharfbuzz
}
MASON_LINKED_ABS=$(pwd)/mason_packages/.link
@ -95,6 +87,7 @@ function make_config() {
echo "
CXX = '$CXX'
CC = '$CC'
CUSTOM_CXXFLAGS = '-D_GLIBCXX_USE_CXX11_ABI=0'
RUNTIME_LINK = 'static'
INPUT_PLUGINS = 'all'
PATH = '${MASON_LINKED_REL}/bin'

View file

@ -7,11 +7,7 @@ machine:
JOBS: 8
CCACHE_TEMPDIR: /tmp/.ccache-temp
CCACHE_COMPRESS: 1
LLVM_VERSION: 3.8
pre:
- echo "here"
post:
- echo "there"
LLVM_VERSION: 3.9.1
checkout:
post:
@ -32,9 +28,9 @@ dependencies:
database:
pre:
- ./bootstrap.sh
- ./.mason/mason install clang ${LLVM_VERSION}.0
- ./.mason/mason link clang ${LLVM_VERSION}.0
- ./configure CC="$(pwd)/mason_packages/.link/bin/clang-${LLVM_VERSION}" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++-${LLVM_VERSION} -Qunused-arguments"
- ./.mason/mason install clang++ ${LLVM_VERSION}
- ./.mason/mason link clang++ ${LLVM_VERSION}
- ./configure CC="$(pwd)/mason_packages/.link/bin/clang" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++ -Qunused-arguments"
- make
override:
- psql -c 'create database template_postgis;'

10
codecov.yml Normal file
View file

@ -0,0 +1,10 @@
ignore:
- "mason_packages"
- "benchmark"
- "deps"
- ".sconf_temp"
- "scons"
- "test"
- "demo"
- "docs"
- "fonts"

View file

@ -48,7 +48,7 @@ int main( int argc, char **argv )
{
settings.setArrayIndex(index);
QString font_dir = settings.value("dir").toString();
freetype_engine::register_fonts(font_dir.toStdString());
freetype_engine::instance().register_fonts(font_dir.toStdString());
}
settings.endArray();

View file

@ -1,7 +1,6 @@
######################################################################
# Mapnik viewer - Copyright (C) 2007 Artem Pavlenko
######################################################################
QMAKE_MAC_SDK = macosx10.11
TEMPLATE = app
QT += core gui widgets
QMAKE_CXX = $$system(mapnik-config --cxx)

2
deps/mapbox/variant vendored

@ -1 +1 @@
Subproject commit 9a115c5eb3c09509c70a57b25b283b6e1cbba919
Subproject commit d2588a8f1d6b5d480d228e6d8a906ce634bdea9a

View file

@ -116,6 +116,7 @@ public:
bool valid() const;
void move(T x, T y);
std::string to_string() const;
T area() const;
// define some operators
box2d_type& operator+=(box2d_type const& other);

View file

@ -393,6 +393,11 @@ std::string box2d<T>::to_string() const
return s.str();
}
template <typename T>
T box2d<T>::area() const
{
return width() * height();
}
template <typename T>
box2d<T>& box2d<T>::operator+=(box2d<T> const& other)
@ -466,7 +471,7 @@ T box2d<T>::operator[] (int index) const
case -1:
return maxy_;
default:
throw std::out_of_range("index out of range, max value is 3, min value is -4 ");
throw std::out_of_range(std::string("index out of range, max value is 3, min value is -4 "));
}
}

View file

@ -41,10 +41,8 @@ public:
config_error(std::string const& what,
unsigned line_number,
std::string const& filename);
virtual ~config_error() throw() {}
virtual const char * what() const throw();
virtual ~config_error() {}
virtual const char * what() const noexcept;
void append_context(std::string const& ctx) const;
void append_context(std::string const& ctx, xml_node const& node) const;
void append_context(xml_node const& node) const;

View file

@ -0,0 +1,43 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2016 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_CXX11_SUPPORT_HPP
#define MAPNIK_CXX11_SUPPORT_HPP
#include <type_traits>
namespace mapnik {
namespace detail {
template <bool B, typename T, typename F>
using conditional_t = typename std::conditional<B, T, F>::type;
template <typename T>
using decay_t = typename std::decay<T>::type;
template <bool B, typename T = void>
using enable_if_t = typename std::enable_if<B, T>::type;
} // namespace detail
} // namespace mapnik
#endif // MAPNIK_CXX11_SUPPORT_HPP

View file

@ -46,14 +46,11 @@ class MAPNIK_DECL datasource_exception : public std::exception
public:
datasource_exception(std::string const& message)
: message_(message)
{
}
{}
~datasource_exception() throw()
{
}
~datasource_exception() {}
virtual const char* what() const throw()
virtual const char* what() const noexcept
{
return message_.c_str();
}

View file

@ -28,7 +28,6 @@
#include <mapnik/debug.hpp>
// stl
#include <bitset>
#include <iostream>
#include <cstdlib>
#include <algorithm>
@ -45,9 +44,9 @@ public:
what_( _what )
{
}
virtual ~illegal_enum_value() throw() {}
virtual ~illegal_enum_value() {}
virtual const char * what() const throw()
virtual const char * what() const noexcept
{
return what_.c_str();
}
@ -190,6 +189,8 @@ public:
for (unsigned i = 0; i < THE_MAX; ++i)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas" // clang+gcc
#pragma GCC diagnostic ignored "-Wpragmas" // gcc
#pragma GCC diagnostic ignored "-Wundefined-var-template"
if (str_copy == our_strings_[i])
#pragma GCC diagnostic pop
@ -203,6 +204,8 @@ public:
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas" // clang+gcc
#pragma GCC diagnostic ignored "-Wpragmas" // gcc
#pragma GCC diagnostic ignored "-Wundefined-var-template"
throw illegal_enum_value(std::string("Illegal enumeration value '") +
str + "' for enum " + our_name_);
@ -213,6 +216,8 @@ public:
std::string as_string() const
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas" // clang+gcc
#pragma GCC diagnostic ignored "-Wpragmas" // gcc
#pragma GCC diagnostic ignored "-Wundefined-var-template"
return our_strings_[value_];
#pragma GCC diagnostic pop

View file

@ -25,9 +25,10 @@
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/util/singleton.hpp>
#include <mapnik/util/noncopyable.hpp>
#include <mapnik/font_set.hpp>
#include <mapnik/text/font_library.hpp>
#include <mapnik/util/noncopyable.hpp>
// stl
#include <memory>
@ -35,10 +36,6 @@
#include <utility> // pair
#include <vector>
#ifdef MAPNIK_THREADSAFE
#include <mutex>
#endif
namespace boost { template <class T> class optional; }
namespace mapnik
@ -51,22 +48,17 @@ using face_set_ptr = std::unique_ptr<font_face_set>;
class font_face;
using face_ptr = std::shared_ptr<font_face>;
class MAPNIK_DECL freetype_engine
class MAPNIK_DECL freetype_engine : public singleton<freetype_engine, CreateUsingNew>,
private util::noncopyable
{
friend class CreateUsingNew<freetype_engine>;
friend class Map;
public:
using font_file_mapping_type = std::map<std::string,std::pair<int,std::string>>;
using font_memory_cache_type = std::map<std::string, std::pair<std::unique_ptr<char[]>, std::size_t>>;
static bool is_font_file(std::string const& file_name);
/*! \brief register a font file
* @param file_name path to a font file.
* @return bool - true if at least one face was successfully registered in the file.
*/
static bool register_font(std::string const& file_name);
/*! \brief register a font files
* @param dir - path to a directory containing fonts or subdirectories.
* @param recurse - default false, whether to search for fonts in sub directories.
* @return bool - true if at least one face was successfully registered.
*/
static bool register_fonts(std::string const& dir, bool recurse = false);
static std::vector<std::string> face_names();
static font_file_mapping_type const& get_mapping();
@ -75,29 +67,42 @@ public:
font_library & library,
font_file_mapping_type const& font_file_mapping,
font_file_mapping_type const& global_font_file_mapping);
static face_ptr create_face(std::string const& face_name,
font_library & library,
font_file_mapping_type const& font_file_mapping,
freetype_engine::font_memory_cache_type const& font_cache,
font_file_mapping_type const& global_font_file_mapping,
freetype_engine::font_memory_cache_type & global_memory_fonts);
static bool register_font_impl(std::string const& file_name,
font_library & libary,
font_file_mapping_type & font_file_mapping);
static bool register_fonts_impl(std::string const& dir,
font_library & libary,
font_file_mapping_type & font_file_mapping,
bool recurse = false);
virtual ~freetype_engine();
freetype_engine();
font_library & library,
font_file_mapping_type const& font_file_mapping,
freetype_engine::font_memory_cache_type const& font_cache,
font_file_mapping_type const& global_font_file_mapping,
freetype_engine::font_memory_cache_type & global_memory_fonts);
private:
static bool register_font_impl(std::string const& file_name, FT_LibraryRec_ * library);
static bool register_fonts_impl(std::string const& dir, FT_LibraryRec_ * library, bool recurse = false);
#ifdef MAPNIK_THREADSAFE
static std::mutex mutex_;
#endif
static font_file_mapping_type global_font_file_mapping_;
static font_memory_cache_type global_memory_fonts_;
bool is_font_file_impl(std::string const& file_name);
std::vector<std::string> face_names_impl();
font_file_mapping_type const& get_mapping_impl();
font_memory_cache_type& get_cache_impl();
bool can_open_impl(std::string const& face_name,
font_library & library,
font_file_mapping_type const& font_file_mapping,
font_file_mapping_type const& global_font_file_mapping);
face_ptr create_face_impl(std::string const& face_name,
font_library & library,
font_file_mapping_type const& font_file_mapping,
freetype_engine::font_memory_cache_type const& font_cache,
font_file_mapping_type const& global_font_file_mapping,
freetype_engine::font_memory_cache_type & global_memory_fonts);
bool register_font_impl(std::string const& file_name);
bool register_fonts_impl(std::string const& dir, bool recurse);
bool register_font_impl(std::string const& file_name, FT_LibraryRec_ * library);
bool register_fonts_impl(std::string const& dir, FT_LibraryRec_ * library, bool recurse = false);
bool register_font_impl(std::string const& file_name,
font_library & libary,
font_file_mapping_type & font_file_mapping);
bool register_fonts_impl(std::string const& dir,
font_library & libary,
font_file_mapping_type & font_file_mapping,
bool recurse = false);
font_file_mapping_type global_font_file_mapping_;
font_memory_cache_type global_memory_fonts_;
};
class MAPNIK_DECL face_manager
@ -124,7 +129,7 @@ private:
};
using face_manager_freetype = face_manager;
extern template class MAPNIK_DECL singleton<freetype_engine, CreateUsingNew>;
}
#endif // MAPNIK_FONT_ENGINE_FREETYPE_HPP

View file

@ -96,7 +96,7 @@ public:
void get_control_points(double &x1, double &y1, double &x2, double &y2) const;
private:
void swap(gradient& other) throw();
void swap(gradient& other) noexcept;
};
}

View file

@ -68,16 +68,6 @@ public:
box_elements_.push_back(box_element(box, repeat_key));
}
inline void clear_box_elements()
{
box_elements_.clear();
}
inline text_symbolizer_properties const& get_properties() const
{
return info_ptr_->properties;
}
pixel_position_list const& get();
// Iterate over the given path, placing line-following labels or point labels with respect to label_spacing.

View file

@ -50,9 +50,9 @@ public:
image_reader_exception(std::string const& message)
: message_(message) {}
~image_reader_exception() throw() {}
~image_reader_exception() {}
virtual const char* what() const throw()
virtual const char* what() const noexcept
{
return message_.c_str();
}

View file

@ -56,9 +56,9 @@ public:
image_writer_exception(std::string const& message)
: message_(message) {}
~image_writer_exception() throw() {}
~image_writer_exception(){}
virtual const char* what() const throw()
virtual const char* what() const noexcept
{
return message_.c_str();
}

View file

@ -51,7 +51,7 @@ struct extract_bounding_box_grammar :
qi::rule<Iterator, qi::locals<Iterator>, void(boxes_type&), space_type> features;
qi::rule<Iterator, qi::locals<int, box_type>, void(boxes_type&, Iterator const&), space_type> feature;
qi::rule<Iterator, qi::locals<box_type>, box_type(), space_type> coords;
qi::rule<Iterator, boost::optional<position_type>(), space_type> pos;
qi::rule<Iterator, position_type(), space_type> pos;
qi::rule<Iterator, void(box_type&), space_type> ring;
qi::rule<Iterator, void(box_type&), space_type> rings;
qi::rule<Iterator, void(box_type&), space_type> rings_array;

View file

@ -42,18 +42,15 @@ struct calculate_bounding_box_impl
template <typename T0, typename T1>
result_type operator() (T0 & bbox, T1 const& pos) const
{
if (pos)
typename T0::value_type x = pos.x;
typename T0::value_type y = pos.y;
if (!bbox.valid())
{
typename T0::value_type x = pos->x;
typename T0::value_type y = pos->y;
if (!bbox.valid())
{
bbox.init(x, y);
}
else
{
bbox.expand_to_include(x, y);
}
bbox.init(x, y);
}
else
{
bbox.expand_to_include(x, y);
}
}
};
@ -64,10 +61,10 @@ struct push_box_impl
template <typename T0, typename T1, typename T2, typename T3>
void operator() (T0 & boxes, T1 const& begin, T2 const& box, T3 const& range) const
{
if (box.valid()) boxes.emplace_back(box,
std::make_pair(std::distance(begin,
range.begin()),
std::distance(range.begin(), range.end())));
boxes.emplace_back(box,
std::make_pair(std::distance(begin,
range.begin()),
std::distance(range.begin(), range.end())));
}
};
@ -132,16 +129,16 @@ extract_bounding_box_grammar<Iterator, Boxes, ErrorHandler>::extract_bounding_bo
>> lit(':') >> (rings_array(_a) | rings (_a) | ring(_a) | pos[calculate_bounding_box(_a,_1)])[_val = _a]
;
pos = lit('[') > -(double_ > lit(',') > double_) > omit[*(lit(',') > double_)] > lit(']')
pos = lit('[') > double_ > lit(',') > double_ > omit[*(lit(',') > double_)] > lit(']')
;
ring = lit('[') >> pos[calculate_bounding_box(_r1,_1)] % lit(',') > lit(']')
ring = lit('[') >> -(pos[calculate_bounding_box(_r1,_1)] % lit(',')) >> lit(']')
;
rings = lit('[') >> ring(_r1) % lit(',') > lit(']')
rings = lit('[') >> (ring(_r1) % lit(',') > lit(']'))
;
rings_array = lit('[') >> rings(_r1) % lit(',') > lit(']')
rings_array = lit('[') >> (rings(_r1) % lit(',') > lit(']'))
;
coords.name("Coordinates");

View file

@ -56,26 +56,24 @@ geometry_generator_grammar<OutputIterator, Geometry>::geometry_generator_grammar
;
geometry_dispatch = eps[_a = geometry_type(_val)] <<
(&uint_(geometry::geometry_types::Point)[_1 = _a]
<< (point | lit("null")))
(&uint_(geometry::geometry_types::Point)[_1 = _a] << point)
|
(&uint_(geometry::geometry_types::LineString)[_1 = _a]
<< (linestring | lit("null")))
<< (linestring | "{\"type\":\"LineString\",\"coordinates\":[]}"))
|
(&uint_(geometry::geometry_types::Polygon)[_1 = _a]
<< (polygon | lit("null")))
<< (polygon | "{\"type\":\"Polygon\",\"coordinates\":[[]]}"))
|
(&uint_(geometry::geometry_types::MultiPoint)[_1 = _a]
<< (multi_point | lit("null")))
<< (multi_point | "{\"type\":\"MultiPoint\",\"coordinates\":[]}"))
|
(&uint_(geometry::geometry_types::MultiLineString)[_1 = _a]
<< (multi_linestring | lit("null")))
<< (multi_linestring | "{\"type\":\"MultiLineString\",\"coordinates\":[[]]}"))
|
(&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a]
<< (multi_polygon | lit("null")))
<< (multi_polygon | "{\"type\":\"MultiPolygon\",\"coordinates\":[[[]]]}"))
|
(&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a]
<< (geometry_collection | lit("null")))
(&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a] << geometry_collection)
|
lit("null")
;
@ -96,7 +94,7 @@ geometry_generator_grammar<OutputIterator, Geometry>::geometry_generator_grammar
;
point_coord = lit('[') << coordinate << lit(',') << coordinate << lit(']')
;
linestring_coord = point_coord % lit(',')
linestring_coord = (point_coord % lit(','))
;
polygon_coord = lit('[') << exterior_ring_coord << lit(']') << interior_ring_coord
;

View file

@ -43,7 +43,10 @@ struct create_point
}
template <typename T>
void operator()(T const&) const {} // no-op - shouldn't get here
void operator()(T const&) const
{
throw std::runtime_error("Failed to parse geojson geometry");
}
Geometry & geom_;
};
@ -55,21 +58,21 @@ struct create_linestring
void operator() (positions const& ring) const
{
mapnik::geometry::line_string<double> line;
std::size_t size = ring.size();
if (size > 1)
line.reserve(size);
for (auto && pt : ring)
{
mapnik::geometry::line_string<double> line;
line.reserve(size);
for (auto && pt : ring)
{
line.emplace_back(std::move(pt));
}
geom_ = std::move(line);
line.emplace_back(std::move(pt));
}
geom_ = std::move(line);
}
template <typename T>
void operator()(T const&) const {} // no-op - shouldn't get here
void operator()(T const&) const
{
throw std::runtime_error("Failed to parse geojson geometry");
}
Geometry & geom_;
};
@ -106,7 +109,10 @@ struct create_polygon
}
template <typename T>
void operator()(T const&) const {} // no-op - shouldn't get here
void operator()(T const&) const
{
throw std::runtime_error("Failed to parse geojson geometry");
}
Geometry & geom_;
};
@ -130,7 +136,10 @@ struct create_multipoint
}
template <typename T>
void operator()(T const&) const {} // no-op - shouldn't get here
void operator()(T const&) const
{
throw std::runtime_error("Failed to parse geojson geometry");
}
Geometry & geom_;
};
@ -160,7 +169,10 @@ struct create_multilinestring
}
template <typename T>
void operator()(T const&) const {} // no-op - shouldn't get here
void operator()(T const&) const
{
throw std::runtime_error("Failed to parse geojson geometry");
}
Geometry & geom_;
};
@ -201,7 +213,10 @@ struct create_multipolygon
}
template <typename T>
void operator()(T const&) const {} // no-op - shouldn't get here
void operator()(T const&) const
{
throw std::runtime_error("Failed to parse geojson geometry");
}
Geometry & geom_;
};

View file

@ -44,7 +44,7 @@ struct positions_grammar :
{
positions_grammar(ErrorHandler & error_handler);
qi::rule<Iterator, coordinates(),space_type> coords;
qi::rule<Iterator, boost::optional<position>(), space_type> pos;
qi::rule<Iterator, position(), space_type> pos;
qi::rule<Iterator, positions(), space_type> ring;
qi::rule<Iterator, std::vector<positions>(), space_type> rings;
qi::rule<Iterator, std::vector<std::vector<positions> >(), space_type> rings_array;

View file

@ -41,7 +41,7 @@ struct set_position_impl
template <typename T0,typename T1>
result_type operator() (T0 & coords, T1 const& pos) const
{
if (pos) coords = *pos;
coords = pos;
}
};
@ -51,7 +51,7 @@ struct push_position_impl
template <typename T0, typename T1>
result_type operator() (T0 & coords, T1 const& pos) const
{
if (pos) coords.emplace_back(*pos);
coords.emplace_back(pos);
}
};
@ -75,13 +75,13 @@ positions_grammar<Iterator, ErrorHandler>::positions_grammar(ErrorHandler & erro
coords = rings_array[_val = _1] | rings [_val = _1] | ring[_val = _1] | pos[set_position(_val,_1)]
;
pos = lit('[') > -(double_ > lit(',') > double_) > omit[*(lit(',') > double_)] > lit(']')
pos = lit('[') > double_ > lit(',') > double_ > omit[*(lit(',') > double_)] > lit(']')
;
ring = lit('[') >> pos[push_position(_val,_1)] % lit(',') > lit(']')
ring = lit('[') >> -(pos[push_position(_val,_1)] % lit(',')) >> lit(']')
;
rings = lit('[') >> ring % lit(',') > lit(']')
rings = lit('[') >> (ring % lit(',') > lit(']'))
;
rings_array = lit('[') >> rings % lit(',') > lit(']')
rings_array = lit('[') >> (rings % lit(',') > lit(']'))
;
coords.name("Coordinates");
pos.name("Position");

View file

@ -77,18 +77,18 @@ struct offset_converter
return threshold_;
}
void set_offset(double value)
void set_offset(double val)
{
if (offset_ != value)
if (offset_ != val)
{
offset_ = value;
offset_ = val;
reset();
}
}
void set_threshold(double value)
void set_threshold(double val)
{
threshold_ = value;
threshold_ = val;
// no need to reset(), since threshold doesn't affect
// offset vertices' computation, it only controls how
// far will we be looking for self-intersections

View file

@ -40,15 +40,27 @@ class raster : private util::noncopyable
{
public:
box2d<double> ext_;
box2d<double> query_ext_;
image_any data_;
double filter_factor_;
boost::optional<double> nodata_;
template <typename ImageData>
raster(box2d<double> const& ext,
box2d<double> const& query_ext,
ImageData && data,
double filter_factor)
: ext_(ext),
query_ext_(query_ext),
data_(std::move(data)),
filter_factor_(filter_factor) {}
template <typename ImageData>
raster(box2d<double> const& ext,
ImageData && data,
double filter_factor)
: ext_(ext),
query_ext_(ext),
data_(std::move(data)),
filter_factor_(filter_factor) {}
@ -71,7 +83,6 @@ public:
{
filter_factor_ = factor;
}
};
}

View file

@ -53,6 +53,7 @@ struct image_dispatcher
image_dispatcher(int start_x, int start_y,
int width, int height,
double scale_x, double scale_y,
double offset_x, double offset_y,
scaling_method_e method, double filter_factor,
double opacity, composite_mode_e comp_op,
raster_symbolizer const& sym, feature_impl const& feature,
@ -63,15 +64,17 @@ struct image_dispatcher
height_(height),
scale_x_(scale_x),
scale_y_(scale_y),
offset_x_(offset_x),
offset_y_(offset_y),
method_(method),
filter_factor_(filter_factor),
opacity_(opacity),
comp_op_(comp_op),
sym_(sym),
feature_(feature),
composite_(composite),
nodata_(nodata),
need_scaling_(need_scaling) {}
opacity_(opacity),
comp_op_(comp_op),
sym_(sym),
feature_(feature),
composite_(composite),
nodata_(nodata),
need_scaling_(need_scaling) {}
void operator() (image_null const&) const {} //no-op
void operator() (image_rgba8 const& data_in) const
@ -79,7 +82,7 @@ struct image_dispatcher
if (need_scaling_)
{
image_rgba8 data_out(width_, height_, true, true);
scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_, nodata_);
scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, offset_x_, offset_y_, filter_factor_, nodata_);
composite_(data_out, comp_op_, opacity_, start_x_, start_y_);
}
else
@ -97,7 +100,7 @@ struct image_dispatcher
if (need_scaling_)
{
image_type data_out(width_, height_);
scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_, nodata_);
scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, offset_x_, offset_y_, filter_factor_, nodata_);
if (colorizer) colorizer->colorize(dst, data_out, nodata_, feature_);
}
else
@ -114,6 +117,8 @@ private:
int height_;
double scale_x_;
double scale_y_;
double offset_x_;
double offset_y_;
scaling_method_e method_;
double filter_factor_;
double opacity_;
@ -210,12 +215,18 @@ void render_raster_symbolizer(raster_symbolizer const& sym,
if (source)
{
box2d<double> target_ext = box2d<double>(source->ext_);
prj_trans.backward(target_ext, PROJ_ENVELOPE_POINTS);
box2d<double> target_query_ext = box2d<double>(source->query_ext_);
if (!prj_trans.equal())
{
prj_trans.backward(target_ext, PROJ_ENVELOPE_POINTS);
prj_trans.backward(target_query_ext, PROJ_ENVELOPE_POINTS);
}
box2d<double> ext = common.t_.forward(target_ext);
int start_x = static_cast<int>(std::floor(ext.minx()+.5));
int start_y = static_cast<int>(std::floor(ext.miny()+.5));
int end_x = static_cast<int>(std::floor(ext.maxx()+.5));
int end_y = static_cast<int>(std::floor(ext.maxy()+.5));
box2d<double> query_ext = common.t_.forward(target_query_ext);
int start_x = static_cast<int>(std::floor(query_ext.minx()+.5));
int start_y = static_cast<int>(std::floor(query_ext.miny()+.5));
int end_x = static_cast<int>(std::floor(query_ext.maxx()+.5));
int end_y = static_cast<int>(std::floor(query_ext.maxy()+.5));
int raster_width = end_x - start_x;
int raster_height = end_y - start_y;
if (raster_width > 0 && raster_height > 0)
@ -236,17 +247,20 @@ void render_raster_symbolizer(raster_symbolizer const& sym,
if (!prj_trans.equal())
{
double offset_x = ext.minx() - start_x;
double offset_y = ext.miny() - start_y;
// This path does not currently work and is still being figured out.
double offset_x = query_ext.minx() - start_x;
double offset_y = query_ext.miny() - start_y;
unsigned mesh_size = static_cast<unsigned>(get<value_integer>(sym,keys::mesh_size,feature, common.vars_, 16));
detail::image_warp_dispatcher<F> dispatcher(prj_trans, start_x, start_y, raster_width, raster_height,
target_ext, source->ext_, offset_x, offset_y, mesh_size,
target_query_ext, source->ext_, offset_x, offset_y, mesh_size,
scaling_method, source->get_filter_factor(),
opacity, comp_op, sym, feature, composite, source->nodata());
util::apply_visitor(dispatcher, source->data_);
}
else
{
double offset_x = query_ext.minx() - ext.minx();
double offset_y = query_ext.miny() - ext.miny();
double image_ratio_x = ext.width() / source->data_.width();
double image_ratio_y = ext.height() / source->data_.height();
double eps = 1e-5;
@ -256,6 +270,7 @@ void render_raster_symbolizer(raster_symbolizer const& sym,
(std::abs(start_y) > eps);
detail::image_dispatcher<F> dispatcher(start_x, start_y, raster_width, raster_height,
image_ratio_x, image_ratio_y,
offset_x, offset_y,
scaling_method, source->get_filter_factor(),
opacity, comp_op, sym, feature, composite, source->nodata(), scale);
util::apply_visitor(dispatcher, source->data_);

View file

@ -42,9 +42,9 @@ struct render_thunk_list_dispatch
{
offset_ = offset;
for (render_thunk_ptr const& thunk : thunks)
for (render_thunk const& thunk : thunks)
{
util::apply_visitor(std::ref(*this), *thunk);
util::apply_visitor(std::ref(*this), thunk);
}
}

View file

@ -107,8 +107,7 @@ struct text_render_thunk : util::movable
using render_thunk = util::variant<vector_marker_render_thunk,
raster_marker_render_thunk,
text_render_thunk>;
using render_thunk_ptr = std::unique_ptr<render_thunk>;
using render_thunk_list = std::list<render_thunk_ptr>;
using render_thunk_list = std::list<render_thunk>;
} // namespace mapnik

View file

@ -120,11 +120,11 @@ public:
return algorithm_;
}
void set_simplify_algorithm(simplify_algorithm_e value)
void set_simplify_algorithm(simplify_algorithm_e val)
{
if (algorithm_ != value)
if (algorithm_ != val)
{
algorithm_ = value;
algorithm_ = val;
reset();
}
}
@ -134,11 +134,11 @@ public:
return tolerance_;
}
void set_simplify_tolerance(double value)
void set_simplify_tolerance(double val)
{
if (tolerance_ != value)
if (tolerance_ != val)
{
tolerance_ = value;
tolerance_ = val;
reset();
}
}

View file

@ -38,9 +38,9 @@ public:
svg_parser_exception(std::string const& message)
: message_(message) {}
~svg_parser_exception() throw() {}
~svg_parser_exception() {}
virtual const char* what() const throw()
virtual const char* what() const noexcept
{
return message_.c_str();
}

View file

@ -100,18 +100,13 @@ struct strict_value : value_base_type
{
strict_value() = default;
strict_value(const char* val)
strict_value(const char* val) noexcept(false)
: value_base_type(std::string(val)) {}
template <typename T>
strict_value(T const& obj)
: value_base_type(typename detail::mapnik_value_type<T>::type(obj))
{}
template <typename T>
template <typename T, typename U = detail::mapnik_value_type_t<T>>
strict_value(T && obj)
noexcept(std::is_nothrow_constructible<value_base_type, T && >::value)
: value_base_type(std::forward<T>(obj))
noexcept(std::is_nothrow_constructible<value_base_type, U>::value)
: value_base_type(U(std::forward<T>(obj)))
{}
};

View file

@ -83,7 +83,8 @@ public:
if (!size_) return nullptr;
std::fseek(file_.get(), 0, SEEK_SET);
data_type buffer(new char[size_]);
std::fread(buffer.get(), size_, 1, file_.get());
auto count = std::fread(buffer.get(), size_, 1, file_.get());
if (count != 1) return nullptr;
return buffer;
}
private:

View file

@ -32,15 +32,7 @@ template <typename T>
using recursive_wrapper = typename mapbox::util::recursive_wrapper<T>;
template<typename... Types>
class variant : public mapbox::util::variant<Types...>
{
public:
// tell spirit that this is an adapted variant
struct adapted_variant_tag;
using types = std::tuple<Types...>;
// inherit ctor's
using mapbox::util::variant<Types...>::variant;
};
using variant = typename mapbox::util::variant<Types...>;
// unary visitor interface
// const

View file

@ -24,7 +24,7 @@
#define MAPNIK_UTIL_VARIANT_IO_HPP
namespace mapnik { namespace util {
namespace mapbox { namespace util {
namespace detail {

View file

@ -47,30 +47,20 @@ class MAPNIK_DECL value : public value_base
public:
value() = default;
// conversion from type T is done via a temporary of type U, which
// is determined by mapnik_value_type;
// enable_if< decay<T> != value > is necessary to avoid ill-formed
// recursion in noexcept specifier; and it also prevents using this
// constructor where implicitly-declared copy/move should be used
// (e.g. value(value&))
template <typename T,
typename U = typename std::enable_if<
!detail::is_same_decay<T, value>::value,
detail::mapnik_value_type_decay<T>
>::type::type>
// Conversion from type T is done via a temporary value or reference
// of type U, which is determined by mapnik_value_type_t.
//
// CAVEAT: We don't check `noexcept(conversion from T to U)`.
// But since the type U is either value_bool, value_integer,
// value_double or T &&, this conversion SHOULD NEVER throw.
template <typename T, typename U = detail::mapnik_value_type_t<T>>
value(T && val)
noexcept(noexcept(U(std::forward<T>(val))) &&
std::is_nothrow_constructible<value_base, U && >::value)
noexcept(std::is_nothrow_constructible<value_base, U>::value)
: value_base(U(std::forward<T>(val))) {}
template <typename T,
typename U = typename std::enable_if<
!detail::is_same_decay<T, value>::value,
detail::mapnik_value_type_decay<T>
>::type::type>
template <typename T, typename U = detail::mapnik_value_type_t<T>>
value& operator=(T && val)
noexcept(noexcept(U(std::forward<T>(val))) &&
std::is_nothrow_assignable<value_base, U && >::value)
noexcept(std::is_nothrow_assignable<value_base, U>::value)
{
value_base::operator=(U(std::forward<T>(val)));
return *this;

View file

@ -41,9 +41,9 @@ public:
{
}
virtual ~value_error() throw() {}
virtual ~value_error() {}
virtual const char * what() const throw()
virtual const char * what() const noexcept
{
return what_.c_str();
}

View file

@ -37,11 +37,6 @@
namespace mapnik { namespace detail {
inline void hash_combine(std::size_t & seed, std::size_t val)
{
seed ^= val + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
struct value_hasher
{
std::size_t operator() (value_null val) const
@ -54,11 +49,6 @@ struct value_hasher
return static_cast<std::size_t>(val.hashCode());
}
std::size_t operator()(value_integer val) const
{
return static_cast<std::size_t>(val);
}
template <class T>
std::size_t operator()(T const& val) const
{
@ -72,10 +62,7 @@ struct value_hasher
template <typename T>
std::size_t mapnik_hash_value(T const& val)
{
std::size_t seed = 0;
detail::hash_combine(seed, util::apply_visitor(detail::value_hasher(), val));
detail::hash_combine(seed, val.which());
return seed;
return util::apply_visitor(detail::value_hasher(), val);
}
} // namespace mapnik

View file

@ -25,6 +25,7 @@
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/cxx11_support.hpp>
#include <mapnik/pixel_types.hpp>
@ -34,7 +35,6 @@
#pragma GCC diagnostic pop
// stl
#include <type_traits>
#include <iosfwd>
#include <cstddef>
@ -152,90 +152,23 @@ inline std::istream& operator>> ( std::istream & s, value_null & )
namespace detail {
// to mapnik::value_type conversions traits
template <typename T>
struct is_value_bool
{
constexpr static bool value = std::is_same<T, bool>::value;
};
template <typename T>
struct is_value_integer
{
constexpr static bool value = std::is_integral<T>::value && !std::is_same<T, bool>::value;
};
// Helper metafunction for mapnik::value construction and assignment.
// Returns:
// value_bool if T is bool
// value_integer if T is an integral type (except bool)
// value_double if T is a floating-point type
// T && otherwise
template <typename T>
struct is_value_double
{
constexpr static bool value = std::is_floating_point<T>::value;
};
template <typename T>
struct is_value_unicode_string
{
constexpr static bool value = std::is_same<T, typename mapnik::value_unicode_string>::value;
};
template <typename T>
struct is_value_string
{
constexpr static bool value = std::is_same<T, typename std::string>::value;
};
template <typename T>
struct is_value_null
{
constexpr static bool value = std::is_same<T, typename mapnik::value_null>::value;
};
template <typename T, class Enable = void>
struct mapnik_value_type
{
using type = T;
};
// value_null
template <typename T>
struct mapnik_value_type<T, typename std::enable_if<detail::is_value_null<T>::value>::type>
{
using type = mapnik::value_null;
};
// value_bool
template <typename T>
struct mapnik_value_type<T, typename std::enable_if<detail::is_value_bool<T>::value>::type>
{
using type = mapnik::value_bool;
};
// value_integer
template <typename T>
struct mapnik_value_type<T, typename std::enable_if<detail::is_value_integer<T>::value>::type>
{
using type = mapnik::value_integer;
};
// value_double
template <typename T>
struct mapnik_value_type<T, typename std::enable_if<detail::is_value_double<T>::value>::type>
{
using type = mapnik::value_double;
};
// value_unicode_string
template <typename T>
struct mapnik_value_type<T, typename std::enable_if<detail::is_value_unicode_string<T>::value>::type>
{
using type = mapnik::value_unicode_string const&;
};
template <typename T>
using mapnik_value_type_decay = mapnik_value_type<typename std::decay<T>::type>;
template <typename T, typename U>
using is_same_decay = std::is_same<typename std::decay<T>::type,
typename std::decay<U>::type>;
template <typename T, typename dT = decay_t<T>>
using mapnik_value_type_t =
conditional_t<
std::is_same<dT, bool>::value, value_bool,
conditional_t<
std::is_integral<dT>::value, value_integer,
conditional_t<
std::is_floating_point<dT>::value, value_double,
T && >>>;
} // namespace detail

View file

@ -27,7 +27,7 @@
#define MAPNIK_MAJOR_VERSION 3
#define MAPNIK_MINOR_VERSION 0
#define MAPNIK_PATCH_VERSION 12
#define MAPNIK_PATCH_VERSION 14
#define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)

View file

@ -53,8 +53,8 @@ class MAPNIK_DECL node_not_found: public std::exception
{
public:
node_not_found(std::string const& node_name);
virtual const char* what() const throw();
~node_not_found() throw ();
virtual const char* what() const noexcept;
~node_not_found();
private:
std::string node_name_;
protected:
@ -65,8 +65,8 @@ class MAPNIK_DECL attribute_not_found: public std::exception
{
public:
attribute_not_found(std::string const& node_name, std::string const& attribute_name);
virtual const char* what() const throw();
~attribute_not_found() throw ();
virtual const char* what() const noexcept;
~attribute_not_found();
private:
std::string node_name_;
std::string attribute_name_;
@ -78,8 +78,8 @@ class MAPNIK_DECL more_than_one_child: public std::exception
{
public:
more_than_one_child(std::string const& node_name);
virtual const char* what() const throw();
~more_than_one_child() throw ();
virtual const char* what() const noexcept;
~more_than_one_child();
private:
std::string node_name_;
protected:

View file

@ -285,7 +285,10 @@ void csv_file_parser::parse_csv_and_boxes(std::istream & csv_file, T & boxes)
{
auto headers = csv_utils::parse_line(csv_line, separator_, quote_);
// skip blank lines
if (headers.size() > 0 && headers[0].empty()) ++line_number;
if (headers.size() == 1 && headers[0].empty())
{
++line_number;
}
else
{
std::size_t index = 0;
@ -300,7 +303,7 @@ void csv_file_parser::parse_csv_and_boxes(std::istream & csv_file, T & boxes)
std::ostringstream s;
s << "CSV Plugin: expected a column header at line ";
s << line_number << ", column " << index;
s << " - ensure this row contains valid header fields: '";
s << " - expected fields: '";
s << csv_line;
throw mapnik::datasource_exception(s.str());
}
@ -338,7 +341,6 @@ void csv_file_parser::parse_csv_and_boxes(std::istream & csv_file, T & boxes)
std::string str("CSV Plugin: could not detect column(s) with the name(s) of wkt, geojson, x/y, or ");
str += "latitude/longitude in:\n";
str += csv_line;
str += "\n - this is required for reading geometry data";
throw mapnik::datasource_exception(str);
}

View file

@ -38,7 +38,7 @@ plugin_env['LIBS'] = []
plugin_env.Append(LIBS=env['PLUGINS']['gdal']['lib'])
if env['RUNTIME_LINK'] == 'static':
cmd = 'gdal-config --dep-libs'
cmd = '%s --dep-libs' % plugin_env['GDAL_CONFIG']
plugin_env.ParseConfig(cmd)
# Link Library to Dependencies

View file

@ -149,6 +149,9 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
box2d<double> intersect = raster_extent_.intersect(q.get_bbox());
box2d<double> box = t.forward(intersect);
// get the filter factor if it is set
double filter_factor = q.get_filter_factor();
//size of resized output pixel in source image domain
double margin_x = 1.0 / (std::fabs(dx_) * std::get<0>(q.resolution()));
double margin_y = 1.0 / (std::fabs(dy_) * std::get<1>(q.resolution()));
@ -187,19 +190,9 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
int width = end_x - x_off;
int height = end_y - y_off;
// don't process almost invisible data
if (box.width() < 0.5)
{
width = 0;
}
if (box.height() < 0.5)
{
height = 0;
}
//calculate actual box2d of returned raster
box2d<double> feature_raster_extent(x_off, y_off, x_off + width, y_off + height);
intersect = t.backward(feature_raster_extent);
feature_raster_extent = t.backward(feature_raster_extent);
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Raster extent=" << raster_extent_;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: View extent=" << intersect;
@ -208,374 +201,380 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
if (width > 0 && height > 0)
{
double width_res = std::get<0>(q.resolution());
double height_res = std::get<1>(q.resolution());
int im_width = int(width_res * intersect.width() + 0.5);
int im_height = int(height_res * intersect.height() + 0.5);
double filter_factor = q.get_filter_factor();
im_width = int(im_width * filter_factor + 0.5);
im_height = int(im_height * filter_factor + 0.5);
// case where we need to avoid upsampling so that the
// image can be later scaled within raster_symbolizer
if (im_width >= width || im_height >= height)
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Image Size=(" << width << "," << height << ")";
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Reading band=" << band_;
if (band_ > 0) // we are querying a single band
{
im_width = width;
im_height = height;
}
if (im_width > 0 && im_height > 0)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Image Size=(" << im_width << "," << im_height << ")";
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Reading band=" << band_;
if (band_ > 0) // we are querying a single band
GDALRasterBand * band = dataset_.GetRasterBand(band_);
if (band_ > nbands_)
{
GDALRasterBand * band = dataset_.GetRasterBand(band_);
if (band_ > nbands_)
std::ostringstream s;
s << "GDAL Plugin: " << band_ << " is an invalid band, dataset only has " << nbands_ << "bands";
throw datasource_exception(s.str());
}
GDALDataType band_type = band->GetRasterDataType();
switch (band_type)
{
case GDT_Byte:
{
mapnik::image_gray8 image(width, height);
image.set(std::numeric_limits<std::uint8_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_Byte, 0, 0);
if (raster_io_error == CE_Failure)
{
std::ostringstream s;
s << "GDAL Plugin: " << band_ << " is an invalid band, dataset only has " << nbands_ << "bands";
throw datasource_exception(s.str());
throw datasource_exception(CPLGetLastErrorMsg());
}
GDALDataType band_type = band->GetRasterDataType();
switch (band_type)
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
case GDT_Float64:
case GDT_Float32:
{
mapnik::image_gray32f image(width, height);
image.set(std::numeric_limits<float>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_Float32, 0, 0);
if (raster_io_error == CE_Failure)
{
case GDT_Byte:
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
case GDT_UInt16:
{
mapnik::image_gray16 image(width, height);
image.set(std::numeric_limits<std::uint16_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_UInt16, 0, 0);
if (raster_io_error == CE_Failure)
{
mapnik::image_gray8 image(im_width, im_height);
image.set(std::numeric_limits<std::uint8_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_Byte, 0, 0);
if (raster_io_error == CE_Failure)
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
default:
case GDT_Int16:
{
mapnik::image_gray16s image(width, height);
image.set(std::numeric_limits<std::int16_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_Int16, 0, 0);
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
}
}
else // working with all bands
{
mapnik::image_rgba8 image(width, height);
image.set(std::numeric_limits<std::uint32_t>::max());
for (int i = 0; i < nbands_; ++i)
{
GDALRasterBand * band = dataset_.GetRasterBand(i + 1);
#ifdef MAPNIK_LOG
get_overview_meta(band);
#endif
GDALColorInterp color_interp = band->GetColorInterpretation();
switch (color_interp)
{
case GCI_RedBand:
red = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found red band";
break;
case GCI_GreenBand:
green = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found green band";
break;
case GCI_BlueBand:
blue = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found blue band";
break;
case GCI_AlphaBand:
alpha = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found alpha band";
break;
case GCI_GrayIndex:
grey = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found gray band";
break;
case GCI_PaletteIndex:
{
grey = band;
#ifdef MAPNIK_LOG
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found gray band, and colortable...";
GDALColorTable *color_table = band->GetColorTable();
if (color_table)
{
throw datasource_exception(CPLGetLastErrorMsg());
int count = color_table->GetColorEntryCount();
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Color Table count=" << count;
for (int j = 0; j < count; j++)
{
const GDALColorEntry *ce = color_table->GetColorEntry (j);
if (! ce) continue;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Color entry RGB=" << ce->c1 << "," <<ce->c2 << "," << ce->c3;
}
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
#endif
break;
}
case GDT_Float64:
case GDT_Float32:
case GCI_Undefined:
#if GDAL_VERSION_NUM <= 1730
if (nbands_ == 4)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming alpha band)";
alpha = band;
}
else
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)";
grey = band;
}
#else
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)";
grey = band;
#endif
break;
default:
MAPNIK_LOG_WARN(gdal) << "gdal_featureset: Band type unknown!";
break;
}
}
if (red && green && blue)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Processing rgb bands...";
raster_nodata = red->GetNoDataValue(&raster_has_nodata);
GDALColorTable *color_table = red->GetColorTable();
bool has_nodata = nodata_value_ || raster_has_nodata;
// we can deduce the alpha channel from nodata in the Byte case
// by reusing the reading of R,G,B bands directly
if (has_nodata && !color_table && red->GetRasterDataType() == GDT_Byte)
{
mapnik::image_gray32f image(im_width, im_height);
image.set(std::numeric_limits<float>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata;
// read the data in and create an alpha channel from the nodata values
// TODO - we assume here the nodata value for the red band applies to all bands
// more details about this at http://trac.osgeo.org/gdal/ticket/2734
float* imageData = (float*)image.bytes();
raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height,
imageData, image.width(), image.height(),
GDT_Float32, 0, 0);
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
int len = image.width() * image.height();
for (int i = 0; i < len; ++i)
{
if (std::fabs(apply_nodata - imageData[i]) < nodata_tolerance_)
{
*reinterpret_cast<unsigned *>(&imageData[i]) = 0;
}
else
{
*reinterpret_cast<unsigned *>(&imageData[i]) = 0xFFFFFFFF;
}
}
}
/* Use dataset RasterIO in priority in 99.9% of the cases */
if( red->GetBand() == 1 && green->GetBand() == 2 && blue->GetBand() == 3 )
{
int nBandsToRead = 3;
if( alpha != nullptr && alpha->GetBand() == 4 && !raster_has_nodata )
{
nBandsToRead = 4;
alpha = nullptr; // to avoid reading it again afterwards
}
raster_io_error = dataset_.RasterIO(GF_Read, x_off, y_off, width, height,
image.bytes(),
image.width(), image.height(), GDT_Byte,
nBandsToRead, nullptr,
4, 4 * image.width(), 1);
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
}
else
{
raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 0,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = green->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 1,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = blue->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 2,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
}
// In the case we skipped initializing the alpha channel
if (has_nodata && !color_table && red->GetRasterDataType() == GDT_Byte)
{
double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata;
if( apply_nodata >= 0 && apply_nodata <= 255 )
{
int len = image.width() * image.height();
GByte* pabyBytes = (GByte*) image.bytes();
for (int i = 0; i < len; ++i)
{
// TODO - we assume here the nodata value for the red band applies to all bands
// more details about this at http://trac.osgeo.org/gdal/ticket/2734
if (std::fabs(apply_nodata - pabyBytes[4*i]) < nodata_tolerance_)
pabyBytes[4*i + 3] = 0;
else
pabyBytes[4*i + 3] = 255;
}
}
}
}
else if (grey)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Processing gray band...";
raster_nodata = grey->GetNoDataValue(&raster_has_nodata);
GDALColorTable* color_table = grey->GetColorTable();
bool has_nodata = nodata_value_ || raster_has_nodata;
if (!color_table && has_nodata)
{
double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: applying nodata value for layer=" << apply_nodata;
// first read the data in and create an alpha channel from the nodata values
float* imageData = (float*)image.bytes();
raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height,
imageData, image.width(), image.height(),
GDT_Float32, 0, 0);
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
case GDT_UInt16:
{
mapnik::image_gray16 image(im_width, im_height);
image.set(std::numeric_limits<std::uint16_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_UInt16, 0, 0);
if (raster_io_error == CE_Failure)
int len = image.width() * image.height();
for (int i = 0; i < len; ++i)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
default:
case GDT_Int16:
{
mapnik::image_gray16s image(im_width, im_height);
image.set(std::numeric_limits<std::int16_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_Int16, 0, 0);
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
}
}
else // working with all bands
{
mapnik::image_rgba8 image(im_width, im_height);
image.set(std::numeric_limits<std::uint32_t>::max());
for (int i = 0; i < nbands_; ++i)
{
GDALRasterBand * band = dataset_.GetRasterBand(i + 1);
#ifdef MAPNIK_LOG
get_overview_meta(band);
#endif
GDALColorInterp color_interp = band->GetColorInterpretation();
switch (color_interp)
{
case GCI_RedBand:
red = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found red band";
break;
case GCI_GreenBand:
green = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found green band";
break;
case GCI_BlueBand:
blue = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found blue band";
break;
case GCI_AlphaBand:
alpha = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found alpha band";
break;
case GCI_GrayIndex:
grey = band;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found gray band";
break;
case GCI_PaletteIndex:
{
grey = band;
#ifdef MAPNIK_LOG
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found gray band, and colortable...";
GDALColorTable *color_table = band->GetColorTable();
if (color_table)
if (std::fabs(apply_nodata - imageData[i]) < nodata_tolerance_)
{
int count = color_table->GetColorEntryCount();
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Color Table count=" << count;
for (int j = 0; j < count; j++)
{
const GDALColorEntry *ce = color_table->GetColorEntry (j);
if (! ce) continue;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Color entry RGB=" << ce->c1 << "," <<ce->c2 << "," << ce->c3;
}
}
#endif
break;
}
case GCI_Undefined:
#if GDAL_VERSION_NUM <= 1730
if (nbands_ == 4)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming alpha band)";
alpha = band;
*reinterpret_cast<unsigned *>(&imageData[i]) = 0;
}
else
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)";
grey = band;
*reinterpret_cast<unsigned *>(&imageData[i]) = 0xFFFFFFFF;
}
#else
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)";
grey = band;
#endif
break;
default:
MAPNIK_LOG_WARN(gdal) << "gdal_featureset: Band type unknown!";
break;
}
}
if (red && green && blue)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Processing rgb bands...";
raster_nodata = red->GetNoDataValue(&raster_has_nodata);
GDALColorTable *color_table = red->GetColorTable();
bool has_nodata = nodata_value_ || raster_has_nodata;
// we can deduce the alpha channel from nodata in the Byte case
// by reusing the reading of R,G,B bands directly
if (has_nodata && !color_table && red->GetRasterDataType() == GDT_Byte)
raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 0,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.bytes() + 1,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.bytes() + 2,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
if (color_table)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Loading color table...";
for (unsigned y = 0; y < image.height(); ++y)
{
double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata;
// read the data in and create an alpha channel from the nodata values
// TODO - we assume here the nodata value for the red band applies to all bands
// more details about this at http://trac.osgeo.org/gdal/ticket/2734
float* imageData = (float*)image.bytes();
raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height,
imageData, image.width(), image.height(),
GDT_Float32, 0, 0);
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
int len = image.width() * image.height();
for (int i = 0; i < len; ++i)
unsigned int* row = image.get_row(y);
for (unsigned x = 0; x < image.width(); ++x)
{
if (std::fabs(apply_nodata - imageData[i]) < nodata_tolerance_)
unsigned value = row[x] & 0xff;
const GDALColorEntry *ce = color_table->GetColorEntry(value);
if (ce)
{
*reinterpret_cast<unsigned *>(&imageData[i]) = 0;
row[x] = (ce->c4 << 24)| (ce->c3 << 16) | (ce->c2 << 8) | (ce->c1) ;
}
else
{
*reinterpret_cast<unsigned *>(&imageData[i]) = 0xFFFFFFFF;
}
}
}
/* Use dataset RasterIO in priority in 99.9% of the cases */
if( red->GetBand() == 1 && green->GetBand() == 2 && blue->GetBand() == 3 )
{
int nBandsToRead = 3;
if( alpha != nullptr && alpha->GetBand() == 4 && !raster_has_nodata )
{
nBandsToRead = 4;
alpha = nullptr; // to avoid reading it again afterwards
}
raster_io_error = dataset_.RasterIO(GF_Read, x_off, y_off, width, height,
image.bytes(),
image.width(), image.height(), GDT_Byte,
nBandsToRead, nullptr,
4, 4 * image.width(), 1);
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
}
else
{
raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 0,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = green->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 1,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = blue->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 2,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
}
// In the case we skipped initializing the alpha channel
if (has_nodata && !color_table && red->GetRasterDataType() == GDT_Byte)
{
double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata;
if( apply_nodata >= 0 && apply_nodata <= 255 )
{
int len = image.width() * image.height();
GByte* pabyBytes = (GByte*) image.bytes();
for (int i = 0; i < len; ++i)
{
// TODO - we assume here the nodata value for the red band applies to all bands
// more details about this at http://trac.osgeo.org/gdal/ticket/2734
if (std::fabs(apply_nodata - pabyBytes[4*i]) < nodata_tolerance_)
pabyBytes[4*i + 3] = 0;
else
pabyBytes[4*i + 3] = 255;
// make lacking color entry fully alpha
// note - gdal_translate makes black
row[x] = 0;
}
}
}
}
else if (grey)
}
if (alpha)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: processing alpha band...";
if (!raster_has_nodata)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Processing gray band...";
raster_nodata = grey->GetNoDataValue(&raster_has_nodata);
GDALColorTable* color_table = grey->GetColorTable();
bool has_nodata = nodata_value_ || raster_has_nodata;
if (!color_table && has_nodata)
{
double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: applying nodata value for layer=" << apply_nodata;
// first read the data in and create an alpha channel from the nodata values
float* imageData = (float*)image.bytes();
raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height,
imageData, image.width(), image.height(),
GDT_Float32, 0, 0);
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
int len = image.width() * image.height();
for (int i = 0; i < len; ++i)
{
if (std::fabs(apply_nodata - imageData[i]) < nodata_tolerance_)
{
*reinterpret_cast<unsigned *>(&imageData[i]) = 0;
}
else
{
*reinterpret_cast<unsigned *>(&imageData[i]) = 0xFFFFFFFF;
}
}
}
raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 0,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure)
{
raster_io_error = alpha->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 3,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.bytes() + 1,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.bytes() + 2,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
if (color_table)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Loading color table...";
for (unsigned y = 0; y < image.height(); ++y)
{
unsigned int* row = image.get_row(y);
for (unsigned x = 0; x < image.width(); ++x)
{
unsigned value = row[x] & 0xff;
const GDALColorEntry *ce = color_table->GetColorEntry(value);
if (ce)
{
row[x] = (ce->c4 << 24)| (ce->c3 << 16) | (ce->c2 << 8) | (ce->c1) ;
}
else
{
// make lacking color entry fully alpha
// note - gdal_translate makes black
row[x] = 0;
}
}
}
}
}
if (alpha)
else
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: processing alpha band...";
MAPNIK_LOG_WARN(gdal) << "warning: nodata value (" << raster_nodata << ") used to set transparency instead of alpha band";
}
}
else if( dataset_.GetRasterCount() > 0 && dataset_.GetRasterBand(1) )
{
// Check if we have a non-alpha mask band (for example a TIFF internal mask)
int flags = dataset_.GetRasterBand(1)->GetMaskFlags();
GDALRasterBand* mask = 0;
if (flags == GMF_PER_DATASET)
{
mask = dataset_.GetRasterBand(1)->GetMaskBand();
}
if (mask)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: found and processing mask band...";
if (!raster_has_nodata)
{
raster_io_error = alpha->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 3,
raster_io_error = mask->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 3,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
@ -583,48 +582,22 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
}
else
{
MAPNIK_LOG_WARN(gdal) << "warning: nodata value (" << raster_nodata << ") used to set transparency instead of alpha band";
MAPNIK_LOG_WARN(gdal) << "warning: nodata value (" << raster_nodata << ") used to set transparency instead of mask band";
}
}
else if( dataset_.GetRasterCount() > 0 && dataset_.GetRasterBand(1) )
{
// Check if we have a non-alpha mask band (for example a TIFF internal mask)
int flags = dataset_.GetRasterBand(1)->GetMaskFlags();
GDALRasterBand* mask = 0;
if (flags == GMF_PER_DATASET)
{
mask = dataset_.GetRasterBand(1)->GetMaskBand();
}
if (mask)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: found and processing mask band...";
if (!raster_has_nodata)
{
raster_io_error = mask->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 3,
image.width(), image.height(), GDT_Byte, 4, 4 * image.width());
if (raster_io_error == CE_Failure) {
throw datasource_exception(CPLGetLastErrorMsg());
}
}
else
{
MAPNIK_LOG_WARN(gdal) << "warning: nodata value (" << raster_nodata << ") used to set transparency instead of mask band";
}
}
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
}
// report actual/original source nodata in feature attributes
if (raster_has_nodata)
{
feature->put("nodata",raster_nodata);
}
return feature;
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
}
// report actual/original source nodata in feature attributes
if (raster_has_nodata)
{
feature->put("nodata",raster_nodata);
}
return feature;
}
return feature_ptr();
}

View file

@ -42,7 +42,7 @@ plugin_env['LIBS'] = []
plugin_env.Append(LIBS=env['PLUGINS']['ogr']['lib'])
if env['RUNTIME_LINK'] == 'static':
cmd = 'gdal-config --dep-libs'
cmd = '%s --dep-libs' % plugin_env['GDAL_CONFIG']
plugin_env.ParseConfig(cmd)
# Link Library to Dependencies

View file

@ -54,7 +54,9 @@ if env['PLUGIN_LINKING'] == 'shared':
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_regex%s' % env['BOOST_APPEND'])
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append('icui18n')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -55,7 +55,8 @@ raster_featureset<LookupPolicy>::raster_featureset(LookupPolicy const& policy,
extent_(extent),
bbox_(q.get_bbox()),
curIter_(policy_.begin()),
endIter_(policy_.end())
endIter_(policy_.end()),
filter_factor_(q.get_filter_factor())
{
}
@ -89,33 +90,34 @@ feature_ptr raster_featureset<LookupPolicy>::next()
box2d<double> intersect = bbox_.intersect(curIter_->envelope());
box2d<double> ext = t.forward(intersect);
box2d<double> rem = policy_.transform(ext);
if (ext.width() > 0.5 && ext.height() > 0.5 )
{
// select minimum raster containing whole ext
int x_off = static_cast<int>(std::floor(ext.minx()));
int y_off = static_cast<int>(std::floor(ext.miny()));
int end_x = static_cast<int>(std::ceil(ext.maxx()));
int end_y = static_cast<int>(std::ceil(ext.maxy()));
// select minimum raster containing whole ext
int x_off = static_cast<int>(std::floor(ext.minx()));
int y_off = static_cast<int>(std::floor(ext.miny()));
int end_x = static_cast<int>(std::ceil(ext.maxx()));
int end_y = static_cast<int>(std::ceil(ext.maxy()));
// clip to available data
if (x_off < 0) x_off = 0;
if (y_off < 0) y_off = 0;
if (end_x > image_width) end_x = image_width;
if (end_y > image_height) end_y = image_height;
// clip to available data
if (x_off >= image_width) x_off = image_width - 1;
if (y_off >= image_height) y_off = image_height - 1;
if (x_off < 0) x_off = 0;
if (y_off < 0) y_off = 0;
if (end_x > image_width) end_x = image_width;
if (end_y > image_height) end_y = image_height;
int width = end_x - x_off;
int height = end_y - y_off;
int width = end_x - x_off;
int height = end_y - y_off;
if (width < 1) width = 1;
if (height < 1) height = 1;
// calculate actual box2d of returned raster
box2d<double> feature_raster_extent(rem.minx() + x_off,
rem.miny() + y_off,
rem.maxx() + x_off + width,
rem.maxy() + y_off + height);
intersect = t.backward(feature_raster_extent);
mapnik::image_any data = reader->read(x_off, y_off, width, height);
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(intersect, std::move(data), 1.0);
feature->set_raster(raster);
}
// calculate actual box2d of returned raster
box2d<double> feature_raster_extent(rem.minx() + x_off,
rem.miny() + y_off,
rem.maxx() + x_off + width,
rem.maxy() + y_off + height);
feature_raster_extent = t.backward(feature_raster_extent);
mapnik::image_any data = reader->read(x_off, y_off, width, height);
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, std::move(data), filter_factor_);
feature->set_raster(raster);
}
}
}

View file

@ -321,6 +321,7 @@ private:
mapnik::box2d<double> bbox_;
iterator_type curIter_;
iterator_type endIter_;
double filter_factor_;
};
#endif // RASTER_FEATURESET_HPP

View file

@ -44,7 +44,7 @@ raster_info::raster_info(const raster_info& rhs)
{
}
void raster_info::swap(raster_info& other) //throw()
void raster_info::swap(raster_info& other)
{
std::swap(file_,other.file_);
std::swap(format_,other.format_);

View file

@ -137,7 +137,7 @@ const field_descriptor& dbf_file::descriptor(int col) const
}
void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feature_impl & f) const throw()
void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feature_impl & f) const
{
using namespace boost::spirit;

View file

@ -77,7 +77,7 @@ public:
field_descriptor const& descriptor(int col) const;
void move_to(int index);
std::string string_value(int col) const;
void add_attribute(int col, mapnik::transcoder const& tr, mapnik::feature_impl & f) const throw();
void add_attribute(int col, mapnik::transcoder const& tr, mapnik::feature_impl & f) const;
private:
void read_header();
int read_short();

View file

@ -1,107 +0,0 @@
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Portions of the following are derived from the compat.py file in
# Twisted, under the following copyright:
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories
__doc__ = """
Compatibility idioms for builtins names
This module adds names to the builtins module for things that we want
to use in SCons but which don't show up until later Python versions than
the earliest ones we support.
This module checks for the following builtins names:
all()
any()
memoryview()
Implementations of functions are *NOT* guaranteed to be fully compliant
with these functions in later versions of Python. We are only concerned
with adding functionality that we actually use in SCons, so be wary
if you lift this code for other uses. (That said, making these more
nearly the same as later, official versions is still a desirable goal,
we just don't need to be obsessive about it.)
If you're looking at this with pydoc and various names don't show up in
the FUNCTIONS or DATA output, that means those names are already built in
to this version of Python and we don't need to add them from this module.
"""
__revision__ = "src/engine/SCons/compat/_scons_builtins.py rel_2.4.1:3480:df381b06597b 2015/11/21 07:35:35 bdbaddog"
import builtins
try:
all
except NameError:
# Pre-2.5 Python has no all() function.
def all(iterable):
"""
Returns True if all elements of the iterable are true.
"""
for element in iterable:
if not element:
return False
return True
builtins.all = all
all = all
try:
any
except NameError:
# Pre-2.5 Python has no any() function.
def any(iterable):
"""
Returns True if any element of the iterable is true.
"""
for element in iterable:
if element:
return True
return False
builtins.any = any
any = any
try:
memoryview
except NameError:
# Pre-2.7 doesn't have the memoryview() built-in.
class memoryview(object):
def __init__(self, obj):
# wrapping buffer in () keeps the fixer from changing it
self.obj = (buffer)(obj)
def __getitem__(self, indx):
if isinstance(indx, slice):
return self.obj[indx.start:indx.stop]
else:
return self.obj[indx]
builtins.memoryview = memoryview
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:

View file

@ -1,76 +0,0 @@
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__doc__ = """
hashlib backwards-compatibility module for older (pre-2.5) Python versions
This does not not NOT (repeat, *NOT*) provide complete hashlib
functionality. It only wraps the portions of MD5 functionality used
by SCons, in an interface that looks like hashlib (or enough for our
purposes, anyway). In fact, this module will raise an ImportError if
the underlying md5 module isn't available.
"""
__revision__ = "src/engine/SCons/compat/_scons_hashlib.py rel_2.4.1:3480:df381b06597b 2015/11/21 07:35:35 bdbaddog"
import md5
from string import hexdigits
class md5obj(object):
md5_module = md5
def __init__(self, name, string=''):
if not name in ('MD5', 'md5'):
raise ValueError("unsupported hash type")
self.name = 'md5'
self.m = self.md5_module.md5()
def __repr__(self):
return '<%s HASH object @ %#x>' % (self.name, id(self))
def copy(self):
import copy
result = copy.copy(self)
result.m = self.m.copy()
return result
def digest(self):
return self.m.digest()
def update(self, arg):
return self.m.update(arg)
def hexdigest(self):
return self.m.hexdigest()
new = md5obj
def md5(string=''):
return md5obj('md5', string)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:

View file

@ -97,7 +97,7 @@ way for wrapping up the functions.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Action.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Action.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import dis
import os

View file

@ -97,7 +97,7 @@ There are the following methods for internal use within this module:
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Builder.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Builder.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import collections

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/CacheDir.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/CacheDir.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """
CacheDir support

View file

@ -31,7 +31,7 @@ caller_trace()
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Debug.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Debug.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import os
import sys

View file

@ -33,7 +33,7 @@ from distutils.msvccompiler.
#
from __future__ import division
__revision__ = "src/engine/SCons/Defaults.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Defaults.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import os

View file

@ -31,7 +31,7 @@ Environment
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Environment.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Environment.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import copy

View file

@ -28,7 +28,7 @@ and user errors in SCons.
"""
__revision__ = "src/engine/SCons/Errors.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Errors.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Util
@ -73,7 +73,7 @@ class BuildError(Exception):
Information about the cause of the location of the error:
---------------------------------------------------------
node : the error occurred while building this target node(s)
node : the error occured while building this target node(s)
executor : the executor that caused the build to fail (might
be None if the build failures is not due to the

View file

@ -27,7 +27,7 @@ Nodes.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Executor.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Executor.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import collections

View file

@ -29,7 +29,7 @@ stop, and wait on jobs.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Job.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Job.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.compat

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Memoize.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Memoize.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Memoizer

View file

@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets).
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Node/Alias.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Node/Alias.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import collections

View file

@ -32,7 +32,7 @@ that can be used by scripts or modules looking for the canonical default.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Node/FS.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Node/FS.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import fnmatch
import os

View file

@ -27,7 +27,7 @@ Python nodes.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Node/Python.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Node/Python.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Node

View file

@ -41,7 +41,7 @@ be able to depend on any other type of "thing."
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Node/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Node/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import collections
import copy
@ -924,9 +924,9 @@ class Node(object):
scanner's recursive flag says that we should.
"""
nodes = [self]
seen = {}
seen[self] = 1
seen = set(nodes)
dependencies = []
path_memo = {}
root_node_scanner = self._get_scanner(env, initial_scanner, None, kw)
@ -934,31 +934,33 @@ class Node(object):
node = nodes.pop(0)
scanner = node._get_scanner(env, initial_scanner, root_node_scanner, kw)
if not scanner:
continue
path = path_func(scanner)
try:
path = path_memo[scanner]
except KeyError:
path = path_func(scanner)
path_memo[scanner] = path
included_deps = [x for x in node.get_found_includes(env, scanner, path) if x not in seen]
if included_deps:
dependencies.extend(included_deps)
for dep in included_deps:
seen[dep] = 1
seen.update(included_deps)
nodes.extend(scanner.recurse_nodes(included_deps))
return dependencies
def _get_scanner(self, env, initial_scanner, root_node_scanner, kw):
if not initial_scanner:
if initial_scanner:
# handle explicit scanner case
scanner = initial_scanner.select(self)
else:
# handle implicit scanner case
scanner = self.get_env_scanner(env, kw)
if scanner:
scanner = scanner.select(self)
else:
# handle explicit scanner case
scanner = initial_scanner.select(self)
if not scanner:
# no scanner could be found for the given node's scanner key;
# thus, make an attempt at using a default.

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Options/BoolOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Options/BoolOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Options/EnumOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Options/EnumOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Options/ListOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Options/ListOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Options/PackageOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Options/PackageOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Options/PathOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Options/PathOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Options/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Options/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/PathList.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/PathList.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
__doc__ = """SCons.PathList

View file

@ -42,7 +42,7 @@ their own platform definition.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.compat

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/aix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/aix.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import os
import subprocess

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/cygwin.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/cygwin.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import posix
from SCons.Platform import TempFileMunge

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/darwin.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/darwin.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import posix
import os

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/hpux.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/hpux.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import posix

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/irix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/irix.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import posix

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/os2.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/os2.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import win32
def generate(env):

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/posix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/posix.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import errno
import os

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/sunos.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/sunos.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import posix

View file

@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Platform/win32.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Platform/win32.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import os
import os.path

View file

@ -34,7 +34,7 @@ libraries are installed, if some command line options are supported etc.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/SConf.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/SConf.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.compat

View file

@ -27,7 +27,7 @@ Writing and reading information to the .sconsign file or files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/SConsign.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/SConsign.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.compat

View file

@ -27,7 +27,7 @@ This module implements the dependency scanner for C/C++ code.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/C.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/C.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Node.FS
import SCons.Scanner

View file

@ -30,7 +30,7 @@ Coded by Andy Friesen
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/D.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/D.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import re

View file

@ -20,7 +20,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Scanner/Dir.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/Dir.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Node.FS
import SCons.Scanner

View file

@ -26,7 +26,7 @@ This module implements the dependency scanner for Fortran code.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Scanner/Fortran.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/Fortran.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import re

View file

@ -28,7 +28,7 @@ Definition Language) files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/IDL.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/IDL.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Node.FS
import SCons.Scanner

View file

@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/LaTeX.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/LaTeX.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import os.path
import re

View file

@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/Prog.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/Prog.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Node
import SCons.Node.FS

View file

@ -28,7 +28,7 @@ Definition Language) files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/RC.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/RC.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Node.FS
import SCons.Scanner

View file

@ -27,7 +27,7 @@ This module implements the dependency scanner for SWIG code.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/SWIG.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/SWIG.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Scanner

View file

@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Scanner/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__revision__ = "src/engine/SCons/Scanner/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import re

Some files were not shown because too many files have changed in this diff Show more