[Pkg-javascript-commits] [node-mapnik] 01/10: New upstream version 3.6.1+dfsg
Bas Couwenberg
sebastic at debian.org
Tue Aug 29 13:12:44 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository node-mapnik.
commit 584fc44720df96f8a616c02a63f8f425a95a867c
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Tue Aug 29 13:48:07 2017 +0200
New upstream version 3.6.1+dfsg
---
.gitignore | 1 +
.travis.yml | 16 +++-
CHANGELOG.md | 17 ++++
Makefile | 6 +-
appveyor.yml | 34 ++++----
common.gypi | 3 +-
install_mason.sh | 4 +-
package.json | 7 +-
scripts/build-appveyor.bat | 97 +++++++--------------
test/data/images/14_2788_6533.webp | Bin 0 -> 98618 bytes
test/data/images/large_overzoom.expected.png | Bin 0 -> 859 bytes
.../images/sat_image-expected-100x100-offset.tif | Bin 4496 -> 4500 bytes
.../images/sat_image-expected-50x50-offset.tif | Bin 760 -> 718 bytes
test/data/large_overzoom.xml | 40 +++++++++
test/data/sat_map.xml | 2 +-
.../vector_tile/compositing/expected/2-1-1b.png | Bin 154630 -> 154739 bytes
test/data/vector_tile/tile-raster.expected.jpg | Bin 6635 -> 5247 bytes
test/geometry.test.js | 14 ---
test/image.test.js | 4 +-
test/vector-tile.query.test.js | 2 +-
test/vector-tile.test.js | 59 ++++++++++---
21 files changed, 184 insertions(+), 122 deletions(-)
diff --git a/.gitignore b/.gitignore
index 23e5cec..2eeb206 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ node_modules
src/*.*~
npm-debug.log
test/tmp
+test/data/images/*actual*
test/data/vector_tile/*actual*
test/data/vector_tile/pasted/*actual*
*.7z
diff --git a/.travis.yml b/.travis.yml
index ebf47ec..c2eb0d4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -65,9 +65,14 @@ matrix:
- os: linux
env: BUILDTYPE=debug
node_js: 6
+ # linux publishable node v7
- os: linux
env: BUILDTYPE=release
node_js: 7
+ # linux publishable node v8
+ - os: linux
+ env: BUILDTYPE=release
+ node_js: 8
# osx publishable node v0.10
- os: osx
osx_image: xcode8.3
@@ -77,17 +82,22 @@ matrix:
- os: osx
osx_image: xcode8.3
env: BUILDTYPE=release
- node_js: "4.8.1" # Fixed at version until https://github.com/nodejs/node/issues/12244 is resolved by nodejs
+ node_js: 4
# osx publishable node v6
- os: osx
osx_image: xcode8.3
env: BUILDTYPE=release
- node_js: "6.10.1" # Fixed at version until https://github.com/nodejs/node/issues/12244 is resolved by nodejs
+ node_js: 6
# osx publishable node v7
- os: osx
osx_image: xcode8.2
env: BUILDTYPE=release
- node_js: "7.5.0" # Fixed at version until https://github.com/nodejs/node/issues/12244 is resolved by nodejs
+ node_js: 7
+ # osx publishable node v8
+ - os: osx
+ osx_image: xcode8.2
+ env: BUILDTYPE=release
+ node_js: 8
# Sanitizer build node v4/Debug
- os: linux
env: BUILDTYPE=debug TOOLSET=-asan
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4b14348..a050944 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## 3.6.1
+
+Updated for a fix associated with mapnik-vector-tile where images could be requested that would have a width or height of zero resulting
+in exceptions.
+
+Several fixes associated with different mapnik by updating to use 3.0.14. Please see mapnik change log for specifics. In
+general note worthy changes from mapnik include stricter geojson parsing, fixes for raster plugin, fixes to image scaling,
+changing the meaning of filter-factor, and improvements to the the TIFF decoder.
+
+Due to changes in the mapnik core version during this update you should see some changes in the image rescaling of raster and gdal plugin source data. This will definitely change the expected output. This is due to fixes in long standing bugs in the mapnik library.
+
+- Updated to mapnik-vector-tile at 1.4.0
+- Mapnik minimum version updated to 3.0.14. Does not work with mapnik 3.1.x currently.
+- Fixed tests around zlib compression and decompression when comparing to node's implementation
+- Fixes rare situation of seg faults during mapnik-vector-tile image processing.
+- Corrects the resolution of images in mapnik-vector-tile when using parameters from postgis plugin.
+
## 3.6.0
This release has major performance and stability improvements.
diff --git a/Makefile b/Makefile
index b0ac93c..c634041 100755
--- a/Makefile
+++ b/Makefile
@@ -2,10 +2,10 @@ MODULE_NAME := $(shell node -e "console.log(require('./package.json').binary.mod
default: release
-deps/geometry:
+deps/geometry/include/mapbox/geometry.hpp:
git submodule update --init
-mason_packages/.link/bin/mapnik-config: deps/geometry
+mason_packages/.link/bin/mapnik-config: deps/geometry/include/mapbox/geometry.hpp
./install_mason.sh
node_modules: mason_packages/.link/bin/mapnik-config
@@ -27,6 +27,8 @@ coverage:
clean:
rm -rf lib/binding
rm -rf build
+ rm -rf mason
+ find test/ -name *actual* -exec rm {} \;
echo "run make distclean to also remove mason_packages and node_modules"
distclean: clean
diff --git a/appveyor.yml b/appveyor.yml
index f570feb..21c3ccc 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -4,44 +4,42 @@ environment:
node_pre_gyp_secretAccessKey:
secure: 1amwJJw9fu0j6dXnc5KsAQbSYf7Cjw/dapT6OZWABa6nc52grkKeLQ+DGaOfQz8i
matrix:
- # custom visual studio 2015 builds
- - nodejs_version: 0.10.40
+ - nodejs_version: 0.10
+ msvs_toolset: 14
platform: x64
+ - nodejs_version: 0.10
msvs_toolset: 14
- TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- - nodejs_version: 0.10.40
platform: x86
+ - nodejs_version: 4
+ msvs_toolset: 14
+ platform: x64
+ - nodejs_version: 4
msvs_toolset: 14
- TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- - nodejs_version: 4.4.1
platform: x86
+ - nodejs_version: 6
msvs_toolset: 14
- TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- - nodejs_version: 4.4.1
platform: x64
+ - nodejs_version: 6
msvs_toolset: 14
- TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- - nodejs_version: 5.9.1
platform: x86
+ - nodejs_version: 8
msvs_toolset: 14
- TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- - nodejs_version: 5.9.1
platform: x64
+ - nodejs_version: 8
msvs_toolset: 14
- TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
+ platform: x86
os: Visual Studio 2015
-# Disabled since we're seeing this hang frequently
-#cache:
-# - mapnik-sdk -> appveyor.yml
-
clone_depth: 20
install:
- - git submodule update --init
- scripts\build-appveyor.bat
+artifacts:
+ - path: build\stage\**\*.gz
+ name: package
+
build: off
test: off
deploy: off
diff --git a/common.gypi b/common.gypi
index dddcee9..5c0d62a 100644
--- a/common.gypi
+++ b/common.gypi
@@ -1,8 +1,9 @@
{
'target_defaults': {
'default_configuration': 'Release',
+ # the v140 refers to vs2015
'msbuild_toolset':'v140',
- 'msvs_disabled_warnings': [ 4068,4244,4005,4506,4345,4804,4805,4661 ],
+ 'msvs_disabled_warnings': [ 4503, 4068,4244,4005,4506,4345,4804,4805,4661 ],
'cflags_cc' : [
'-std=c++11',
],
diff --git a/install_mason.sh b/install_mason.sh
index 1669f5e..40f382d 100755
--- a/install_mason.sh
+++ b/install_mason.sh
@@ -12,7 +12,7 @@ ICU_VERSION="57.1"
if [ ! -f ./mason/mason.sh ]; then
mkdir -p ./mason
- curl -sSfL https://github.com/mapbox/mason/archive/d1a9856.tar.gz | tar --gunzip --extract --strip-components=1 --exclude="*md" --exclude="test*" --directory=./mason
+ curl -sSfL https://github.com/mapbox/mason/archive/9eac60614fda7cfeb8a9e81d18e8cca5c1ae8fbc.tar.gz | tar --gunzip --extract --strip-components=1 --exclude="*md" --exclude="test*" --directory=./mason
fi
if [ ! -f ./mason_packages/.link/bin/mapnik-config ]; then
@@ -38,5 +38,5 @@ if [ ! -f ./mason_packages/.link/bin/mapnik-config ]; then
# NOTE: sync this version with the `mapnik_version` in package.json (which is used for windows builds)
# In the future we could pull from that version automatically if mason were to support knowing the right dep
# versions to install automatically. Until then there is not much point since the deps are still hardcoded here.
- install mapnik 3.0.13-1
+ install mapnik 3.0.14
fi
diff --git a/package.json b/package.json
index 208f920..522ce65 100644
--- a/package.json
+++ b/package.json
@@ -4,8 +4,8 @@
"url": "http://github.com/mapnik/node-mapnik",
"homepage": "http://mapnik.org",
"author": "Dane Springmeyer <dane at mapbox.com> (mapnik.org)",
- "version": "3.6.0",
- "mapnik_version":"v3.0.13",
+ "version": "3.6.1",
+ "mapnik_version":"v3.0.14",
"main": "./lib/mapnik.js",
"binary": {
"module_name": "mapnik",
@@ -36,7 +36,7 @@
],
"license": "BSD-3-Clause",
"dependencies": {
- "mapnik-vector-tile": "1.3.0",
+ "mapnik-vector-tile": "1.4.0",
"protozero": "1.5.1",
"nan": "~2.5.0",
"node-pre-gyp": "~0.6.30"
@@ -56,6 +56,7 @@
"docs": "documentation build src/*.cpp src/mapnik_plugins.hpp --polyglot -o documentation -f html --github --name Mapnik"
},
"devDependencies": {
+ "node-gyp": "^3.6.1",
"aws-sdk": "2.0.12",
"jshint": "^2.5.10",
"mocha": "2.x",
diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat
index 0618102..e25df5e 100644
--- a/scripts/build-appveyor.bat
+++ b/scripts/build-appveyor.bat
@@ -4,6 +4,14 @@ SET EL=0
ECHO =========== %~f0 ===========
+git submodule update --init
+IF %ERRORLEVEL% NEQ 0 ECHO could not update submodules && GOTO ERROR
+
+:: only run Install-Product on AppVeyor
+:: TODO: check requested node version on local builds and bail if it doesn't match
+IF /I "%APPVEYOR%"=="True" powershell Install-Product node %nodejs_version% %PLATFORM%
+IF %ERRORLEVEL% NEQ 0 ECHO could not install requested node version && GOTO ERROR
+
SET MAPNIK_GIT=
FOR /F "tokens=*" %%i in ('node -e "console.log(require(""./package.json"").mapnik_version)"') DO SET MAPNIK_GIT=%%i
@@ -23,57 +31,10 @@ ECHO extracting mapnik sdk
IF EXIST mapnik-sdk (ECHO already extracted) ELSE (7z -y x mapnik-sdk.7z | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-:: replace installed node.exe with Mapbox node.exe
-:: so that the binaries based on Visual Studio 2015
-:: and built by https://travis-ci.org/mapbox/node-cpp11 are used
-SET ARCHPATH=
-IF /I %platform% == x64 (SET ARCHPATH=x64/)
-SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
-ECHO fetching node.exe^: %NODE_URL%
-powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
-:: we replace the existing node.exe with our own
-:: we do this in place so that the npm path logic
-:: is preserved. The alternative might be to put
-:: our custom node.exe on PATH from a custom location
-:: and then pass `--prefix` to npm - but this is untested
-ECHO deleting node.exe programfiles x64
-IF EXIST "%ProgramFiles%\nodejs" IF EXIST "%ProgramFiles%\nodejs\node.exe" ECHO found "%ProgramFiles%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles%\nodejs\node.exe"
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-ECHO copying node.exe to programfiles x64
-IF EXIST %ProgramFiles%\nodejs ECHO copying to "%ProgramFiles%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles%\nodejs\"
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
-ECHO deleting node.exe programfiles x86
-IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" IF EXIST "%ProgramFiles(x86)%\nodejs\node.exe" ECHO "found %ProgramFiles(x86)%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles(x86)%\nodejs\node.exe"
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
-ECHO copying node.exe to programfiles x86
-IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copying to "%ProgramFiles(x86)%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles(x86)%\nodejs\"
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
-::delete node.exe in current directory, that newer npm versions put stuff into the right directories
-IF EXIST node.exe DEL node.exe
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-IF EXIST node.pdb DEL node.pdb
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
-:: this is not needed on a fresh machine without previous installs
-:: but is important on a machine that already has compiled for a given
-:: node version. So, we have to clear to ensure that the Visual Studio 2015
-:: binaries are used rather than the ones from joyent (which are built with Visual Studio 2013)
-ECHO clear out node-gyp binary cache to ensure vs 2015 binaries are linked
-IF "%msvs_toolset%" == "14" IF EXIST %USERPROFILE%\.node-gyp rd /s /q %USERPROFILE%\.node-gyp
-
-::upgrade npm to get consistent behaviour with older node versions
-powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-CALL npm install -g npm-windows-upgrade at 0.5.3
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-CALL npm-windows-upgrade --version:3.3.2 --no-dns-check --no-prompt
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
+:: HACK!! to make node at 4.x x86 builds work
+:: see: https://github.com/mapbox/node-pre-gyp/issues/209#issuecomment-217690537
+CALL npm config set -g cafile=package.json
+CALL npm config set -g strict-ssl=false
ECHO activating VS command prompt...
IF /I %platform% == x64 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
@@ -107,14 +68,6 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============
-:: install node-gyp globally to:
-:: 1) ensure node-gyp can find it (probably optional)
-:: 2) ensure we have recent enough node-gyp to understand VS 2015 (needed for node v0.10.x certainly)
-ECHO installing node-gyp
-CALL npm install -g node-gyp
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-ECHO ERRORLEVEL^: %ERRORLEVEL%
-
:: get ready to build agains the mapnik SDK
SET MAPNIK_SDK=%CD%\mapnik-sdk
SET PATH=%MAPNIK_SDK%\bin;%MAPNIK_SDK%\lib;%PATH%
@@ -124,7 +77,8 @@ SET ICU_DATA=%MAPNIK_SDK%\share\icu
:: actually install deps + compile node-mapnik
ECHO building node-mapnik
-CALL npm install --build-from-source --msvs_version=2015 %TOOLSET_ARGS% --loglevel=http
+:: --msvs_version=2015 is passed along to node-gyp here
+CALL npm install --build-from-source --msvs_version=2015 --loglevel=http --node_shared=true
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module_path --silent') DO SET NODEMAPNIK_BINDING_DIR=%%i
@@ -141,18 +95,31 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
powershell scripts\build_against_sdk_03-write-mapnik.settings.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS%
-IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-
CALL npm test
:: uncomment to allow build to work even if tests do not pass
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE%
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
-IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
+
+:: publish binaries to v140 path
+IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing v140... && CALL node_modules\.bin\node-pre-gyp package publish --toolset=v140) ELSE (ECHO not publishing)
+IF %ERRORLEVEL% NEQ 0 GOTO ERROR
+IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing v140 ... && CALL node_modules\.bin\node-pre-gyp package unpublish publish --toolset=v140) ELSE (ECHO not republishing)
+IF %ERRORLEVEL% NEQ 0 GOTO ERROR
+
+ECHO packaging ...
+CALL node_modules\.bin\node-pre-gyp package
+IF %ERRORLEVEL% NEQ 0 ECHO error during packaging && GOTO ERROR
+
+:: publish binaries to default path
+:: in the future this may change depending on:
+:: 1) what visual studio versions we support
+:: 2) how visual studio binaries are or are not compatible with each other
+:: more details: https://github.com/mapnik/node-mapnik/issues/756
+IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp publish) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 unpublish publish %TOOLSET_ARGS%) ELSE (ECHO not republishing)
+IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp unpublish publish) ELSE (ECHO not republishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
diff --git a/test/data/images/14_2788_6533.webp b/test/data/images/14_2788_6533.webp
new file mode 100644
index 0000000..36740c5
Binary files /dev/null and b/test/data/images/14_2788_6533.webp differ
diff --git a/test/data/images/large_overzoom.expected.png b/test/data/images/large_overzoom.expected.png
new file mode 100644
index 0000000..9340489
Binary files /dev/null and b/test/data/images/large_overzoom.expected.png differ
diff --git a/test/data/images/sat_image-expected-100x100-offset.tif b/test/data/images/sat_image-expected-100x100-offset.tif
index 26a9301..263931a 100644
Binary files a/test/data/images/sat_image-expected-100x100-offset.tif and b/test/data/images/sat_image-expected-100x100-offset.tif differ
diff --git a/test/data/images/sat_image-expected-50x50-offset.tif b/test/data/images/sat_image-expected-50x50-offset.tif
index 5a1442c..2e6178e 100644
Binary files a/test/data/images/sat_image-expected-50x50-offset.tif and b/test/data/images/sat_image-expected-50x50-offset.tif differ
diff --git a/test/data/large_overzoom.xml b/test/data/large_overzoom.xml
new file mode 100644
index 0000000..d8c249a
--- /dev/null
+++ b/test/data/large_overzoom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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" base="/Users/mthompson/src/api-maps/node_modules/mapbox-maps/node_modules/@mapbox/tilelive-vector/" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">
+ <Parameters>
+ <Parameter name="bounds">-180,-85.0511,180,85.0511</Parameter>
+ <Parameter name="center">0,0,3</Parameter>
+ <Parameter name="format">png8:m=h</Parameter>
+ <Parameter name="maxzoom">22</Parameter>
+ <Parameter name="minzoom">0</Parameter>
+ <Parameter name="scale">1</Parameter>
+ </Parameters>
+ <Style name="_image" filter-mode="first" comp-op="screen">
+ <Rule>
+ <Filter>([mapnik::geometry_type]=3)</Filter>
+ <LineSymbolizer stroke="rgba(85,187,102,0.502)" stroke-width="0.5"/>
+ <PolygonSymbolizer fill="rgba(85,187,102,0.051)"/>
+ </Rule>
+ <Rule>
+ <Filter>([mapnik::geometry_type]=2)</Filter>
+ <LineSymbolizer stroke="rgba(85,187,102,0.502)" stroke-width="1"/>
+ </Rule>
+ <Rule>
+ <Filter>([mapnik::geometry_type]=1)</Filter>
+ <DotSymbolizer fill="rgba(85,187,102,0.502)" width="5"/>
+ <TextSymbolizer allow-overlap="true" dy="6" justify-alignment="left" face-name="Source Sans Pro Regular" size="12" fill="rgba(85,187,102,0.749)">[name]</TextSymbolizer>
+ </Rule>
+ </Style>
+ <Style name="_image-raster" filter-mode="first">
+ <Rule>
+ <ElseFilter/>
+ <RasterSymbolizer opacity="1"/>
+ </Rule>
+ </Style>
+ <Layer name="_image" 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">
+ <StyleName>_image</StyleName>
+ <StyleName>_image-raster</StyleName>
+ </Layer>
+ <Layer name="_image" 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">
+ <StyleName>_image</StyleName>
+ </Layer>
+</Map>
diff --git a/test/data/sat_map.xml b/test/data/sat_map.xml
index b4ad728..dcbdc55 100644
--- a/test/data/sat_map.xml
+++ b/test/data/sat_map.xml
@@ -1,7 +1,7 @@
<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">
<Style name="style">
<Rule>
- <RasterSymbolizer scaling="sinc" filter-factor="2.5"/>
+ <RasterSymbolizer scaling="sinc" filter-factor="2.0"/>
</Rule>
</Style>
<Layer name="raster" 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">
diff --git a/test/data/vector_tile/compositing/expected/2-1-1b.png b/test/data/vector_tile/compositing/expected/2-1-1b.png
index 98edf01..0086046 100644
Binary files a/test/data/vector_tile/compositing/expected/2-1-1b.png and b/test/data/vector_tile/compositing/expected/2-1-1b.png differ
diff --git a/test/data/vector_tile/tile-raster.expected.jpg b/test/data/vector_tile/tile-raster.expected.jpg
index 00f6a2a..20a6cae 100644
Binary files a/test/data/vector_tile/tile-raster.expected.jpg and b/test/data/vector_tile/tile-raster.expected.jpg differ
diff --git a/test/geometry.test.js b/test/geometry.test.js
index c837d6c..67b2964 100644
--- a/test/geometry.test.js
+++ b/test/geometry.test.js
@@ -183,20 +183,6 @@ describe('mapnik.Geometry ', function() {
assert.equal(geom.typeName(), 'GeometryCollection');
});
- it('should return a type name for an unknown geometry', function() {
- var input = {
- type: 'Feature',
- properties: {},
- geometry: {
- type: 'MultiPoint',
- coordinates: [ 10, 15 ]
- }
- };
- var f = new mapnik.Feature.fromJSON(JSON.stringify(input));
- var geom = f.geometry();
- assert.equal(geom.typeName(), 'Unknown');
- });
-
it('should return a type name for a broken geometry', function() {
var input = {
type: 'Feature',
diff --git a/test/image.test.js b/test/image.test.js
index 80931d2..92cf5ee 100644
--- a/test/image.test.js
+++ b/test/image.test.js
@@ -1493,7 +1493,7 @@ describe('mapnik.Image ', function() {
it('resize async should yield the same results as rendered image', function(done) {
var im = new mapnik.Image.open('test/data/images/sat_image.png');
im.premultiply();
- im.resize(50,50, {scaling_method:mapnik.imageScaling.sinc, filter_factor:2.5}, function(err, result) {
+ im.resize(50,50, {scaling_method:mapnik.imageScaling.sinc, filter_factor:2.0}, function(err, result) {
if (err) throw err;
var map = new mapnik.Map(50,50);
map.load('test/data/sat_map.xml', function(err, map) {
@@ -1513,7 +1513,7 @@ describe('mapnik.Image ', function() {
it('resize sync should yield the same results as rendered image', function(done) {
var im = new mapnik.Image.open('test/data/images/sat_image.png');
im.premultiply();
- var result = im.resizeSync(50, 50, {scaling_method:mapnik.imageScaling.sinc, filter_factor:2.5});
+ var result = im.resizeSync(50, 50, {scaling_method:mapnik.imageScaling.sinc, filter_factor:2.0});
var map = new mapnik.Map(50,50);
map.load('test/data/sat_map.xml', function(err, map) {
if (err) throw err;
diff --git a/test/vector-tile.query.test.js b/test/vector-tile.query.test.js
index ecbb782..bbe2335 100644
--- a/test/vector-tile.query.test.js
+++ b/test/vector-tile.query.test.js
@@ -521,7 +521,7 @@ describe('mapnik.VectorTile query (distance <= tolerance)', function() {
"type": "Feature",
"geometry": {
"type": "Polygon",
- "coordinates": [ [-180,85], [180,-85], [-180,-85], [-180,85] ]
+ "coordinates": [[[-180,85], [180,-85], [-180,-85], [-180,85]]]
},
"properties": { "name": "A" }
}]
diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js
index d84778d..95190d2 100644
--- a/test/vector-tile.test.js
+++ b/test/vector-tile.test.js
@@ -985,9 +985,11 @@ describe('mapnik.VectorTile ', function() {
gzip.removeAllListeners();
gzip=null;
var compressed = vtile.getData({compression:'gzip', strategy:'RLE'});
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
vtile.getData({compression:'gzip', strategy:'RLE'}, function (err, compressed) {
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
done();
});
});
@@ -1038,9 +1040,11 @@ describe('mapnik.VectorTile ', function() {
gzip.removeAllListeners();
gzip=null;
var compressed = vtile.getData({compression:'gzip', strategy:'FILTERED'});
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
vtile.getData({compression:'gzip', strategy:'FILTERED'}, function (err, compressed) {
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
done();
});
});
@@ -1091,9 +1095,11 @@ describe('mapnik.VectorTile ', function() {
gzip.removeAllListeners();
gzip=null;
var compressed = vtile.getData({compression:'gzip', strategy:'HUFFMAN_ONLY'});
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
vtile.getData({compression:'gzip', strategy:'HUFFMAN_ONLY'}, function (err, compressed) {
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
done();
});
});
@@ -1144,9 +1150,11 @@ describe('mapnik.VectorTile ', function() {
gzip.removeAllListeners();
gzip=null;
var compressed = vtile.getData({compression:'gzip', strategy:'FIXED'});
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
vtile.getData({compression:'gzip', strategy:'FIXED'}, function (err, compressed) {
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring is used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
done();
});
});
@@ -1197,9 +1205,11 @@ describe('mapnik.VectorTile ', function() {
gzip.removeAllListeners();
gzip=null;
var compressed = vtile.getData({compression:'gzip', strategy:'DEFAULT'});
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
vtile.getData({compression:'gzip', strategy:'DEFAULT'}, function (err, compressed) {
- assert.equal(buffer.toString('hex'), compressed.toString('hex'));
+ // Substring used to remove gzip header
+ assert.equal(buffer.toString('hex').substring(20), compressed.toString('hex').substring(20));
done();
});
});
@@ -2068,6 +2078,35 @@ describe('mapnik.VectorTile ', function() {
});
});
+ it('should render an image with a large amount of overzooming', function(done) {
+ var data = fs.readFileSync("./test/data/images/14_2788_6533.webp");
+ var vtile = new mapnik.VectorTile(14,2788,6533);
+ vtile.addImageBufferSync(data, '_image');
+ var map = new mapnik.Map(256,256);
+ map.loadSync('./test/data/large_overzoom.xml');
+ var opts = { z: 24, x: 2855279, y: 6690105, scale: 1, buffer_size: 256 };
+ var img = new mapnik.Image(256,256);
+ vtile.render(map, img, opts, function(err, image) {
+ if (err) throw err;
+ var expected = './test/data/images/large_overzoom.expected.png';
+ var actual = './test/data/images/large_overzoom.actual.png';
+ if (!existsSync(expected) || process.env.UPDATE) {
+ image.save(expected, 'png32');
+ }
+ image.save(actual, 'png32');
+ var e = fs.readFileSync(expected);
+ var a = fs.readFileSync(actual);
+ if (mapnik.versions.mapnik_number >= 300000) {
+ assert.ok(Math.abs(e.length - a.length) < 100);
+ } else {
+ assert.equal(e.length,a.length);
+ }
+
+ done();
+ });
+
+ });
+
it('should render expected results - with objectional arguments', function(done) {
var data = fs.readFileSync("./test/data/vector_tile/tile3.mvt");
var vtile = new mapnik.VectorTile(5,28,12);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/node-mapnik.git
More information about the Pkg-javascript-commits
mailing list