From 25a9cab9ada3b6c8a1428a5cfeac60afb6c5955e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 6 Dec 2015 15:10:43 +0000 Subject: [PATCH 01/12] Fix name reported by mapnik-render --- utils/mapnik-render/mapnik-render.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/mapnik-render/mapnik-render.cpp b/utils/mapnik-render/mapnik-render.cpp index 0ed950cca..c39922639 100644 --- a/utils/mapnik-render/mapnik-render.cpp +++ b/utils/mapnik-render/mapnik-render.cpp @@ -32,7 +32,7 @@ int main (int argc,char** argv) try { - po::options_description desc("nik2img utility"); + po::options_description desc("mapnik-render utility"); desc.add_options() ("help,h", "produce usage message") ("version,V","print version string") From 75cb954d2644fe3fe603d26a01eb81d528f03ab5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 14 Dec 2015 15:27:48 -0800 Subject: [PATCH 02/12] update test-data to include new postgis sql --- test/data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/data b/test/data index 116c65b3f..5be80ebbd 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit 116c65b3f6c12feb7709031ccc92b0f604d44f53 +Subproject commit 5be80ebbd596e42e45fc6dfd4cfca0cc6b814c73 From e1498deaa8ade23230bb0a5e320154138065e259 Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Tue, 15 Dec 2015 19:51:31 +0000 Subject: [PATCH 03/12] [skip ci] Windows: * read Boost version from AppVeyor.yml * init submodules from build-local.bat --- scripts/build-local.bat | 33 ++++++++++++++++++++++++++++++--- scripts/parse-appveyor-yml.ps1 | 7 +++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 scripts/parse-appveyor-yml.ps1 diff --git a/scripts/build-local.bat b/scripts/build-local.bat index 5d9affc7f..2dbbd1371 100644 --- a/scripts/build-local.bat +++ b/scripts/build-local.bat @@ -8,14 +8,39 @@ SET APPVEYOR_REPO_COMMIT_MESSAGE=this is a [build appveyor] test SET APPVEYOR=true ::comment this to get complete AppVeyor behaviour SET LOCAL_BUILD_DONT_SKIP_TESTS=true - -SET MAPNIK_GIT=3.0.5 -SET BOOST_VERSION=59 SET FASTBUILD=1 + +FOR /F "tokens=1 usebackq" %%i in (`powershell .\scripts\parse-appveyor-yml.ps1`) DO SET BOOST_VERSION=%%i +ECHO BOOST_VERSION found in appveyor.yml^: %BOOST_VERSION% +IF "%BOOST_VERSION%"=="0" ECHO BOOST_VERSION not valid && SET ERRORLEVEL=1 && GOTO ERROR + + +:: OVERRIDE PARAMETERS >>>>>>>> +:NEXT-ARG + +IF '%1'=='' GOTO ARGS-DONE +ECHO setting %1 +SET %1 +SHIFT +GOTO NEXT-ARG + +:ARGS-DONE +::<<<<< OVERRIDE PARAMETERS + + SET configuration=Release SET msvs_toolset=14 SET platform=x64 SET APPVEYOR_BUILD_FOLDER=%CD% + + + +ECHO pulling test data +CALL git submodule update --init +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +ECHO pulling test data, DONE + +SET TIME_START_LOCAL_BUILD=%TIME% CALL scripts\build-appveyor.bat IF %ERRORLEVEL% NEQ 0 GOTO ERROR @@ -28,5 +53,7 @@ SET EL=%ERRORLEVEL% :DONE ECHO =========== DONE %~f0 =========== +ECHO build started^: %TIME_START_LOCAL_BUILD% +ECHO build finished^: %TIME% EXIT /b %EL% diff --git a/scripts/parse-appveyor-yml.ps1 b/scripts/parse-appveyor-yml.ps1 new file mode 100644 index 000000000..f87ae7e3a --- /dev/null +++ b/scripts/parse-appveyor-yml.ps1 @@ -0,0 +1,7 @@ +$ErrorActionPreference = 'Stop' +$boost_version='0' +Get-Content .\appveyor.yml | + foreach { + if ($_ -match "BOOST_VERSION: "){ $boost_version = $_.split()[-1] } + } +Write-Host $boost_version From d75fd12eab60dcc4c7f703b5c1e03f5309c14670 Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Wed, 16 Dec 2015 10:56:05 +0000 Subject: [PATCH 04/12] Windows: output pagefile size on AppVeyor (compiler out of heapspace) --- scripts/appveyor-system-info.ps1 | 13 +++++++++++++ scripts/build-appveyor.bat | 1 + 2 files changed, 14 insertions(+) create mode 100644 scripts/appveyor-system-info.ps1 diff --git a/scripts/appveyor-system-info.ps1 b/scripts/appveyor-system-info.ps1 new file mode 100644 index 000000000..e061c98e2 --- /dev/null +++ b/scripts/appveyor-system-info.ps1 @@ -0,0 +1,13 @@ +$SystemManaged = Get-WmiObject -Class Win32_ComputerSystem | % {$_.AutomaticManagedPagefile} +$total_physicalmem = gwmi Win32_ComputerSystem | % {[Math]::round($_.TotalPhysicalMemory/1MB,0)} +$physical_mem = get-ciminstance -class 'cim_physicalmemory' | % { $_.Capacity/1024/1024} + +$PF =gwmi Win32_PageFileUsage +$PageFileLocation = $PF.Name; +$PageFileSize = $PF.AllocatedBaseSize + +Write-Host "physical memory : $physical_mem" +Write-Host "total physical memory : $total_physicalmem" +Write-Host "page file system managed : $SystemManaged" +Write-Host "page file location : $PageFileLocation" +Write-Host "page file size : $PageFileSize" \ No newline at end of file diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 0cadb5ef8..4bfbe9b22 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -8,6 +8,7 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS% ECHO RAM [MB]^: powershell "get-ciminstance -class 'cim_physicalmemory' | %% { $_.Capacity/1024/1024}" IF %ERRORLEVEL% NEQ 0 GOTO ERROR +powershell .\scripts\appveyor-system-info.ps1 ::only build on AppVeyor, if explicitly stated ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE% From 34f7c86caf2f9f990bbaf7f431078f3bd2264daa Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Wed, 16 Dec 2015 11:29:22 +0000 Subject: [PATCH 05/12] AppVeyor: try to increase page file size via powershell --- scripts/appveyor-system-info.ps1 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/appveyor-system-info.ps1 b/scripts/appveyor-system-info.ps1 index e061c98e2..662df3451 100644 --- a/scripts/appveyor-system-info.ps1 +++ b/scripts/appveyor-system-info.ps1 @@ -5,9 +5,29 @@ $physical_mem = get-ciminstance -class 'cim_physicalmemory' | % { $_.Capacity/10 $PF =gwmi Win32_PageFileUsage $PageFileLocation = $PF.Name; $PageFileSize = $PF.AllocatedBaseSize +$CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting Write-Host "physical memory : $physical_mem" Write-Host "total physical memory : $total_physicalmem" Write-Host "page file system managed : $SystemManaged" Write-Host "page file location : $PageFileLocation" -Write-Host "page file size : $PageFileSize" \ No newline at end of file +Write-Host "page file size : $PageFileSize" +Write-Host page file min size : $CurrentPageFile.InitialSize +Write-Host "page file max size : $CurrentPageFile.MaximumSize" + +#disable automatically managed page file settings +$c = Get-WmiObject Win32_computersystem -EnableAllPrivileges +if($c.AutomaticManagedPagefile){ + Write-Host disabling managed page file settings + $c.AutomaticManagedPagefile = $false + $c.Put() | Out-Null +} + +$new_page_size=8192 + +if($PageFileSize -lt $new_page_size){ + Write-Host "settings new page file size to $new_page_size" + $CurrentPageFile.InitialSize=$new_page_size + $CurrentPageFile.MaximumSize=$new_page_size + $CurrentPageFile.Put() | Out-Null +} From 1a49fe20fb34669d3527b0f4fca6d38956602932 Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Wed, 16 Dec 2015 12:04:35 +0000 Subject: [PATCH 06/12] AppVeyor: set powershell execution policy --- scripts/appveyor-system-info.ps1 | 43 +++++++++++++++++++++++--------- scripts/build-appveyor.bat | 4 +-- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/scripts/appveyor-system-info.ps1 b/scripts/appveyor-system-info.ps1 index 662df3451..1b60c8567 100644 --- a/scripts/appveyor-system-info.ps1 +++ b/scripts/appveyor-system-info.ps1 @@ -1,19 +1,21 @@ -$SystemManaged = Get-WmiObject -Class Win32_ComputerSystem | % {$_.AutomaticManagedPagefile} +$PSVersionTable +$PSVersionTable.PSVersion + +$SystemManaged = Get-WmiObject -Class Win32_ComputerSystem | % {$_.AutomaticManagedPagefile} $total_physicalmem = gwmi Win32_ComputerSystem | % {[Math]::round($_.TotalPhysicalMemory/1MB,0)} $physical_mem = get-ciminstance -class 'cim_physicalmemory' | % { $_.Capacity/1024/1024} $PF =gwmi Win32_PageFileUsage $PageFileLocation = $PF.Name; $PageFileSize = $PF.AllocatedBaseSize -$CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting -Write-Host "physical memory : $physical_mem" -Write-Host "total physical memory : $total_physicalmem" -Write-Host "page file system managed : $SystemManaged" -Write-Host "page file location : $PageFileLocation" -Write-Host "page file size : $PageFileSize" -Write-Host page file min size : $CurrentPageFile.InitialSize -Write-Host "page file max size : $CurrentPageFile.MaximumSize" +Write-Host "physical memory : "$physical_mem +Write-Host "total physical memory : "$total_physicalmem +Write-Host "page file system managed : "$SystemManaged +Write-Host "page file location : "$PageFileLocation +Write-Host "page file size : "$PageFileSize +Write-Host "InitialSize : "${CurrentPageFile}.InitialSize +Write-Host "MaximumSize : "$CurrentPageFile.MaximumSize #disable automatically managed page file settings $c = Get-WmiObject Win32_computersystem -EnableAllPrivileges @@ -23,11 +25,28 @@ if($c.AutomaticManagedPagefile){ $c.Put() | Out-Null } -$new_page_size=8192 - -if($PageFileSize -lt $new_page_size){ +$new_page_size=18000 +$CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting +if($CurrentPageFile.InitialSize -ne $new_page_size){ Write-Host "settings new page file size to $new_page_size" $CurrentPageFile.InitialSize=$new_page_size $CurrentPageFile.MaximumSize=$new_page_size $CurrentPageFile.Put() | Out-Null } + +Write-Host "new ------------ " +Write-Host "system managed:" (Get-WmiObject -Class Win32_ComputerSystem | % {$_.AutomaticManagedPagefile}) +Write-Host "page file size:" (gwmi Win32_PageFileUsage).AllocatedBaseSize +Write-Host "InitialSize: "${CurrentPageFile}.InitialSize +Write-Host "MaximumSize: "$CurrentPageFile.MaximumSize + +#list drives +Get-WmiObject -Class Win32_LogicalDisk | + Where-Object {$_.DriveType -ne 5} | + Sort-Object -Property Name | + Select-Object Name, VolumeName, FileSystem, Description, VolumeDirty, ` + @{"Label"="DiskSize(GB)";"Expression"={"{0:N}" -f ($_.Size/1GB) -as [float]}}, ` + @{"Label"="FreeSpace(GB)";"Expression"={"{0:N}" -f ($_.FreeSpace/1GB) -as [float]}}, ` + @{"Label"="%Free";"Expression"={"{0:N}" -f ($_.FreeSpace/$_.Size*100) -as [float]}} | + Format-Table -AutoSize + diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 4bfbe9b22..1f332d53b 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -5,10 +5,10 @@ SET EL=0 ECHO =========== %~f0 =========== ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS% -ECHO RAM [MB]^: -powershell "get-ciminstance -class 'cim_physicalmemory' | %% { $_.Capacity/1024/1024}" +powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force IF %ERRORLEVEL% NEQ 0 GOTO ERROR powershell .\scripts\appveyor-system-info.ps1 +IF %ERRORLEVEL% NEQ 0 GOTO ERROR ::only build on AppVeyor, if explicitly stated ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE% From eff087c0cfb8c0e8174ab283890b380e3a8ed8c8 Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Wed, 16 Dec 2015 14:19:55 +0000 Subject: [PATCH 07/12] [skip ci] Windows: only manipulate page file settings on AppVeyor --- scripts/appveyor-system-info.ps1 | 45 ++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/scripts/appveyor-system-info.ps1 b/scripts/appveyor-system-info.ps1 index 1b60c8567..550cfb530 100644 --- a/scripts/appveyor-system-info.ps1 +++ b/scripts/appveyor-system-info.ps1 @@ -17,28 +17,33 @@ Write-Host "page file size : "$PageFileSize Write-Host "InitialSize : "${CurrentPageFile}.InitialSize Write-Host "MaximumSize : "$CurrentPageFile.MaximumSize -#disable automatically managed page file settings -$c = Get-WmiObject Win32_computersystem -EnableAllPrivileges -if($c.AutomaticManagedPagefile){ - Write-Host disabling managed page file settings - $c.AutomaticManagedPagefile = $false - $c.Put() | Out-Null -} +if($env:APPVEYOR -eq "true"){ + Write-Host !!!!!!! on AppVeyor: changing page file settings !!!!!!!!!! + #disable automatically managed page file settings + $c = Get-WmiObject Win32_computersystem -EnableAllPrivileges + if($c.AutomaticManagedPagefile){ + Write-Host disabling managed page file settings + $c.AutomaticManagedPagefile = $false + $c.Put() | Out-Null + } -$new_page_size=18000 -$CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting -if($CurrentPageFile.InitialSize -ne $new_page_size){ - Write-Host "settings new page file size to $new_page_size" - $CurrentPageFile.InitialSize=$new_page_size - $CurrentPageFile.MaximumSize=$new_page_size - $CurrentPageFile.Put() | Out-Null -} + $new_page_size=18000 + $CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting + if($CurrentPageFile.InitialSize -ne $new_page_size){ + Write-Host "setting new page file size to $new_page_size" + $CurrentPageFile.InitialSize=$new_page_size + $CurrentPageFile.MaximumSize=$new_page_size + $CurrentPageFile.Put() | Out-Null + } -Write-Host "new ------------ " -Write-Host "system managed:" (Get-WmiObject -Class Win32_ComputerSystem | % {$_.AutomaticManagedPagefile}) -Write-Host "page file size:" (gwmi Win32_PageFileUsage).AllocatedBaseSize -Write-Host "InitialSize: "${CurrentPageFile}.InitialSize -Write-Host "MaximumSize: "$CurrentPageFile.MaximumSize + Write-Host "new ------------ " + Write-Host "system managed:" (Get-WmiObject -Class Win32_ComputerSystem | % {$_.AutomaticManagedPagefile}) + Write-Host "page file size:" (gwmi Win32_PageFileUsage).AllocatedBaseSize + Write-Host "InitialSize: "${CurrentPageFile}.InitialSize + Write-Host "MaximumSize: "$CurrentPageFile.MaximumSize +} else { + Write-Host not on AppVeyor, leaving page file as is +} #list drives Get-WmiObject -Class Win32_LogicalDisk | From e3a1108ebd52b2279b8f47336db465bab7180795 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 16 Dec 2015 13:01:56 -0800 Subject: [PATCH 08/12] Add a script to time how long it takes to compile a header inside mapnik --- scripts/time-header | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 scripts/time-header diff --git a/scripts/time-header b/scripts/time-header new file mode 100755 index 000000000..97c3c6977 --- /dev/null +++ b/scripts/time-header @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +CXXFLAGS="$(./utils/mapnik-config/mapnik-config --cflags)" +CXX="$(./utils/mapnik-config/mapnik-config --cxx)" +echo "Time taken to compile '$(basename $1)':" +time ${CXX} $1 -I./test -I./deps/agg/include -Ideps -I./include $CXXFLAGS -o /tmp/header.out \ No newline at end of file From ce98a5c81131136cf198db6f24af6cd55ec2626d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 16 Dec 2015 13:17:19 -0800 Subject: [PATCH 09/12] fix header glitches uncovered by time-header script - refs #3208 --- include/mapnik/image_scaling_traits.hpp | 4 +++- include/mapnik/image_util_jpeg.hpp | 2 ++ include/mapnik/{span_image_filter.h => span_image_filter.hpp} | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) rename include/mapnik/{span_image_filter.h => span_image_filter.hpp} (99%) diff --git a/include/mapnik/image_scaling_traits.hpp b/include/mapnik/image_scaling_traits.hpp index 69eec5a05..81ddf54e4 100644 --- a/include/mapnik/image_scaling_traits.hpp +++ b/include/mapnik/image_scaling_traits.hpp @@ -24,7 +24,9 @@ #define MAPNIK_IMAGE_SCALING_TRAITS_HPP // mapnik -#include +#include +#include +#include // agg #include "agg_image_accessors.h" diff --git a/include/mapnik/image_util_jpeg.hpp b/include/mapnik/image_util_jpeg.hpp index b8b213a0c..feb810533 100644 --- a/include/mapnik/image_util_jpeg.hpp +++ b/include/mapnik/image_util_jpeg.hpp @@ -23,6 +23,8 @@ #ifndef MAPNIK_IMAGE_UTIL_JPEG_HPP #define MAPNIK_IMAGE_UTIL_JPEG_HPP +#include + // stl #include #include diff --git a/include/mapnik/span_image_filter.h b/include/mapnik/span_image_filter.hpp similarity index 99% rename from include/mapnik/span_image_filter.h rename to include/mapnik/span_image_filter.hpp index cd843010b..972558ccf 100644 --- a/include/mapnik/span_image_filter.h +++ b/include/mapnik/span_image_filter.hpp @@ -26,6 +26,8 @@ #include "agg_span_image_filter_gray.h" #include "agg_span_image_filter_rgba.h" +#include + #include namespace mapnik From a0719870ab793a975575a6053f0421b33fc8da85 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 16 Dec 2015 14:22:09 -0800 Subject: [PATCH 10/12] remove out of date/unused header --- include/mapnik/geometry_unique.hpp | 82 ------------------------------ 1 file changed, 82 deletions(-) delete mode 100644 include/mapnik/geometry_unique.hpp diff --git a/include/mapnik/geometry_unique.hpp b/include/mapnik/geometry_unique.hpp deleted file mode 100644 index 167822801..000000000 --- a/include/mapnik/geometry_unique.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2015 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_GEOMETRY_UNIQUE_HPP -#define MAPNIK_GEOMETRY_UNIQUE_HPP - -#include -#include -#include - -#include - -namespace mapnik { namespace geometry { - -namespace detail { - -struct geometry_unique -{ - using result_type = void; - - result_type operator() (geometry & geom) const - { - mapnik::util::apply_visitor(*this, geom); - } - - result_type operator() (geometry_collection & collection) const - { - for (auto & geom : collection) - { - (*this)(geom); - } - } - - result_type operator() (line_string & line) const - { - boost::geometry::unique(line); - } - - result_type operator() (polygon & poly) const - { - boost::geometry::unique(poly); - } - - template - result_type operator() (T & geom) const - { - // no-op - } - -}; - -} - -template -inline void unique(GeomType & geom) -{ - static_assert(!std::is_const::value,"mapnik::geometry::unique on const& is invalid"); - detail::geometry_unique()(geom); -} - -}} - -#endif // MAPNIK_GEOMETRY_UNIQUE_HPP From bd21e452d1155c3f14965410625b983224a948a2 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 16 Dec 2015 14:22:36 -0800 Subject: [PATCH 11/12] fix minor header glitches to allow headers to compile standalone --- include/mapnik/image_filter_grammar.hpp | 9 +++++---- include/mapnik/image_null.hpp | 1 + include/mapnik/image_util_png.hpp | 2 ++ include/mapnik/image_view_null.hpp | 2 +- include/mapnik/mapped_memory_cache.hpp | 2 +- include/mapnik/symbolizer_default_values.hpp | 5 +++++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index 04ced605b..ef9b6697b 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -23,16 +23,17 @@ #ifndef MAPNIK_IMAGE_FILITER_GRAMMAR_HPP #define MAPNIK_IMAGE_FILITER_GRAMMAR_HPP +// mapnik +#include +#include +#include + #pragma GCC diagnostic push #include #include #include #pragma GCC diagnostic pop -// mapnik -#include -#include - // stl #include diff --git a/include/mapnik/image_null.hpp b/include/mapnik/image_null.hpp index 67dbbd358..2fc4e32c5 100644 --- a/include/mapnik/image_null.hpp +++ b/include/mapnik/image_null.hpp @@ -25,6 +25,7 @@ // mapnik #include +#include #include //stl diff --git a/include/mapnik/image_util_png.hpp b/include/mapnik/image_util_png.hpp index e02cb4427..8592c4fd4 100644 --- a/include/mapnik/image_util_png.hpp +++ b/include/mapnik/image_util_png.hpp @@ -23,6 +23,8 @@ #ifndef MAPNIK_IMAGE_UTIL_PNG_HPP #define MAPNIK_IMAGE_UTIL_PNG_HPP +#include + // stl #include #include diff --git a/include/mapnik/image_view_null.hpp b/include/mapnik/image_view_null.hpp index 5672c05dd..76ebc5f49 100644 --- a/include/mapnik/image_view_null.hpp +++ b/include/mapnik/image_view_null.hpp @@ -23,7 +23,7 @@ #ifndef MAPNIK_IMAGE_VIEW_NULL_HPP #define MAPNIK_IMAGE_VIEW_NULL_HPP -#include +#include //stl #include diff --git a/include/mapnik/mapped_memory_cache.hpp b/include/mapnik/mapped_memory_cache.hpp index f41c2e803..6b6102c4e 100644 --- a/include/mapnik/mapped_memory_cache.hpp +++ b/include/mapnik/mapped_memory_cache.hpp @@ -28,8 +28,8 @@ #include #include -// boost #include +#include #include #include diff --git a/include/mapnik/symbolizer_default_values.hpp b/include/mapnik/symbolizer_default_values.hpp index b70ea194b..ea5e5c02e 100644 --- a/include/mapnik/symbolizer_default_values.hpp +++ b/include/mapnik/symbolizer_default_values.hpp @@ -24,7 +24,12 @@ #define MAPNIK_SYMBOLIZER_DEFAULT_VALUES_HPP #include +#include +#include +#include +#include #include +#include #include From e0c756ee8d90c9cd1cbc67c8b5e2ce5d7451128a Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 17 Dec 2015 12:03:19 +0000 Subject: [PATCH 12/12] geometry_envelope - add missing linear_ring --- include/mapnik/geometry_envelope_impl.hpp | 23 ++++++++++++++--------- src/geometry_envelope.cpp | 2 ++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/mapnik/geometry_envelope_impl.hpp b/include/mapnik/geometry_envelope_impl.hpp index dbed6aa47..5c39bc386 100644 --- a/include/mapnik/geometry_envelope_impl.hpp +++ b/include/mapnik/geometry_envelope_impl.hpp @@ -41,7 +41,7 @@ struct geometry_envelope { return mapnik::util::apply_visitor(*this, geom); } - + void operator() (mapnik::geometry::geometry_empty const&) const {} template @@ -60,30 +60,36 @@ struct geometry_envelope bool first = true; for (auto const& pt : line) { - if (first && !bbox.valid()) + if (first && !bbox.valid()) { bbox.init(pt.x, pt.y, pt.x, pt.y); first = false; } - else + else { bbox.expand_to_include(pt.x, pt.y); } } } + template + void operator() (mapnik::geometry::linear_ring const& ring) const + { + (*this)(static_cast const&>(ring)); + } + template void operator() (mapnik::geometry::polygon const& poly) const { bool first = true; for (auto const& pt : poly.exterior_ring) { - if (first && !bbox.valid()) + if (first && !bbox.valid()) { bbox.init(pt.x, pt.y, pt.x, pt.y); first = false; } - else + else { bbox.expand_to_include(pt.x, pt.y); } @@ -96,12 +102,12 @@ struct geometry_envelope bool first = true; for (auto const& pt : multi_point) { - if (first && !bbox.valid()) + if (first && !bbox.valid()) { bbox.init(pt.x, pt.y, pt.x, pt.y); first = false; } - else + else { bbox.expand_to_include(pt.x, pt.y); } @@ -140,7 +146,7 @@ struct geometry_envelope template mapnik::box2d envelope(T const& geom) -{ +{ box2d bbox; detail::geometry_envelope op(bbox); op(geom); @@ -149,4 +155,3 @@ mapnik::box2d envelope(T const& geom) } // end ns geometry } // end ns mapnik - diff --git a/src/geometry_envelope.cpp b/src/geometry_envelope.cpp index 0aa3466f1..5b3ade6f2 100644 --- a/src/geometry_envelope.cpp +++ b/src/geometry_envelope.cpp @@ -31,6 +31,7 @@ template MAPNIK_DECL mapnik::box2d envelope(mapnik::base_symbolizer_help template MAPNIK_DECL mapnik::box2d envelope(geometry_empty const& geom); template MAPNIK_DECL mapnik::box2d envelope(point const& geom); template MAPNIK_DECL mapnik::box2d envelope(line_string const& geom); +template MAPNIK_DECL mapnik::box2d envelope(linear_ring const& geom); template MAPNIK_DECL mapnik::box2d envelope(polygon const& geom); template MAPNIK_DECL mapnik::box2d envelope(multi_point const& geom); template MAPNIK_DECL mapnik::box2d envelope(multi_line_string const& geom); @@ -40,6 +41,7 @@ template MAPNIK_DECL mapnik::box2d envelope(geometry_collection template MAPNIK_DECL mapnik::box2d envelope(geometry const& geom); template MAPNIK_DECL mapnik::box2d envelope(point const& geom); template MAPNIK_DECL mapnik::box2d envelope(line_string const& geom); +template MAPNIK_DECL mapnik::box2d envelope(linear_ring const& geom); template MAPNIK_DECL mapnik::box2d envelope(polygon const& geom); template MAPNIK_DECL mapnik::box2d envelope(multi_point const& geom); template MAPNIK_DECL mapnik::box2d envelope(multi_line_string const& geom);