diff --git a/CMake/FindMapnik.cmake b/CMake/FindMapnik.cmake deleted file mode 100644 index 6779281aa0fe5e10b06777504de0c4de1947ea9e..0000000000000000000000000000000000000000 --- a/CMake/FindMapnik.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# - Find Mapnik -# Find the native Mapnik includes and library -# -# MAPNIK_FOUND - True if MAPNIK found. -# MAPNIK_INCLUDE_DIRS - where to find mapnik/map.hpp, etc. -# MAPNIK_LIBRARIES - List of libraries when using MAPNIK -# - -find_path( MAPNIK_INCLUDE_DIR mapnik/map.hpp ) - -find_library( MAPNIK_LIBRARY - NAMES mapnik2 mapnik ) - -# handle the QUIETLY and REQUIRED arguments and set MAPNIK_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( Mapnik DEFAULT_MSG MAPNIK_LIBRARY MAPNIK_INCLUDE_DIR ) - -mark_as_advanced( MAPNIK_INCLUDE_DIR MAPNIK_LIBRARY ) - -if(MAPNIK_FOUND) - set(MAPNIK_INCLUDE_DIRS ${MAPNIK_INCLUDE_DIR}) - set(MAPNIK_LIBRARIES ${MAPNIK_LIBRARY}) -else() - set(MAPNIK_INCLUDE_DIRS) - set(MAPNIK_LIBRARIES) -endif() - diff --git a/CMake/OTBModuleEnablement.cmake b/CMake/OTBModuleEnablement.cmake index 453b8213d096224d76511b0b8ff50800f551d1a8..4ec34d94df5315c4381769b3c33a380358163a86 100644 --- a/CMake/OTBModuleEnablement.cmake +++ b/CMake/OTBModuleEnablement.cmake @@ -196,8 +196,6 @@ foreach(otb-module ${OTB_MODULES_ALL}) if(OTB_MODULE_${otb-module}_ACTIVATION_OPTION AND NOT ${OTB_MODULE_${otb-module}_ACTIVATION_OPTION}) otb_module_disable("${otb-module}" "${OTB_MODULE_${otb-module}_ACTIVATION_OPTION}") - elseif(OTB_MODULE_${otb-module}_IS_DEPRECATED AND NOT OTB_USE_DEPRECATED) - otb_module_disable("${otb-module}" "OTB_USE_DEPRECATED") endif() endforeach() diff --git a/CMakeLists.txt b/CMakeLists.txt index e8d6abc448d1d447da9f08da2852fd9e87d789fb..7cb4d0d072f9444dad437585e8a16ff80143ef6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,11 +219,6 @@ else() set(OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF) endif() -#----------------------------------------------------------------------------- -# Option to activate deprecated classes -option(OTB_USE_DEPRECATED "Turn on the use and test of deprecated classes" OFF) -mark_as_advanced(OTB_USE_DEPRECATED) - # Although the OpenMP option looks like a 3rd party module, it is NOT. This option # is handled with other compilation flags in file OTBSetStandardCompilerFlags.cmake # before any module is parsed or enabled (see OTBModuleEnablement.cmake later on diff --git a/Documentation/SoftwareGuide/Examples/CMakeLists.txt b/Documentation/SoftwareGuide/Examples/CMakeLists.txt index b65ac4cf58f28f14cc11386dc405a7a00f5f9a57..455da359a5b4fb0e7af1059cda02f8dcd6a9f2c0 100644 --- a/Documentation/SoftwareGuide/Examples/CMakeLists.txt +++ b/Documentation/SoftwareGuide/Examples/CMakeLists.txt @@ -249,7 +249,6 @@ SET( OTB_EXAMPLES_SRCS ${OTB_SOURCE_DIR}/Examples/IO/OGRWrappersExample.cxx ${OTB_SOURCE_DIR}/Examples/IO/DEMToImageGenerator.cxx ${OTB_SOURCE_DIR}/Examples/IO/DEMHandlerExample.cxx - ${OTB_SOURCE_DIR}/Examples/IO/TileMapImageIOExample.cxx ${OTB_SOURCE_DIR}/Examples/Filtering/BinaryThresholdImageFilter.cxx ${OTB_SOURCE_DIR}/Examples/Filtering/ThresholdImageFilter.cxx ${OTB_SOURCE_DIR}/Examples/Filtering/CannyEdgeDetectionImageFilter.cxx @@ -302,8 +301,8 @@ SET( OTB_EXAMPLES_SRCS ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/CorrelationLineDetectorExample.cxx ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/AsymmetricFusionOfLineDetectorExample.cxx ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/LocalHoughExample.cxx - #${OTB_SOURCE_DIR}/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx - #${OTB_SOURCE_DIR}/Examples/FeatureExtraction/RightAngleDetectionExample.cxx + ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx + ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/RightAngleDetectionExample.cxx ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/ExtractSegmentsExample.cxx ${OTB_SOURCE_DIR}/Examples/FeatureExtraction/ParallelLineDetectionExample.cxx diff --git a/Documentation/SoftwareGuide/Latex/FeatureExtraction.tex b/Documentation/SoftwareGuide/Latex/FeatureExtraction.tex index 0a6c4700cad5bf97210cb21ca94e17f107a1be5f..857c56212c7d49dd89702dbf758f761652835258 100644 --- a/Documentation/SoftwareGuide/Latex/FeatureExtraction.tex +++ b/Documentation/SoftwareGuide/Latex/FeatureExtraction.tex @@ -105,12 +105,13 @@ More features are available in \doxygen{otb}{ScalarImageToAdvancedTexturesFilter \input{LocalHoughExample} %\input{ExtractSegmentsByStepsExample} %\input{ExtractSegmentsExample} -%\subsubsection{Line Segment Detector} -%\label{sec:LSD} -%\input{LineSegmentDetectorExample} -%\subsection{Right Angle Detector} -%\label{sec:RightAngleDetector} -%\input{RightAngleDetectionExample} + +\subsubsection{Line Segment Detector} +\label{sec:LSD} +\input{LineSegmentDetectorExample} +\subsection{Right Angle Detector} +\label{sec:RightAngleDetector} +\input{RightAngleDetectionExample} \section{Density Features} diff --git a/Documentation/SoftwareGuide/Latex/Filtering.tex b/Documentation/SoftwareGuide/Latex/Filtering.tex index d08f4261197335cbf66d272afff9e621651c4ed2..09f8b8ebafacd5a4c88a58ac2c75dccd9de2e794 100644 --- a/Documentation/SoftwareGuide/Latex/Filtering.tex +++ b/Documentation/SoftwareGuide/Latex/Filtering.tex @@ -468,18 +468,6 @@ The Markov Random Field framework for OTB is more detailed in \ref{sec:MarkovRan \fi -%\section{Rasterization} - -%Rasterization is the process of rendering vectorial data on a raster -%grid. This rasterization can be either binary or more complete, -%including different styles and labels for the vectorial features.For -%rasterization purposes, OTB uses the Mapnik library through the -%\doxygen{otb}{VectorDataToImageFilter}. Hence, rasterization will be -%only available to users compiling OTB with the Mapnik CMake option -%set to ON, or using a binary package with Mapnik activated. - -%\input{RasterizationExample.tex} - %% \ifitkFullVersion %% %\input{SignedDanielssonDistanceMapImageFilter.tex} diff --git a/Documentation/SoftwareGuide/Latex/Installation.tex b/Documentation/SoftwareGuide/Latex/Installation.tex index 3b91d1d317ca57be57c15702a8e14e416667edfa..8ccfa9df9a6088ba295fd4b910c173a3af70f16c 100644 --- a/Documentation/SoftwareGuide/Latex/Installation.tex +++ b/Documentation/SoftwareGuide/Latex/Installation.tex @@ -114,8 +114,6 @@ See table \ref{tab:otb-dependencies} for the full list of dependencies. \hline \textbf{libSVM} & \url{http://www.csie.ntu.edu.tw/~cjlin/libsvm} & no & 2.0 \\ \hline -\textbf{Mapnik} & \url{http://www.mapnik.org} & no & 2.x \\ -\hline \textbf{MPI} & \url{https://www.open-mpi.org/} & no & - \\ \hline \textbf{MuParser} & \url{http://www.muparser.sourceforge.net} & no & - \\ @@ -431,8 +429,6 @@ $ make install \hline \textbf{OTB\_USE\_SHARK} & OTBShark & optional for OTBSupervised OTBAppClassification \\ \hline -\textbf{OTB\_USE\_MAPNIK} & OTBMapnik & OTBVectorDataRendering \\ -\hline \textbf{OTB\_USE\_6S} & OTB6S & OTBOpticalCalibration OTBAppOpticalCalibration OTBSimulation \\ \hline \textbf{OTB\_USE\_SIFTFAST} & OTBSiftFast & \\ diff --git a/Documentation/SoftwareGuide/Latex/Online.tex b/Documentation/SoftwareGuide/Latex/Online.tex deleted file mode 100644 index 1a5a3355e02951fe2d824091ed455c90da44eac0..0000000000000000000000000000000000000000 --- a/Documentation/SoftwareGuide/Latex/Online.tex +++ /dev/null @@ -1,35 +0,0 @@ -\chapter{Online data}\label{sec:Online} - -With almost every computer connected to the Internet, the amount of -online information is steadily growing. It is quite easy to retrieve -valuable information. OTB has a few experimental classes for this -purpose. - -For these examples to work, you need to have OTB compiled with the -\texttt{OTB\_USE\_CURL} option to \texttt{ON} (and the curl library -installed somewhere). - -Let's see what we can do. - -\section{Name to Coordinates} -\label{sec:NamesToCoordinates} -\input{PlaceNameToLonLatExample.tex} - - -\section{Open Street Map} -\label{sec:OpenStreetMap} - -The power of sharing which is a driving force in open source software such -as OTB can also be demonstrated for data collection. One good example is -Open Street Map (\url{http://www.openstreetmap.org/}). - -In this project, hundreds of thousands of users upload GPS data and draw maps of their -surroundings. The coverage is impressive and this data is freely available. - -It is even possible to get the vector data (not covered yet by OTB), but -here we will focus on retrieving some nice maps for any place in the world. The following -example describes the method. This part is pretty experimental and the code is -not as polished as the rest of the library. You've been warned! - -\input{TileMapImageIOExample.tex} - diff --git a/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex b/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex index 934497e2b81d3e53522ebf7bea2ed094ecb194d0..0683e1140a88d2245805f943727295e35b574ade 100644 --- a/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex +++ b/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex @@ -246,7 +246,6 @@ colorlinks,linkcolor={blue},citecolor={blue},urlcolor={blue}, \input{ChangeDetection.tex} \input{Hyperspectral.tex} \input{Visualization.tex} -\input{Online.tex} %%% \input{Applications.tex} diff --git a/Examples/FeatureExtraction/CMakeLists.txt b/Examples/FeatureExtraction/CMakeLists.txt index d1bc5a01166549a224f7ca328f114b9d77656429..45e96b4ccac3f0229337b8b359515baac2e928f6 100644 --- a/Examples/FeatureExtraction/CMakeLists.txt +++ b/Examples/FeatureExtraction/CMakeLists.txt @@ -68,13 +68,11 @@ target_link_libraries(HarrisExample ${OTB_LIBRARIES}) add_executable(HuMomentsImageFunctionExample HuMomentsImageFunctionExample.cxx) target_link_libraries(HuMomentsImageFunctionExample ${OTB_LIBRARIES}) -if (Module_OTBVectorDataRendering AND OTB_USE_MAPNIK) - add_executable(LineSegmentDetectorExample LineSegmentDetectorExample.cxx) - target_link_libraries(LineSegmentDetectorExample ${OTB_LIBRARIES}) +add_executable(LineSegmentDetectorExample LineSegmentDetectorExample.cxx) +target_link_libraries(LineSegmentDetectorExample ${OTB_LIBRARIES}) - add_executable(RightAngleDetectionExample RightAngleDetectionExample.cxx) - target_link_libraries(RightAngleDetectionExample ${OTB_LIBRARIES}) -endif() +add_executable(RightAngleDetectionExample RightAngleDetectionExample.cxx) +target_link_libraries(RightAngleDetectionExample ${OTB_LIBRARIES}) add_executable(LocalHoughExample LocalHoughExample.cxx) target_link_libraries(LocalHoughExample ${OTB_LIBRARIES}) diff --git a/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx b/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx index 0cfac191b53c3e14cba9ca8df3dfe8d0dbe1d781..c930f104142497f3f21c58d448c2ac089613b4c9 100644 --- a/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx +++ b/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx @@ -19,16 +19,14 @@ */ - #include "otbImageFileReader.h" -#include "otbVectorDataToMapFilter.h" -#include "otbAlphaBlendingFunctor.h" #include "itkBinaryFunctorImageFilter.h" #include "otbImageFileWriter.h" +#include "otbVectorDataFileWriter.h" // Software Guide : BeginCommandLineArgs // INPUTS: {Scene.png} -// OUTPUTS: {LSDOutput.png} +// OUTPUTS: {LSDOutput.shp} // Software Guide : EndCommandLineArgs // Software Guide : BeginLatex @@ -48,8 +46,14 @@ int main(int argc, char * argv[]) { - const char * infname = argv[1]; - const char * outfname = argv[2]; + if (argc != 3) + { + std::cerr << "Usage: ./LineSegmentDetectorExample input output\n"; + return EXIT_FAILURE; + } + + const char* infname = argv[1]; + const char* outfname = argv[2]; typedef unsigned char InputPixelType; typedef double PrecisionType; @@ -89,45 +93,21 @@ int main(int argc, char * argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - typedef otb::LineSegmentDetector<ImageType, - PrecisionType> LsdFilterType; + typedef otb::LineSegmentDetector<ImageType, PrecisionType> LsdFilterType; LsdFilterType::Pointer lsdFilter = LsdFilterType::New(); // Software Guide : EndCodeSnippet - // Software Guide : BeginLatex - // - // In order to be able to display the results, we will draw the - // detected segments on top of the input image. For this matter, we - // will use a \doxygen{otb}{VectorDataToMapFilter} which - // is templated over the input vector data type and the output image - // type, and a combination of a \doxygen{itk}{binaryFunctorImageFilter} - // and the \doxygen{otb}{Functor}{AlphaBlendingFunctor}. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::VectorData<PrecisionType> VectorDataType; - typedef otb::VectorDataToMapFilter<VectorDataType, - ImageType> VectorDataRendererType; - VectorDataRendererType::Pointer vectorDataRenderer = VectorDataRendererType::New(); - - typedef otb::Functor::AlphaBlendingFunctor<InputPixelType, - InputPixelType, InputPixelType> FunctorType; - typedef itk::BinaryFunctorImageFilter<ImageType, ImageType, - ImageType, FunctorType> BlendingFilterType; - BlendingFilterType::Pointer blendingFilter = BlendingFilterType::New(); - // Software Guide : EndCodeSnippet - // Software Guide : BeginLatex // // We can now define the type for the writer, instantiate it and set - // the file name for the output image. + // the file name for the output vector data. // // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - typedef otb::ImageFileWriter<ImageType> WriterType; + typedef otb::VectorDataFileWriter<LsdFilterType::VectorDataType> WriterType; + WriterType::Pointer writer = WriterType::New(); writer->SetFileName(outfname); // Software Guide : EndCodeSnippet @@ -140,16 +120,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet lsdFilter->SetInput(reader->GetOutput()); - - vectorDataRenderer->SetInput(lsdFilter->GetOutput()); - vectorDataRenderer->SetSize(reader->GetOutput()->GetLargestPossibleRegion().GetSize()); - vectorDataRenderer->SetRenderingStyleType(VectorDataRendererType::Binary); - - blendingFilter->SetInput1(reader->GetOutput()); - blendingFilter->SetInput2(vectorDataRenderer->GetOutput()); - blendingFilter->GetFunctor().SetAlpha(0.25); - - writer->SetInput(blendingFilter->GetOutput()); + writer->SetInput(lsdFilter->GetOutput()); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -166,19 +137,5 @@ int main(int argc, char * argv[]) writer->Update(); // Software Guide : EndCodeSnippet - // Software Guide : BeginLatex - // Figure~\ref{fig:LSD} shows the result of applying the line segment - // detection to an image. - // \begin{figure} - // \center - // \includegraphics[width=0.35\textwidth]{Scene.eps} - // \includegraphics[width=0.35\textwidth]{LSDOutput.eps} - // \itkcaption[LSD Application]{Result of applying the - // \doxygen{otb}{LineSegmentDetector} to an image.} - // \label{fig:LSD} - // \end{figure} - // - // Software Guide : EndLatex - return EXIT_SUCCESS; } diff --git a/Examples/FeatureExtraction/RightAngleDetectionExample.cxx b/Examples/FeatureExtraction/RightAngleDetectionExample.cxx index 453ebe11707ce965d177faa4ce1b880d390eb721..5d0ffd1456410b665a523783f86b1d44301f2c2c 100644 --- a/Examples/FeatureExtraction/RightAngleDetectionExample.cxx +++ b/Examples/FeatureExtraction/RightAngleDetectionExample.cxx @@ -22,18 +22,11 @@ #include "otbImageFileReader.h" #include "otbLineSegmentDetector.h" -#include "otbVectorDataToMapFilter.h" -#include "otbAlphaBlendingFunctor.h" -#include "itkBinaryFunctorImageFilter.h" -#include "otbImageFileWriter.h" - -#include "itkRescaleIntensityImageFilter.h" - #include "otbVectorDataFileWriter.h" // Software Guide : BeginCommandLineArgs // INPUTS: {Scene.png} -// OUTPUTS: {RighAngleOutput.tif}, {PrettyRighAngleInput.png}, {PrettyRighAngleOutput.png} +// OUTPUTS: {rightAngleOutput.shp} // 0.1 20 // Software Guide : EndCommandLineArgs @@ -57,25 +50,27 @@ int main(int argc, char * argv[]) { - const char * infname = argv[1]; - const char * outfname = argv[2]; - const char * inprettyfname = argv[3]; - const char * outprettyfname = argv[4]; - double angleThreshold = atof(argv[5]); - double distanceThreshold = atof(argv[6]); - - const unsigned int Dimension = 2; + if (argc != 5) + { + std::cerr << "Usage: ./RightAngleDetectionExample input rightAngleOutput angleThreshold distanceThreshold\n"; + return EXIT_FAILURE; + } + + const char* infname = argv[1]; + const char* rightAngleOutputFilename = argv[2]; + double angleThreshold = atof(argv[3]); + double distanceThreshold = atof(argv[4]); + + const unsigned int Dimension = 2; typedef unsigned char PixelType; typedef double PrecisionType; typedef otb::Image<PixelType, Dimension> ImageType; typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::ImageFileWriter<ImageType> WriterType; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(infname); reader->GenerateOutputInformation(); - WriterType::Pointer writer = WriterType::New(); // Software Guide : BeginLatex // @@ -124,8 +119,8 @@ int main(int argc, char * argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - LsdFilterType::Pointer lsdFilter = LsdFilterType::New(); - RightAngleFilterType::Pointer rightAngleFilter = RightAngleFilterType::New(); + auto lsdFilter = LsdFilterType::New(); + auto rightAngleFilter = RightAngleFilterType::New(); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -151,48 +146,16 @@ int main(int argc, char * argv[]) rightAngleFilter->SetDistanceThreshold(distanceThreshold); // Software Guide : EndCodeSnippet - // Software Guide : BeginLatex - // - // We will now draw the right angles on top of the input image. For - // this, we will draw the detected points on top of the input - // image. For this matter, we will use a - // \doxygen{otb}{VectorDataToMapFilter} which is templated over - // the input vector data type and the output image type, and a - // combination of a \doxygen{itk}{binaryFunctorImageFilter} - // and the \doxygen{otb}{Functor}{UnaryFunctorImageFilter}. - // - // Software Guide : EndLatex + typedef otb::VectorDataFileWriter<LsdFilterType::VectorDataType> WriterType; - // Software Guide : BeginCodeSnippet - typedef otb::VectorDataToMapFilter<VectorDataType, - ImageType> VectorDataRendererType; - VectorDataRendererType::Pointer vectorDataRenderer = VectorDataRendererType::New(); - - typedef otb::Functor::AlphaBlendingFunctor<PixelType, - PixelType, PixelType> FunctorType; - typedef itk::BinaryFunctorImageFilter<ImageType, ImageType, - ImageType, FunctorType> BlendingFilterType; - BlendingFilterType::Pointer blendingFilter = BlendingFilterType::New(); - - vectorDataRenderer->SetInput(1, lsdFilter->GetOutput()); - vectorDataRenderer->SetInput(rightAngleFilter->GetOutput()); - - vectorDataRenderer->SetSize(reader->GetOutput()->GetLargestPossibleRegion().GetSize()); - vectorDataRenderer->SetOrigin(reader->GetOutput()->GetOrigin()); - vectorDataRenderer->SetSpacing(reader->GetOutput()->GetSignedSpacing()); - vectorDataRenderer->SetRenderingStyleType(VectorDataRendererType::Binary); - - blendingFilter->SetInput1(reader->GetOutput()); - blendingFilter->SetInput2(vectorDataRenderer->GetOutput()); - blendingFilter->GetFunctor().SetAlpha(0.25); - - writer->SetInput(blendingFilter->GetOutput()); - writer->SetFileName(outfname); - // Software Guide : EndCodeSnippet + auto rightAngleWriter = WriterType::New(); + + rightAngleWriter->SetInput(rightAngleFilter->GetOutput()); + rightAngleWriter->SetFileName(rightAngleOutputFilename); // Software Guide : BeginLatex // - // Before calling the \code{Update()} method of the writer in order to + // Before calling the \code{Update()} method of the writers in order to // trigger the pipeline execution, we call the // \code{GenerateOutputInformation()} of the reader, so the // filter gets the information about image size and spacing. @@ -201,50 +164,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet reader->GenerateOutputInformation(); - writer->Update(); + rightAngleWriter->Update(); // Software Guide : EndCodeSnippet - // Software Guide : BeginLatex - // Figure~\ref{fig:RIGHTANGLE_FILTER} shows the result of applying - // the right angle detection filter to an image. - // \begin{figure} - // \center - // \includegraphics[width=0.25\textwidth]{PrettyRighAngleInput.eps} - // \includegraphics[width=0.25\textwidth]{PrettyRighAngleOutput.eps} - // \itkcaption[Right Angle Detection Filter]{Result of applying the - // \doxygen{otb}{LineSegmentDetector} and the - // \doxygen{otb}{VectorDataToRightAngleVectorDataFilter} to an image. From left to right : - // original image, detected right angles.} - // \label{fig:RIGHTANGLE_FILTER} - // \end{figure} - // - // Software Guide : EndLatex - - /************** images for printing *********/ - typedef unsigned char OutputPixelType; - - typedef otb::Image<OutputPixelType, - Dimension> OutputImageType; - typedef otb::ImageFileWriter<OutputImageType> - OutputWriterType; - typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; - - RescalerType::Pointer rescaler = RescalerType::New(); - OutputWriterType::Pointer outwriter = OutputWriterType::New(); - - rescaler->SetOutputMinimum(0); - rescaler->SetOutputMaximum(255); - - rescaler->SetInput(reader->GetOutput()); - outwriter->SetInput(rescaler->GetOutput()); - outwriter->SetFileName(inprettyfname); - outwriter->Update(); - - rescaler->SetInput(blendingFilter->GetOutput()); - outwriter->SetInput(rescaler->GetOutput()); - outwriter->SetFileName(outprettyfname); - outwriter->Update(); - return EXIT_SUCCESS; } diff --git a/Examples/FeatureExtraction/test/CMakeLists.txt b/Examples/FeatureExtraction/test/CMakeLists.txt index fffe40cfcca7997914c93b92dcf89af5e6dab970..17abcb67ce61492d592a1f573a1935a5a272ab0d 100644 --- a/Examples/FeatureExtraction/test/CMakeLists.txt +++ b/Examples/FeatureExtraction/test/CMakeLists.txt @@ -214,30 +214,25 @@ otb_add_test(NAME feTeCloudDetectionExampleTest COMMAND ${OTB_TEST_DRIVER} 553 467 734 581 0.4 0.6 1.0 ) -if (Module_OTBVectorDataRendering AND OTB_USE_MAPNIK) - - # ------- Line Segment Detector test---------- - otb_add_test(NAME feTeLineSegmentDetectorExampleTest COMMAND ${OTB_TEST_DRIVER} - --compare-image ${NOTOL} - ${BASELINE}/feTeLineSegmentDetectorExampleOutput.png - ${TEMP}/feTeLineSegmentDetectorExampleOutput.png - Execute $<TARGET_FILE:LineSegmentDetectorExample> - ${INPUTDATA}/Scene.png - ${TEMP}/feTeLineSegmentDetectorExampleOutput.png - ) - - # ------- Right Angle Detection test---------- - - otb_add_test(NAME feTeRightAngleDetectionExample COMMAND ${OTB_TEST_DRIVER} - --compare-image ${NOTOL} - ${BASELINE}/feTeRightAngleDetectionExampleOutput.png - ${TEMP}/feTeRightAngleDetectionExampleOutput.png - Execute $<TARGET_FILE:RightAngleDetectionExample> - ${INPUTDATA}/Scene.png - ${TEMP}/feTeRightAngleDetectionExampleOutput.png - ${TEMP}/PrettyRightAngleInput.png - ${TEMP}/PrettyRightAngleOutput.png - 0.1 - 10. - ) -endif() +# ------- Line Segment Detector test---------- +otb_add_test(NAME feTeLineSegmentDetectorExampleTest COMMAND ${OTB_TEST_DRIVER} + --compare-ogr ${NOTOL} + ${BASELINE}/feTeLineSegmentDetectorExampleOutput.shp + ${TEMP}/feTeLineSegmentDetectorExampleOutput.shp + Execute $<TARGET_FILE:LineSegmentDetectorExample> + ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif + ${TEMP}/feTeLineSegmentDetectorExampleOutput.shp +) + +# ------- Right Angle Detection test---------- + +otb_add_test(NAME feTeRightAngleDetectionExample COMMAND ${OTB_TEST_DRIVER} + --compare-ogr ${NOTOL} + ${BASELINE}/feTeRightAngleDetectionExampleOutput.shp + ${TEMP}/feTeRightAngleDetectionExampleOutput.shp + Execute $<TARGET_FILE:RightAngleDetectionExample> + ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif + ${TEMP}/feTeRightAngleDetectionExampleOutput.shp + 0.1 + 10. +) diff --git a/Examples/Filtering/RasterizationExample.cxx b/Examples/Filtering/RasterizationExample.cxx deleted file mode 100644 index 80406927cb3c936bffa89f4c46fd78c224d540a6..0000000000000000000000000000000000000000 --- a/Examples/Filtering/RasterizationExample.cxx +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -// Software Guide : BeginCommandLineArgs -// INPUTS: {w002n44e.shp} -// OUTPUTS: {ArcachonRasterizedCoastline.png} -// Software Guide : EndCommandLineArgs - -// Software Guide : BeginLatex -// -// The \doxygen{otb}{VectorDataToMapFilter} allows performing -// rasterization of a given vector data as a binary mask. This example -// will demonstrate how to use this filter to perform rasterization of -// the SRTM water body masks available here: -// \url{http://dds.cr.usgs.gov/srtm/version2_1/SWBD/}. -// -// First step to use this filter is to include the appropriate headers: -// -// Software Guide : EndLatex - -// Software Guide : BeginCodeSnippet -#include "otbVectorData.h" -#include "otbImage.h" -#include "otbVectorDataToMapFilter.h" -// Software Guide : EndCodeSnippet - -#include "otbImageFileWriter.h" -#include "otbVectorDataProjectionFilter.h" -#include "itkRGBAPixel.h" -#include "itkChangeLabelImageFilter.h" -#include "otbVectorDataFileReader.h" - -int main(int argc, char * argv[]) -{ - // Software Guide : BeginLatex - // - // Then, we need to define the appropriate VectorData and Image - // type. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef unsigned char PixelType; - typedef otb::Image<PixelType, 2> ImageType; - typedef otb::VectorData<> VectorDataType; - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Using these typedefs, we can define and instantiate the - // \doxygen{otb}{VectorDataToMapFilter}. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::VectorDataToMapFilter<VectorDataType, - ImageType> VectorDataToMapFilterType; - VectorDataToMapFilterType::Pointer vectorDataRendering - = VectorDataToMapFilterType::New(); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // We will also define a \doxygen{otb}{VectorDataFileReader} to read - // the VectorData, as well as a - // \doxygen{otb}{VectorDataProjectionFilter} to reproject our data - // in a given map projection. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; - VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); - reader->SetFileName(argv[1]); - - typedef otb::VectorDataProjectionFilter<VectorDataType, - VectorDataType> ProjectionFilterType; - ProjectionFilterType::Pointer projection = ProjectionFilterType::New(); - projection->SetInput(reader->GetOutput()); - // Software Guide : EndCodeSnippet - - std::string projectionRefWkt = "PROJCS[\"WGS 84 / UTM zone 30N\", GEOGCS[\"WGS 84\", DATUM[\"WGS_1984\", SPHEROID[\"WGS 84\", 6378137, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree\", 0.01745329251994328, AUTHORITY[\"EPSG\",\"9122\"]], AUTHORITY[\"EPSG\",\"4326\"]], UNIT[\"metre\", 1, AUTHORITY[\"EPSG\",\"9001\"]], PROJECTION[\"Transverse_Mercator\"], PARAMETER[\"latitude_of_origin\", 0], PARAMETER[\"central_meridian\", -3], PARAMETER[\"scale_factor\", 0.9996], PARAMETER[\"false_easting\", 500000], PARAMETER[\"false_northing\", 0], AUTHORITY[\"EPSG\",\"32630\"], AXIS[\"Easting\", EAST], AXIS[\"Northing\", NORTH]]"; - - // Software Guide : BeginLatex - // - // Next step is to specify the map projection in which to reproject - // our vector. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - projection->SetOutputProjectionRef(projectionRefWkt); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Since the input vector can be pretty big, we will perform an - // extract of the region of interest using the - // \doxygen{otb}{VectorDataExtractROI}. - // - // The first step is to define the region of interest. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::RemoteSensingRegion<double> RegionType; - ImageType::SizeType size; - size[0] = 500; - size[1] = 500; - - ImageType::PointType origin; - origin[0] = 633602; //UL easting - origin[1] = 4961679; //UL northing - - ImageType::SpacingType spacing; - spacing[0] = 56; - spacing[1] = -56; - - RegionType region; - RegionType::SizeType sizeInUnit; - sizeInUnit[0] = size[0] * spacing[0]; - sizeInUnit[1] = size[1] * spacing[1]; - region.SetSize(sizeInUnit); - region.SetOrigin(origin); - region.SetRegionProjection(projectionRefWkt); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Then, we define and set-up the - // \doxygen{otb}{VectorDataExtractROI} filter using the region. - // - // Software Guide : EndLatex - - // Software Guide :: BeginCodeSnippet - - typedef otb::VectorDataExtractROI<VectorDataType> ExtractROIType; - ExtractROIType::Pointer extractROI = ExtractROIType::New(); - extractROI->SetRegion(region); - extractROI->SetInput(projection->GetOutput()); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Now, we can plug the the ROI filter to the - // \doxygen{otb}{VectorDataToMapFilter}. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - vectorDataRendering->SetInput(extractROI->GetOutput()); - vectorDataRendering->SetSize(size); - vectorDataRendering->SetOrigin(origin); - vectorDataRendering->SetSpacing(spacing); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Since we are interested in binary rendering, we need to set the - // appropriate rendering style. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - vectorDataRendering->SetRenderingStyleType(VectorDataToMapFilterType::Binary); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // The rendering filter will return a binary image with label 0 when - // outside the rasterized vector features and 255 when inside. To - // get a fancier rendering we will substitute a blue color to the - // foreground value and green to the background value. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef itk::RGBAPixel<unsigned char> RGBAPixelType; - typedef otb::Image<RGBAPixelType, 2> RGBAImageType; - typedef itk::ChangeLabelImageFilter<ImageType, - RGBAImageType> ChangeLabelImageFilterType; - - ChangeLabelImageFilterType::Pointer - changeLabelFilter = ChangeLabelImageFilterType::New(); - - RGBAPixelType green, blue; - green.SetAlpha(255); - green.SetGreen(255); - blue.SetAlpha(255); - blue.SetBlue(255); - - changeLabelFilter->SetChange(0, blue); - changeLabelFilter->SetChange(255, green); - changeLabelFilter->SetInput(vectorDataRendering->GetOutput()); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Last step is to write the image to the disk using a - // \doxygen{otb}{ImageFileWriter}. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::ImageFileWriter<RGBAImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(changeLabelFilter->GetOutput()); - writer->SetFileName(argv[2]); - writer->Update(); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // \begin{figure} - // \center - // \includegraphics[width=0.4\textwidth]{ArcachonRasterizedCoastline.eps} - // \itkcaption[Rasterized SRTM water bodies near Arcachon, France.]{Rasterized SRTM water bodies near Arcachon, France.} - // \label{fig:RasterizationFilterOutput} - // \end{figure} - // - // Figure \ref{fig:RasterizationFilterOutput} illustrates the use - // of the rasterization filter on SRTM water bodies mask near - // Arcachon in France. Ocean appears in blue while land appears in green. - // - // Software Guide : EndLatex - - - return EXIT_SUCCESS; -} diff --git a/Examples/IO/CMakeLists.txt b/Examples/IO/CMakeLists.txt index f3aab131cba0881420796838e65b0065fac1bca2..e9802344cdf58d460893f355edc4d1dd3e06257e 100644 --- a/Examples/IO/CMakeLists.txt +++ b/Examples/IO/CMakeLists.txt @@ -73,11 +73,6 @@ target_link_libraries(StreamingImageReadWrite ${OTB_LIBRARIES}) add_executable(VectorDataIOExample VectorDataIOExample.cxx) target_link_libraries(VectorDataIOExample ${OTB_LIBRARIES}) -if(OTB_USE_DEPRECATED) - add_executable(TileMapImageIOExample TileMapImageIOExample.cxx) - target_link_libraries(TileMapImageIOExample ${OTB_LIBRARIES}) -endif() - if(BUILD_TESTING) add_subdirectory(test) endif() diff --git a/Examples/IO/TileMapImageIOExample.cxx b/Examples/IO/TileMapImageIOExample.cxx deleted file mode 100644 index 3c55559e2581cf201ea02996a2cc9099e0c3d44e..0000000000000000000000000000000000000000 --- a/Examples/IO/TileMapImageIOExample.cxx +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -// Software Guide : BeginCommandLineArgs -// INPUTS: {osmfile.otb} -// OUTPUTS: {openStreetMap-Toulouse.png} -// ${GeneratedFolder} 1.4835345 43.55968261 13 -// Software Guide : EndCommandLineArgs - -// Software Guide : BeginCommandLineArgs -// INPUTS: {osmfile.otb} -// OUTPUTS: {openStreetMap-Singapore.png} -// ${GeneratedFolder} 103.780646 1.297643 13 -// Software Guide : EndCommandLineArgs - -// Software Guide : BeginLatex -// -// First, we need to include several headers. There will be a bit of -// manual work going on here. -// -// Software Guide : EndLatex - -// Software Guide : BeginCodeSnippet -#include "itkRGBPixel.h" -#include "otbImageFileReader.h" -#include "otbTileMapImageIO.h" -#include "otbInverseSensorModel.h" -#include "otbForwardSensorModel.h" -#include "otbExtractROI.h" -#include "otbImageFileWriter.h" -#include "otbTileMapTransform.h" -#include "otbWorldFile.h" -// Software Guide : EndCodeSnippet - -int main(int argc, char* argv[]) -{ - - if (argc != 7) - { - std::cout << argv[0] << " <inputFilename> <outputFilename> " - << "<cacheDirectory> <lon> <lat> <depth>" - << std::endl; - - return EXIT_FAILURE; - } - - // Software Guide : BeginLatex - // - // We retrieve the input parameters: - // \begin{itemize} - // \item the input filename is a simple text file specifying the access - // modality to open street map data; - // \item the output file is the image where you want to save the result; - // \item the cache directory is necessary to keep the data retrieved from - // the internet. It can also be reused to minimize network access; - // \item longitude of the center of the scene; - // \item latitude of the center of the scene; - // \item depth which is inversely related to the resolution: when you increase - // the depth by one, you divide the resolution by two. - // \end{itemize} - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - std::string inputFilename = argv[1]; - std::string outputFilename = argv[2]; - std::string cacheDirectory = argv[3]; - double lon = atof(argv[4]); - double lat = atof(argv[5]); - int depth = atoi(argv[6]); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // We now instantiate the reader. As some parameters need to be given to the - // IO which is an \doxygen{otb}{TileMapImageIO}, we need to manually create it: - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef itk::RGBPixel<unsigned char> RGBPixelType; - typedef otb::Image<RGBPixelType, 2> ImageType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::TileMapImageIO ImageIOType; - - ImageIOType::Pointer tileIO = ImageIOType::New(); - ReaderType::Pointer readerTile = ReaderType::New(); - tileIO->SetDepth(depth); - tileIO->SetCacheDirectory(cacheDirectory); - readerTile->SetImageIO(tileIO); - readerTile->SetFileName(inputFilename); - readerTile->UpdateOutputInformation(); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Now, we potentially have an image of several Peta-Bytes covering the whole world - // in the reader - // that's why we don't want to do an update before extracting a specific - // area. - // - // The coordinates are referred with an origin at the North Pole and the - // change date meridian in Mercator projection. So we need to translate the latitude - // and the longitude in this funny coordinate system: - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::TileMapTransform<otb::TransformDirection::FORWARD> TransformType; - TransformType::Pointer transform = TransformType::New(); - transform->SetDepth(depth); - - typedef itk::Point <double, 2> PointType; - PointType lonLatPoint; - lonLatPoint[0] = lon; - lonLatPoint[1] = lat; - - PointType tilePoint; - tilePoint = transform->TransformPoint(lonLatPoint); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // This enables us to use the \doxygen{otb}{ExtractROI} to retrieve only - // the area of interest and to avoid crashing our memory-limited computer. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - long int startX = static_cast<long int>(tilePoint[0]); - long int startY = static_cast<long int>(tilePoint[1]); - long int sizeX = 500; - long int sizeY = 500; - - std::cerr << startX << ", " << startY << std::endl; - std::cerr << sizeX << ", " << sizeY << std::endl; - - typedef otb::ExtractROI<RGBPixelType, RGBPixelType> ExtractROIFilterType; - ExtractROIFilterType::Pointer extractROIOsmFilter = ExtractROIFilterType::New(); - extractROIOsmFilter->SetStartX(startX - sizeX / 2); - extractROIOsmFilter->SetStartY(startY - sizeY / 2); - extractROIOsmFilter->SetSizeX(sizeX); - extractROIOsmFilter->SetSizeY(sizeY); - - extractROIOsmFilter->SetInput(readerTile->GetOutput()); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Finally, we just plug this to the writer to save our nice map of - // the area: - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetFileName(outputFilename); - writer->SetInput(extractROIOsmFilter->GetOutput()); - writer->Update(); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // We also want to create the associated world file to be able to use this - // new image in a GIS system. For this, we need to compute the coordinates - // of the top left corner and the spacing in latitude and longitude. - // - // For that, we use the inverse transform to convert the corner coordinates into - // latitude and longitude. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - typedef otb::TileMapTransform<otb::TransformDirection::INVERSE> InverseTransformType; - InverseTransformType::Pointer transformInverse = InverseTransformType::New(); - transformInverse->SetDepth(depth); - - - double lonUL, latUL, lonSpacing, latSpacing; - - tilePoint[0] = startX - sizeX / 2; - tilePoint[1] = startY - sizeY / 2; - lonLatPoint = transformInverse->TransformPoint(tilePoint); - lonUL = lonLatPoint[0]; - latUL = lonLatPoint[1]; - tilePoint[0] = startX + sizeX / 2; - tilePoint[1] = startY + sizeY / 2; - lonLatPoint = transformInverse->TransformPoint(tilePoint); - lonSpacing = (lonLatPoint[0] - lonUL) / (sizeX - 1); - latSpacing = (lonLatPoint[1] - latUL) / (sizeY - 1); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Now that we have all the information, we can write the world file - // which has the wld extension. This is a simple text file containing - // the coordinates of the center of the top left pixel and the x and y - // spacing. - // - // Software Guide : EndLatex - - // Software Guide : BeginCodeSnippet - otb::WorldFile::Pointer worldFile = otb::WorldFile::New(); - worldFile->SetImageFilename(outputFilename); - worldFile->SetLonOrigin(lonUL); - worldFile->SetLatOrigin(latUL); - worldFile->SetLonSpacing(lonSpacing); - worldFile->SetLatSpacing(latSpacing); - worldFile->Update(); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // Figure~\ref{fig:TILEMAPIMAGEIOEXAMPLE} shows the output images created from - // open street map data. - // - // \begin{figure} - // \center - // \includegraphics[width=0.45\textwidth]{openStreetMap-Toulouse.eps} - // \includegraphics[width=0.45\textwidth]{openStreetMap-Singapore.eps} - // \itkcaption[Open street map]{Map created from open street map showing the OTB headquarters} - // \label{fig:TILEMAPIMAGEIOEXAMPLE} - // \end{figure} - // - // If your street is missing, go and improve the map by adding it yourself. - // - // Software Guide : EndLatex - - - return EXIT_SUCCESS; - -} diff --git a/Examples/IO/test/CMakeLists.txt b/Examples/IO/test/CMakeLists.txt index 9a410111a55a12135b96cec77f7fb12701736dfd..733f13f2ccb228d81c248eaead69ad18ea45f978 100644 --- a/Examples/IO/test/CMakeLists.txt +++ b/Examples/IO/test/CMakeLists.txt @@ -100,18 +100,3 @@ otb_add_test(NAME ioTeImageToKmzAndMapFileProductExample COMMAND ${OTB_TEST_DRIV ) set_property(TEST ioTeImageToKmzAndMapFileProductExample PROPERTY RESOURCE_LOCK web_access) endif() - -if(OTB_USE_DEPRECATED) - otb_add_test(NAME ioTeTileMapImageIOExampleTest COMMAND ${OTB_TEST_DRIVER} - --compare-image 10.0 - ${BASELINE}/openStreetMap.png - ${TEMP}/openStreetMap.png - Execute $<TARGET_FILE:TileMapImageIOExample> - ${INPUTDATA}/osmfile.otb - ${TEMP}/openStreetMap.png - ${TEMP} - 1.4835345 - 43.55968261 - 12 - ) -endif() diff --git a/Modules/Filtering/VectorDataRendering/CMakeLists.txt b/Modules/Filtering/VectorDataRendering/CMakeLists.txt deleted file mode 100644 index 7b5926d02df9b0f53b11f68de31bcd9b2d5afce1..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -project(OTBVectorDataRendering) - -set(OTBVectorDataRendering_LIBRARIES OTBVectorDataRendering) -otb_module_impl() diff --git a/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h b/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h deleted file mode 100644 index 4d67d5d368c26d7c834f189cb406178d0ce4eb70..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef otbMapnikAdapter_h -#define otbMapnikAdapter_h - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#include <mapnik/datasource_cache.hpp> -#include <mapnik/font_engine_freetype.hpp> -#include <mapnik/agg_renderer.hpp> -#include <mapnik/filter_factory.hpp> -#include <mapnik/color_factory.hpp> -#include <mapnik/image_util.hpp> -#include <mapnik/config_error.hpp> -#include <mapnik/memory_datasource.hpp> -#include <mapnik/layer.hpp> -#include <mapnik/map.hpp> -#include <mapnik/value.hpp> -#pragma GCC diagnostic pop -#else -#include <mapnik/datasource_cache.hpp> -#include <mapnik/font_engine_freetype.hpp> -#include <mapnik/agg_renderer.hpp> -#include <mapnik/filter_factory.hpp> -#include <mapnik/color_factory.hpp> -#include <mapnik/image_util.hpp> -#include <mapnik/config_error.hpp> -#include <mapnik/memory_datasource.hpp> -#include <mapnik/layer.hpp> -#include <mapnik/map.hpp> -#include <mapnik/value.hpp> -#endif - -#ifdef OTB_MAPNIK_COMPATIBILITY_API07 -namespace mapnik { -typedef Layer layer; -typedef Image32 image_32; -} -#endif - -namespace otb -{ -namespace [[deprecated]] mapnik_otb -{ -// this should be removed once mapnik support for version < 2.0 is dropped. -// should be around 01/2013. -#ifdef OTB_MAPNIK_COMPATIBILITY_API07 -static size_t get_num_layer(const mapnik::Map& map) { return map.layerCount(); } -static unsigned get_height(const mapnik::Map& map) { return map.getHeight(); } -static unsigned get_width(const mapnik::Map& map) { return map.getWidth(); } -typedef mapnik::Envelope<double> box2d; -static void zoom_to_box(mapnik::Map* map, const mapnik::Envelope<double>& envelope) -{ - map->zoomToBox(envelope); -} -typedef mapnik::geometry2d geom; -static geom* create_geom(int geom_type) -{ - geom* g = 0; - switch (geom_type) - { - case mapnik::Point: - g = new mapnik::point<mapnik::vertex<double, 2> >; - case mapnik::LineString: - g = new mapnik::line_string<mapnik::vertex<double, 2> , mapnik::vertex_vector2>; - case mapnik::Polygon: - g = new mapnik::polygon<mapnik::vertex<double, 2>, mapnik::vertex_vector2>; - default: - std::cerr - << "Please fix otb::mapnik_otb::create_geom for mapnik 0.7" << std::endl; - } - return g; -} -#else -static size_t get_num_layer(const mapnik::Map& map) { return map.layer_count(); } -static unsigned get_height(const mapnik::Map& map) { return map.height(); } -static unsigned get_width(const mapnik::Map& map) { return map.width(); } -typedef mapnik::box2d<double> box2d; -static void zoom_to_box(mapnik::Map* map, const mapnik::box2d<double>& envelope) -{ - map->zoom_to_box(envelope); -} -typedef mapnik::vertex<double, 2> vertex2d; -typedef mapnik::geometry<vertex2d> geom; -static geom* create_geom(mapnik::eGeomType geom_type) { return new geom(geom_type); } -#endif -} -} - -#endif diff --git a/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h b/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h deleted file mode 100644 index c750dc4436cec0613b185f7b0b7919e581de67d7..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef otbVectorDataStyle_h -#define otbVectorDataStyle_h - -#include "itkLightObject.h" -#include "itkObjectFactory.h" - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#include <mapnik/map.hpp> -#pragma GCC diagnostic pop -#else -#include <mapnik/map.hpp> -#endif - -namespace otb -{ -/** \class VectorDataStyle - * \brief Load style into a mapnik::Map - * - * \sa VectorDataToMapFilter - * - * \deprecated - * - * \ingroup OTBVectorDataRendering - */ - -class [[deprecated]] VectorDataStyle : public itk::LightObject -{ -public: - /** Standard class typedefs. */ - typedef VectorDataStyle Self; - typedef itk::LightObject Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Method for creation through the object factory. */ - itkNewMacro(Self); - - /** Run-time type information (and related methods). */ - itkTypeMacro(VectorDataStyle, LightObject); - - void LoadOSMStyle(mapnik::Map& mapnikMap) const; - - void LoadBinaryRasterizationStyle(mapnik::Map& mapnikMap) const; - - /** Get/Set the size of the scale factor. */ - double GetScaleFactor() const - { - return m_ScaleFactor; - } - void SetScaleFactor(double scale) - { - m_ScaleFactor = scale; - } - -protected: - /** Constructor */ - VectorDataStyle() : - m_ScaleFactor(1.0){}; - /** Destructor */ - virtual ~VectorDataStyle() {} - /**PrintSelf method */ - virtual void PrintSelf(std::ostream& os, itk::Indent indent) const; - -private: - VectorDataStyle(const Self &) = delete; - void operator =(const Self&) = delete; - - //this parameter is used only in the case of sensor geometry - //to adjust the scale - double m_ScaleFactor; - -}; // end class -} // end namespace otb - -#endif diff --git a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h b/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h deleted file mode 100644 index 67d3a2e8204c0be74fbbd194dc53895ff829f31e..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef otbVectorDataToMapFilter_h -#define otbVectorDataToMapFilter_h - -#include "itkImageSource.h" -#include "otbRGBAPixelConverter.h" -#include "otbVectorDataExtractROI.h" -#include <string> - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#include <mapnik/memory_datasource.hpp> -#include <mapnik/map.hpp> -#pragma GCC diagnostic pop -#else -#include <mapnik/memory_datasource.hpp> -#include <mapnik/map.hpp> -#endif - - -namespace otb -{ -/** \class VectorDataToMapFilter - * \brief <b>EXPERIMENTAL FEATURE</b> Render a vector data into an image - * - * To use this class, you need to compile the library with the option OTB_USE_MAPNIK - * to ON. You also need to install mapnik on your machine (http://www.mapnik.org) - * - * We assume that all the data have been reprojected before in the desired cartographic, - * geographic or sensor model projection (using the otb::VectorDataProjectionFilter). - * This filter does not use the projection capabilities of mapnik. - * - * According to the class otb::VectorDataStyle, this filter supports - * two different rendering style types: OSM and Binary. - * The OSM style type provides styles to render a vector data the - * OSM way. These styles must be specified usind the method - * "AddStyle()". - * The Binary style type provides automatically a set of styles to - * render a vectro data as a binary mask (foreground pixel value - * 255, background pixel value 0). - * - * Note: - * This class only support the following types as TImage template - * parameter: - * otb::Image<PixelType>, - * otb::Image< itk::RGBAPixel<InternalPixelType> >, - * otb::Image< itk::RGBPixel<InternalPixelType> >. - * - * \deprecated - * - * \ingroup OTBVectorDataRendering - */ - -template <class TVectorData, class TImage> -class [[deprecated]] VectorDataToMapFilter : public itk::ImageSource<TImage> -{ -public: - /** Standard class typedefs. */ - typedef VectorDataToMapFilter Self; - typedef itk::ImageSource<TImage> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Method for creation through the object factory. */ - itkNewMacro(Self); - - /** Run-time type information (and related methods). */ - itkTypeMacro(VectorDataToMapFilter, ImageSource); - - /** Some typedefs. */ - typedef TVectorData VectorDataType; - typedef TImage ImageType; - typedef typename ImageType::PixelType PixelType; - typedef typename ImageType::Pointer ImagePointer; - typedef typename VectorDataType::ConstPointer VectorDataConstPointer; - typedef typename VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType; - typedef typename InternalTreeNodeType::ChildrenListType ChildrenListType; - typedef VectorDataExtractROI<VectorDataType> VectorDataExtractROIType; - typedef RemoteSensingRegion<double> RemoteSensingRegionType; - typedef typename RemoteSensingRegionType::SizeType SizePhyType; - - /** Number of dimensions. */ - itkStaticConstMacro(ImageDimension, unsigned int, - TImage::ImageDimension); - - /** Image size typedef. */ - typedef itk::Size<itkGetStaticConstMacro(ImageDimension)> SizeType; - - /** Image index typedef. */ - typedef typename TImage::IndexType IndexType; - - /** Image spacing, origin and direction typedef */ - typedef typename TImage::SpacingType SpacingType; - typedef typename TImage::PointType OriginType; - typedef typename TImage::DirectionType DirectionType; - - /** Region typedef */ - typedef typename TImage::RegionType RegionType; - - /** RGBA Converter typedef */ - typedef RGBAPixelConverter<unsigned char, PixelType> RGBAConverterType; - - /** typedef specific to mapnik */ - typedef boost::shared_ptr<mapnik::memory_datasource> datasource_ptr; - - /** */ - typedef enum - { - OSM, - Binary - } RenderingStyleType; - - /** Set/Get the vector data input of this process object. */ - using Superclass::SetInput; - virtual void SetInput(const VectorDataType *input); - virtual void SetInput(unsigned int idx, const VectorDataType *input); - const VectorDataType * GetInput(void); - const VectorDataType * GetInput(unsigned int idx); - - /** Set the size of the output image. */ - itkSetMacro(Size, SizeType); - - /** Get the size of the output image. */ - itkGetConstReferenceMacro(Size, SizeType); - - /** Set the origin of the vector data. - * \sa GetOrigin() */ - itkSetMacro(Origin, OriginType); - virtual void SetOrigin(const double origin[2]); - virtual void SetOrigin(const float origin[2]); - - itkGetConstReferenceMacro(Origin, OriginType); - - /** Set the spacing (size of a pixel) of the vector data. - * \sa GetSignedSpacing() */ - virtual void SetSpacing(const SpacingType& spacing); - virtual void SetSpacing(const double spacing[2]); - virtual void SetSpacing(const float spacing[2]); - - itkGetConstReferenceMacro(Spacing, SpacingType); - - /** Get/Set methods for the scale factor */ - itkSetMacro(ScaleFactor, double); - itkGetMacro(ScaleFactor, double); - - /** */ - void AddStyle(const std::string& style) - { - m_StyleList.push_back(style); - } - - /** Clear the style list */ - void ClearStyleList() - { - m_StyleList.clear(); - } - - /** Specify if the output image is to be uses as an overlar - * (with transparent background) or not (with blue background). - */ - itkSetMacro(UseAsOverlay, bool); - itkGetMacro(UseAsOverlay, bool); - itkBooleanMacro(UseAsOverlay); - - /** Get/Set methods for the rendering style type (OSM or Binary) */ - itkSetMacro(RenderingStyleType, RenderingStyleType); - itkGetMacro(RenderingStyleType, RenderingStyleType); - - /** Add accessors to the font filename */ - itkSetStringMacro(FontFileName); - itkGetStringMacro(FontFileName); - - /** Add accessors to the Projection in the WKT format */ - itkSetStringMacro(VectorDataProjectionWKT); - itkGetStringMacro(VectorDataProjectionWKT); - -protected: - /** Constructor */ - VectorDataToMapFilter(); - /** Destructor */ - virtual ~VectorDataToMapFilter() {} - /**PrintSelf method */ - virtual void PrintSelf(std::ostream& os, itk::Indent indent) const; - - virtual void GenerateOutputInformation(); - - virtual void GenerateData(void); - - virtual void BeforeThreadedGenerateData(); - -private: - VectorDataToMapFilter(const Self &) = delete; - void operator =(const Self&) = delete; - - void ProcessNode(InternalTreeNodeType * source, datasource_ptr mDatasource); - - SpacingType m_Spacing; - OriginType m_Origin; - SizeType m_Size; - IndexType m_StartIndex; - DirectionType m_Direction; - - // font file name - std::string m_FontFileName; - - //This factor is used to flip the data on the Y axis when using a - //sensor model geometry (where the Y coordinate increases top-down) - int m_SensorModelFlip; - - //this parameter is used only in the case of sensor geometry - //to adjust the scale - double m_ScaleFactor; - - //style list - std::vector<std::string> m_StyleList; - - //Overlay option: change the backgroup (blue or transparent) - bool m_UseAsOverlay; - - //Projection in the proj.4 format (for mapnik) - std::string m_VectorDataProjectionProj4; - - //Projection in the WKT format - std::string m_VectorDataProjectionWKT; - - //Rendering style type - RenderingStyleType m_RenderingStyleType; - - //RGBA Converter - typename RGBAConverterType::Pointer m_RGBAConverter; - - //Internal Tiling - unsigned int m_NbTile; - std::vector<RegionType> m_TilingRegions; - std::vector<mapnik::Map> m_Maps; - std::vector< std::vector<typename VectorDataExtractROIType::Pointer> > - m_VectorDataExtractors; - -}; // end class -} // end namespace otb - -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbVectorDataToMapFilter.hxx" -#endif - -#endif diff --git a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx b/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx deleted file mode 100644 index 97f7e3a2882b6442b1b3cd6ce75cbb9a317a7f85..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx +++ /dev/null @@ -1,666 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef otbVectorDataToMapFilter_hxx -#define otbVectorDataToMapFilter_hxx - -#include <sstream> -#include "otbVectorDataToMapFilter.h" -#include "itkImageRegionIterator.h" -#include "itkImageIteratorWithIndex.h" -#include "otbVectorDataStyle.h" -#include "itkRGBAPixel.h" - -#include "otbMapnikAdapter.h" - -#include "ogr_spatialref.h" - -namespace otb -{ - -/** - * Constructor - */ -template <class TVectorData, class TImage> -VectorDataToMapFilter<TVectorData, TImage> -::VectorDataToMapFilter() : - m_StyleList(), - m_UseAsOverlay(true), - m_RenderingStyleType(OSM) -{ - this->SetNumberOfRequiredInputs(1); - m_Spacing.Fill(1.0); - m_Origin.Fill(0.0); - m_Direction.SetIdentity(); - m_Size.Fill(0); - m_StartIndex.Fill(0); - m_SensorModelFlip = 1; - m_ScaleFactor = 1.0; - m_VectorDataProjectionProj4 = ""; - m_VectorDataProjectionWKT = ""; -} - -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetInput(const VectorDataType *input) -{ - // Process object is not const-correct so the const_cast is required here - this->itk::ProcessObject::SetNthInput(0, - const_cast<VectorDataType *>(input)); -} - -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetInput(unsigned int idx, const VectorDataType *input) -{ - // Process object is not const-correct so the const_cast is required here - this->itk::ProcessObject::SetNthInput(idx, - const_cast<VectorDataType *>(input)); -} - -template <class TVectorData, class TImage> -const typename VectorDataToMapFilter<TVectorData, TImage>::VectorDataType * -VectorDataToMapFilter<TVectorData, TImage> -::GetInput(void) -{ - if (this->GetNumberOfInputs() < 1) - { - return 0; - } - - return static_cast<const TVectorData *> - (this->itk::ProcessObject::GetInput(0)); -} - -template <class TVectorData, class TImage> -const typename VectorDataToMapFilter<TVectorData, TImage>::VectorDataType * -VectorDataToMapFilter<TVectorData, TImage> -::GetInput(unsigned int idx) -{ - return static_cast<const TVectorData *> - (this->itk::ProcessObject::GetInput(idx)); -} - -//---------------------------------------------------------------------------- -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetSpacing(const SpacingType& spacing) -{ - if (this->m_Spacing != spacing) - { - this->m_Spacing = spacing; - this->Modified(); - } -} - -//---------------------------------------------------------------------------- -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetSpacing(const double spacing[2]) -{ - SpacingType s(spacing); - this->SetSpacing(s); -} - -//---------------------------------------------------------------------------- -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetSpacing(const float spacing[2]) -{ - itk::Vector<float, 2> sf(spacing); - SpacingType s; - s.CastFrom(sf); - this->SetSpacing(s); -} - -//---------------------------------------------------------------------------- -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetOrigin(const double origin[2]) -{ - OriginType p(origin); - this->SetOrigin(p); -} - -//---------------------------------------------------------------------------- -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::SetOrigin(const float origin[2]) -{ - itk::Point<float, 2> of(origin); - OriginType p; - p.CastFrom(of); - this->SetOrigin(p); -} - -/** -* Inform pipeline of required output region -*/ -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::GenerateOutputInformation() -{ - // we can't call the superclass method here. - - // get pointers to the input and output - ImagePointer outputPtr = this->GetOutput(); - if (!outputPtr) - { - return; - } - - // Set the size of the output region - typename TImage::RegionType outputLargestPossibleRegion; - outputLargestPossibleRegion.SetSize(m_Size); - outputLargestPossibleRegion.SetIndex(m_StartIndex); - outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion); - - // Set spacing and origin - outputPtr->SetSignedSpacing(m_Spacing); - outputPtr->SetOrigin(m_Origin); - // outputPtr->SetDirection(m_Direction); - // As the direction cannot be changed in this filter there is no need to set - // the direction in the output image. Moreover, setting the direction to - // identity no that we enforce positive spacing leads to incoherences - - itk::MetaDataDictionary& dict = outputPtr->GetMetaDataDictionary(); - itk::EncapsulateMetaData<std::string> (dict, MetaDataKey::ProjectionRefKey, - static_cast<std::string>(m_VectorDataProjectionWKT)); - - //TODO update or check the projection information - - return; -} - -/** -* BeforeThreadedGenerateData -*/ -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::BeforeThreadedGenerateData(void) -{ - - Superclass::BeforeThreadedGenerateData(); - - //Font Handling - if(!m_FontFileName.empty()) - mapnik::freetype_engine::register_font(m_FontFileName); - - //Handle the style type using helper class - otb::VectorDataStyle::Pointer styleLoader = otb::VectorDataStyle::New(); - styleLoader->SetScaleFactor(m_ScaleFactor); - - //We assume that all the data are reprojected before using OTB. - VectorDataConstPointer input = this->GetInput(); - //Converting the projection string to the proj.4 format - itk::ExposeMetaData<std::string>( - input->GetMetaDataDictionary(), MetaDataKey::ProjectionRefKey, m_VectorDataProjectionWKT); - otbMsgDebugMacro(<< "WKT -> " << m_VectorDataProjectionWKT); - - m_SensorModelFlip = 1; - - if (m_VectorDataProjectionWKT == "") - { - //We assume that it is an image in sensor model geometry - //and tell mapnik that this is utm - //(with a resolution of 1m per unit) - m_VectorDataProjectionProj4 = "+proj=utm +zone=31 +ellps=WGS84"; - m_SensorModelFlip = -1; - otbMsgDevMacro(<< "The output map will be in sensor geometry"); - } - else - { - OGRSpatialReferenceH oSRS = OSRNewSpatialReference(m_VectorDataProjectionWKT.c_str()); - char * pszProj4; - OSRExportToProj4(oSRS, &pszProj4); - m_VectorDataProjectionProj4 = pszProj4; - CPLFree(pszProj4); - OSRRelease(oSRS); - m_SensorModelFlip = 1; - otbMsgDevMacro(<< "The output map will be carto/geo geometry"); - } - otbMsgDebugMacro(<< "Proj.4 -> " << m_VectorDataProjectionProj4); - - //Internal Tiling Support - //Workaround to overcome mapnik maximum tile size limitation - ImagePointer output = this->GetOutput(); - RegionType requestedRegion = output->GetRequestedRegion(); - otbMsgDevMacro("requestedRegion: " << requestedRegion); - - m_NbTile = (std::pow(std::max(std::floor((double)requestedRegion.GetSize()[0] / 16000), - std::floor((double)requestedRegion.GetSize()[1] / 16000))+1, 2)); - - //std::cout << "nbTile: " << m_NbTile << std::endl; - //std::cout << "requestedRegion: " << requestedRegion << std::endl; - - m_TilingRegions.resize(m_NbTile); - m_Maps.resize(m_NbTile); - m_VectorDataExtractors.resize(m_NbTile); - - unsigned int tilingRegionsIdx = 0; - unsigned int stdXOffset; - unsigned int stdYOffset; - - stdXOffset = std::floor((double)requestedRegion.GetSize()[0]/ (m_NbTile/2))+1; - stdYOffset = std::floor((double)requestedRegion.GetSize()[1]/ (m_NbTile/2))+1; - - for(unsigned int i=0; i < std::floor((double)(m_NbTile)/2 + 0.5); ++i) - { - for(unsigned int j=0; j < std::floor((double)(m_NbTile)/2 + 0.5); ++j) - { - //Set Regions - SizeType size; - IndexType index; - if(m_NbTile == 1) - { - index = requestedRegion.GetIndex(); - size = requestedRegion.GetSize(); - } - else - { - index[0] = requestedRegion.GetIndex()[0] + i * stdXOffset; - index[1] = requestedRegion.GetIndex()[1] + j * stdYOffset; - - size[0] = std::min((unsigned int)(requestedRegion.GetSize()[0] - index[0]), stdXOffset); - size[1] = std::min((unsigned int)(requestedRegion.GetSize()[1] - index[1]), stdYOffset); - } - m_TilingRegions[tilingRegionsIdx].SetIndex(index); - m_TilingRegions[tilingRegionsIdx].SetSize(size); - - //std::cout << "tileRegions[" << tilingRegionsIdx << "] : " - // << m_TilingRegions[tilingRegionsIdx] << std::endl; - - //Set Maps - m_Maps[tilingRegionsIdx] = mapnik::Map(); - - ////Load the style type - switch (m_RenderingStyleType) - { - case OSM: - { - styleLoader->LoadOSMStyle(m_Maps[tilingRegionsIdx]); - if (m_UseAsOverlay) - { - //Set the default backgroup to transparent - m_Maps[tilingRegionsIdx].set_background(mapnik::color(255, 255, 255, 0)); - } - else - { - m_Maps[tilingRegionsIdx].set_background(mapnik::color("#b5d0d0")); - } - break; - } - case Binary: - { - styleLoader->LoadBinaryRasterizationStyle(m_Maps[tilingRegionsIdx]); - //Set the backgroup to white - m_Maps[tilingRegionsIdx].set_background(mapnik::color("#ffffff")); - break; - } - default: - { - itkExceptionMacro(<< "Style Type Not Supported!"); - break; - } - } - - ////Set Mapnik projection information - m_Maps[tilingRegionsIdx].set_srs(m_VectorDataProjectionProj4); - - //Set VectorData extracts - m_VectorDataExtractors[tilingRegionsIdx].resize(this->GetNumberOfInputs()); - for (unsigned int idx = 0; idx < this->GetNumberOfInputs(); ++idx) - { - if (this->GetInput(idx)) - { - RemoteSensingRegionType rsRegion; - SizePhyType sizePhy; - sizePhy[0] = size[0] * m_Spacing[0]; - sizePhy[1] = size[1] * m_Spacing[1]; - rsRegion.SetSize(sizePhy); - OriginType origin; - origin[0] = m_Origin[0] + (static_cast<double>(index[0]) - 0.5) * m_Spacing[0]; - origin[1] = m_Origin[1] + (static_cast<double>(index[1]) - 0.5) * m_Spacing[1]; - rsRegion.SetOrigin(origin); - rsRegion.SetRegionProjection(m_VectorDataProjectionWKT); - - //std::cout << "m_SensorModelFlip: " << m_SensorModelFlip << std::endl; - //std::cout << "rsTileRegions[" << tilingRegionsIdx << "] : " - // << rsRegion << std::endl; - - m_VectorDataExtractors[tilingRegionsIdx][idx] = VectorDataExtractROIType::New(); - m_VectorDataExtractors[tilingRegionsIdx][idx]->SetRegion(rsRegion); - m_VectorDataExtractors[tilingRegionsIdx][idx]->SetInput(this->GetInput(idx)); - } - } - - tilingRegionsIdx ++; - } - } -} - -/** - * Generate Data - */ -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::GenerateData(void) -{ - - this->AllocateOutputs(); - - this->BeforeThreadedGenerateData(); - - if (m_StyleList.size() == 0) - { - switch (m_RenderingStyleType) - { - case OSM: - { - //Add default styles - itkExceptionMacro(<< "No style is provided for the vector data"); - break; - } - case Binary: - { - //Add default styles - this->AddStyle("binary-rasterization"); - break; - } - default: - { - itkExceptionMacro(<< "No style is provided for the vector data"); - break; - } - } - } - - ImagePointer output = this->GetOutput(); - - for (unsigned int tileIdx = 0; tileIdx < m_NbTile; ++tileIdx) - { - //Delete the previous layers from the map - int numberLayer = mapnik_otb::get_num_layer(m_Maps[tileIdx]); - for (int i = numberLayer - 1; i >= 0; i--) //yes, int. - { - m_Maps[tileIdx].removeLayer(i); - } - m_Maps[tileIdx].resize(m_TilingRegions[tileIdx].GetSize()[0], m_TilingRegions[tileIdx].GetSize()[1]); - - RemoteSensingRegionType rsRegion; - - for (unsigned int vdIdx = 0; vdIdx < this->GetNumberOfInputs(); ++vdIdx) - { - if (this->GetInput(vdIdx)) - { - datasource_ptr mDatasource = datasource_ptr(new mapnik::memory_datasource); - - rsRegion = m_VectorDataExtractors[tileIdx][vdIdx]->GetRegion(); - - m_VectorDataExtractors[tileIdx][vdIdx]->Update(); - VectorDataConstPointer input = m_VectorDataExtractors[tileIdx][vdIdx]->GetOutput(); - InternalTreeNodeType * inputRoot = const_cast<InternalTreeNodeType *>(input->GetDataTree()->GetRoot()); - - ProcessNode(inputRoot, mDatasource); - otbMsgDevMacro("Datasource size: " << mDatasource->size()); - - std::stringstream layerName; - layerName << "layer-" << tileIdx; - mapnik::layer lyr(layerName.str()); - lyr.set_srs(m_VectorDataProjectionProj4); - lyr.set_datasource(mDatasource); - - for (unsigned int i = 0; i < m_StyleList.size(); ++i) - { - lyr.add_style(m_StyleList[i]); - } - - m_Maps[tileIdx].addLayer(lyr); - } - } - assert((m_SensorModelFlip == 1) || (m_SensorModelFlip == -1)); - - mapnik_otb::box2d envelope( - rsRegion.GetOrigin(0), - m_SensorModelFlip*(rsRegion.GetOrigin(1) + rsRegion.GetSize(1)), - rsRegion.GetOrigin(0) + rsRegion.GetSize(0), - m_SensorModelFlip*(rsRegion.GetOrigin(1)) - ); - - mapnik_otb::zoom_to_box(&m_Maps[tileIdx], envelope); - otbMsgDebugMacro(<< "Envelope: " << envelope); - - otbMsgDebugMacro(<< "Map scale: " << m_Maps[tileIdx].scale_denominator()); - mapnik::image_32 buf(mapnik_otb::get_width(m_Maps[tileIdx]), - mapnik_otb::get_height(m_Maps[tileIdx])); - mapnik::agg_renderer<mapnik::image_32> ren(m_Maps[tileIdx], buf); - ren.apply(); - - const unsigned char * src = buf.raw_data(); - - itk::ImageRegionIterator<ImageType> it(output, m_TilingRegions[tileIdx]); - - for (it.GoToBegin(); !it.IsAtEnd(); ++it) - { - itk::RGBAPixel<unsigned char> pix; - pix[0] = *src; - pix[1] = *(src+1); - pix[2] = *(src+2); - pix[3] = *(src+3); - src += 4; - - it.Set(m_RGBAConverter->Convert(pix)); - } - } -} - -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::ProcessNode(InternalTreeNodeType * source, datasource_ptr mDatasource) -{ - typedef typename VectorDataType::DataNodeType DataNodeType; - typedef typename DataNodeType::Pointer DataNodePointerType; - - // Get the children list from the input node - ChildrenListType children = source->GetChildrenList(); - - // For each child - for (typename ChildrenListType::iterator it = children.begin(); it != children.end(); ++it) - { - // Copy input DataNode info - DataNodePointerType dataNode = (*it)->Get(); - - switch (dataNode->GetNodeType()) - { - case otb::ROOT: - { - ProcessNode((*it), mDatasource); - break; - } - case otb::DOCUMENT: - { - ProcessNode((*it), mDatasource); - break; - } - case otb::FOLDER: - { - ProcessNode((*it), mDatasource); - break; - } - case FEATURE_POINT: - { - mapnik_otb::geom* point = mapnik_otb::create_geom(mapnik::Point); - - point->move_to(dataNode->GetPoint()[0], m_SensorModelFlip * dataNode->GetPoint()[1]); -// std::cout << dataNode->GetPoint()[0] << ", " << dataNode->GetPoint()[1] << std::endl; - - typedef boost::shared_ptr<mapnik::raster> raster_ptr; - typedef mapnik::feature<mapnik_otb::geom, raster_ptr> Feature; - typedef boost::shared_ptr<Feature> feature_ptr; - - feature_ptr mfeature = feature_ptr(new Feature(1)); - mfeature->add_geometry(point); - - mapnik::transcoder tr("ISO-8859-15"); - - if (dataNode->HasField("place_name")) - boost::put(*mfeature, "name", - tr.transcode((dataNode->GetFieldAsString("place_name")).c_str())); - - boost::put(*mfeature, "place", tr.transcode("city")); - boost::put(*mfeature, "capital", tr.transcode("yes")); //FIXME more a question of style - - boost::put(*mfeature, "geometry", tr.transcode("point")); - - mDatasource->push(mfeature); - - break; - } - case otb::FEATURE_LINE: - { - mapnik_otb::geom* line = mapnik_otb::create_geom(mapnik::LineString); - - typedef typename DataNodeType::LineType::VertexListConstIteratorType VertexIterator; - VertexIterator itVertex = dataNode->GetLine()->GetVertexList()->Begin(); - while (itVertex != dataNode->GetLine()->GetVertexList()->End()) - { -// std::cout << itVertex.Value()[0] << ", " << itVertex.Value()[1] << std::endl; - line->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]); - ++itVertex; - } - -// std::cout << "Num points: " << line->num_points() << std::endl; - - typedef boost::shared_ptr<mapnik::raster> raster_ptr; - typedef mapnik::feature<mapnik_otb::geom, raster_ptr> Feature; - typedef boost::shared_ptr<Feature> feature_ptr; - - feature_ptr mfeature = feature_ptr(new Feature(1)); - mfeature->add_geometry(line); - - mapnik::transcoder tr("ISO-8859-15"); - - if (dataNode->HasField("name")) - boost::put(*mfeature, "name", - tr.transcode((dataNode->GetFieldAsString("name")).c_str())); - if (dataNode->HasField("NAME")) - boost::put(*mfeature, "name", - tr.transcode((dataNode->GetFieldAsString("NAME")).c_str())); - -// std::cout << mfeature->props().size() << std::endl; -// std::cout << " -> " << (*mfeature)["name"] << std::endl; - -// std::cout << "Name: " << dataNode->GetFieldAsString("NAME") << std::endl; -// std::cout << "Type: " << dataNode->GetFieldAsString("TYPE") << std::endl; -// std::cout << "OSM ID: " << dataNode->GetFieldAsString("osm_id") << std::endl; - - if (dataNode->HasField("type")) - boost::put(*mfeature, "highway", - tr.transcode((dataNode->GetFieldAsString("type")).c_str())); - if (dataNode->HasField("TYPE")) - boost::put(*mfeature, "highway", - tr.transcode((dataNode->GetFieldAsString("TYPE")).c_str())); - - boost::put(*mfeature, "geometry", tr.transcode("line")); - - mDatasource->push(mfeature); - - break; - } - case FEATURE_POLYGON: - { - mapnik_otb::geom* polygon = mapnik_otb::create_geom(mapnik::Polygon); - - typedef typename DataNodeType::PolygonType::VertexListConstIteratorType VertexIterator; - VertexIterator itVertex = dataNode->GetPolygonExteriorRing()->GetVertexList()->Begin(); - while (itVertex != dataNode->GetPolygonExteriorRing()->GetVertexList()->End()) - { - polygon->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]); - ++itVertex; - } - - typedef boost::shared_ptr<mapnik::raster> raster_ptr; - typedef mapnik::feature<mapnik_otb::geom, raster_ptr> Feature; - typedef boost::shared_ptr<Feature> feature_ptr; - - feature_ptr mfeature = feature_ptr(new Feature(1)); - mfeature->add_geometry(polygon); - - mapnik::transcoder tr("ISO-8859-15"); - - boost::put(*mfeature, "geometry", tr.transcode("polygon")); - - mDatasource->push(mfeature); - - break; - } - case FEATURE_MULTIPOINT: - { - itkExceptionMacro( - << "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToMapFilter(), please request for it"); - break; - } - case FEATURE_MULTILINE: - { - itkExceptionMacro( - << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToMapFilter(), please request for it"); - break; - } - case FEATURE_MULTIPOLYGON: - { - itkExceptionMacro( - << "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToMapFilter(), please request for it"); - break; - } - case FEATURE_COLLECTION: - { - itkExceptionMacro( - << "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToMapFilter(), please request for it"); - break; - } - } - } -} - -/** - * PrintSelf Method - */ -template <class TVectorData, class TImage> -void -VectorDataToMapFilter<TVectorData, TImage> -::PrintSelf(std::ostream& os, itk::Indent indent) const -{ - Superclass::PrintSelf(os, indent); -} -} - -#endif diff --git a/Modules/Filtering/VectorDataRendering/otb-module.cmake b/Modules/Filtering/VectorDataRendering/otb-module.cmake deleted file mode 100644 index 4251586660098e8e8d6753ffd33e99b55bc4d0ad..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/otb-module.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set(DOCUMENTATION "This module contains classes related to the rasterization of -OpenStreetMap vector data onto images") - -otb_module(OTBVectorDataRendering - DEPENDS - OTBVectorDataManipulation - OTBMapnik - OTBITK - OTBGDAL - OTBCommon - - TEST_DEPENDS - OTBVectorDataBase - OTBTestKernel - OTBImageIO - OTBProjection - OTBVectorDataIO - OTBImageBase - - DEPRECATED - - DESCRIPTION - "${DOCUMENTATION}" -) diff --git a/Modules/Filtering/VectorDataRendering/src/CMakeLists.txt b/Modules/Filtering/VectorDataRendering/src/CMakeLists.txt deleted file mode 100644 index 2c5d50b3353572f0102a1e9bd0ef3fcef1e71521..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/src/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set(OTBVectorDataRendering_SRC - otbVectorDataStyle.cxx - ) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/otbVectorDataStyle.cxx COMPILE_FLAGS "-fno-var-tracking") -endif() - -add_library(OTBVectorDataRendering ${OTBVectorDataRendering_SRC}) -target_link_libraries(OTBVectorDataRendering - ${OTBMapnik_LIBRARIES} - ${OTBVectorDataBase_LIBRARIES} - - ) - -otb_module_target(OTBVectorDataRendering) diff --git a/Modules/Filtering/VectorDataRendering/src/otbVectorDataStyle.cxx b/Modules/Filtering/VectorDataRendering/src/otbVectorDataStyle.cxx deleted file mode 100644 index 8f1d02f3a591416ea841d430495bc63b14e579aa..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/src/otbVectorDataStyle.cxx +++ /dev/null @@ -1,1674 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include "otbVectorDataStyle.h" - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow" -#include <mapnik/filter_factory.hpp> -#include <mapnik/rule.hpp> -#include <mapnik/text_symbolizer.hpp> -#ifndef OTB_MAPNIK_COMPATIBILITY_API07 -#include <mapnik/feature_type_style.hpp> -#endif -#pragma GCC diagnostic pop -#else -#include <mapnik/filter_factory.hpp> -#include <mapnik/rule.hpp> -#include <mapnik/text_symbolizer.hpp> -#ifndef OTB_MAPNIK_COMPATIBILITY_API07 -#include <mapnik/feature_type_style.hpp> -#endif -#endif - - - -namespace otb -{ -namespace mapnik_otb -{ -// this should be removed once mapnik support for version < 2.0 is dropped. -// should be around 01/2013. -#ifdef OTB_MAPNIK_COMPATIBILITY_API07 -typedef mapnik::rule_type rule; -static mapnik::filter_ptr parse_expression(std::string const& wkt) -{ - return mapnik::create_filter(wkt); -} -static shared_ptr<mapnik::text_symbolizer> create_text_symbolizer( - mapnik::filter_ptr filter, - std::string const& face_name, - unsigned size, - mapnik::color const& fill) -{ - shared_ptr<mapnik::text_symbolizer> p( - new mapnik::text_symbolizer( - "name", face_name, size, fill)); - return p; -} - -#else -typedef mapnik::rule rule; -static mapnik::expression_ptr parse_expression(std::string const& wkt) -{ - return mapnik::parse_expression(wkt); -} -static boost::shared_ptr<mapnik::text_symbolizer> create_text_symbolizer( - mapnik::expression_ptr filter, - std::string const& face_name, - unsigned size, - mapnik::color const& fill) -{ - boost::shared_ptr<mapnik::text_symbolizer> p( - new mapnik::text_symbolizer( - filter, face_name, size, fill)); - return p; -} - -#endif -} - -/** -* PrintSelf Method - */ -void -VectorDataStyle -::PrintSelf(std::ostream& os, itk::Indent indent) const -{ - Superclass::PrintSelf(os, indent); -} - -void -VectorDataStyle -::LoadBinaryRasterizationStyle(mapnik::Map& mapnikMap) const -{ - { - mapnik::feature_type_style style; - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[geometry] = 'line'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#000000"), 1); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[geometry] = 'polygon'")); - { - mapnik::polygon_symbolizer geom = mapnik::polygon_symbolizer(); - geom.set_fill(mapnik::color("#000000")); - geom.set_gamma(0.0); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[geometry] = 'point'")); - { - mapnik::point_symbolizer geom = mapnik::point_symbolizer(); - rule.append(geom); - } - style.add_rule(rule); - } - mapnikMap.insert_style("binary-rasterization", style); - } -} - -void -VectorDataStyle -::LoadOSMStyle(mapnik::Map& mapnikMap) const -{ - { - mapnik::feature_type_style style; - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(250000000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(600000ULL / m_ScaleFactor)); - { - mapnik::polygon_symbolizer geom = mapnik::polygon_symbolizer(); - geom.set_fill(mapnik::color("#f2efe9")); - rule.append(geom); - } - style.add_rule(rule); - } - mapnikMap.insert_style("world", style); - } - { - mapnik::feature_type_style style; - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[place] = 'city' and [capital]='yes'")); - rule.set_max_scale(static_cast<unsigned long long>(50000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(10000000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("#000")); - textSymb0->set_halo_radius(1); - textSymb0->set_wrap_width(0); - textSymb0->set_displacement(0.0, 0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[place] = 'city' and [capital]='yes'")); - rule.set_max_scale(static_cast<unsigned long long>(10000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 11, mapnik::color("#000")); - textSymb0->set_halo_radius(1); - textSymb0->set_wrap_width(0); - textSymb0->set_displacement(0.0, 0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[place] = 'city' and not [capital]='yes'")); - rule.set_max_scale(static_cast<unsigned long long>(10000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 8, mapnik::color("#000")); - textSymb0->set_halo_radius(1); - textSymb0->set_wrap_width(0); - textSymb0->set_displacement(0.0, 0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[place] = 'city'")); - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 11, mapnik::color("#000")); - textSymb0->set_halo_radius(1); - textSymb0->set_wrap_width(0); - textSymb0->set_displacement(0.0, 0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[place] = 'city'")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 14, mapnik::color("#000")); - textSymb0->set_halo_radius(1); - textSymb0->set_wrap_width(0); - textSymb0->set_displacement(0.0, 0); - rule.append(*textSymb0); - style.add_rule(rule); - } - mapnikMap.insert_style("city", style); - } - { - mapnik::feature_type_style style; - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 1")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 2")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 3")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 4")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 5")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 6")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 7")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and [length] = 8")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 1")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 2")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 3")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 4")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 5")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 6")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 7")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' and [length] = 8")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 1")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 2")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 3")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 4")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 5")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 6")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 7")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' and [length] = 8")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 1")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 2")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 3")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 4")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 5")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 6")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 7")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' and [length] = 8")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 1")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 2")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 3")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 4")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 5")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 6")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 7")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and [length] = 8")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'primary'")); - rule.set_max_scale(static_cast<unsigned long long>(75000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 8, mapnik::color("black")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary'")); - rule.set_max_scale(static_cast<unsigned long long>(75000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 8, mapnik::color("black")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - textSymb0->set_halo_fill(mapnik::color("#fed7a5")); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'primary'")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("black")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'primary'")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 10, mapnik::color("black")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(0); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary'")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("black")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - textSymb0->set_halo_fill(mapnik::color("#fed7a5")); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary'")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 10, mapnik::color("black")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - textSymb0->set_halo_fill(mapnik::color("#fed7a5")); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary'")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary'")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 11, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'proposed' or [highway]='construction'")); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'proposed' or [highway]='construction'")); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 11, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'unclassified' or [highway] = 'residential'")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - textSymb0->set_label_spacing(300); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'unclassified' or [highway] = 'residential'")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 11, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - textSymb0->set_label_spacing(400); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_else(true); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 9, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - rule.append(*textSymb0); - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_else(true); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100ULL / m_ScaleFactor)); - boost::shared_ptr<mapnik::text_symbolizer> textSymb0 = mapnik_otb::create_text_symbolizer(mapnik_otb::parse_expression("[name]"), - "DejaVu Sans Book", 11, mapnik::color("#000")); - textSymb0->set_label_placement(mapnik::LINE_PLACEMENT); - textSymb0->set_halo_radius(1); - rule.append(*textSymb0); - style.add_rule(rule); - } - mapnikMap.insert_style("roads-text", style); - } - { - mapnik::feature_type_style style; - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' or [highway] = 'motorway_link'")); - rule.set_max_scale(static_cast<unsigned long long>(25000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#809bc0"), 0.5); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' or [highway] = 'motorway_link'")); - rule.set_max_scale(static_cast<unsigned long long>(5000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#809bc0"), 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' or [highway] = 'motorway_link'")); - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#809bc0"), 1.4); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' or [highway] = 'motorway_link'")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#809bc0"), 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' or [highway] = 'motorway_link'")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#809bc0"), 2.5); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'trunk_link'")); - rule.set_max_scale(static_cast<unsigned long long>(25000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#a9dba9"), 0.4); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'trunk_link'")); - rule.set_max_scale(static_cast<unsigned long long>(5000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#97d397"), 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'trunk_link'")); - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#97d397"), 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'trunk' or [highway] = 'trunk_link'")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#97d397"), 2.5); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' or [highway] = 'primary_link'")); - rule.set_max_scale(static_cast<unsigned long long>(5000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#ec989a"), 0.5); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' or [highway] = 'primary_link'")); - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#ec989a"), 1.2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' or [highway] = 'primary_link'")); - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#ec989a"), 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'primary' or [highway] = 'primary_link'")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#ec989a"), 2.5); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' or [highway] = 'secondary_link'")); - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#fecc8b"), 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'secondary' or [highway] = 'secondary_link'")); - rule.set_max_scale(static_cast<unsigned long long>(500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#fecc8b"), 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(10000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'rail'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 0.6); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'rail' and not ([tunnel]='yes' or [tunnel]='true')")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(2000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'rail' and ([tunnel]='yes' or [tunnel]='true')")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 1); - stroke.add_dash(5, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(2500000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression( - "[railway] = 'tram' or [railway] = 'light_rail' or [railway] = 'narrow_gauge'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#ccc"), 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'rail' and not ([tunnel]='yes' or [tunnel]='true')")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'rail' and ([tunnel]='yes' or [tunnel]='true')")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 2); - stroke.add_dash(5, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(1000000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression( - "[railway] = 'tram' or [railway] = 'light_rail' or [railway] = 'narrow_gauge'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'preserved'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#aaa"), 1.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway] = 'preserved'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999999"), 3); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("white"), 1); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.add_dash(0, 1); - stroke.add_dash(8, 1); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - rule.set_filter(mapnik_otb::parse_expression("[railway]='monorail'")); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#fff"), 4); - stroke.set_opacity (0.4); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#777"), 3.0); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - stroke.add_dash(2, 3); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - mapnikMap.insert_style("roads", style); - } - { - mapnik::feature_type_style style; - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and not ([tunnel] = 'yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#506077"), 3); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'trunk' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#477147"), 3); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'primary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(200000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#8d4346"), 3); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'secondary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(150000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(75000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#a37b48"), 2.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and not ([tunnel] = 'yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#506077"), 6.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'trunk' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#477147"), 7.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'primary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#8d4346"), 7.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'secondary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(75000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#a37b48"), 8.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'motorway' and not ([tunnel] = 'yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#506077"), 10); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'trunk' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#477147"), 11.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'primary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#8d4346"), 11.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'secondary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#a37b48"), 11.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'motorway' and not ([tunnel] = 'yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#506077"), 13); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'trunk' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#477147"), 16); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'primary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#8d4346"), 16); - stroke.set_line_join(mapnik::ROUND_JOIN); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'secondary' and not ([tunnel] = 'yes' or [tunnel] = 'true' or [tunnel] = '1')")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#a37b48"), 16); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'tertiary' and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#bbb"), 6); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 6); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'residential' or [highway] = 'minor' or [highway] = 'unclassified' or " - "[highway] = 'road') and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 3); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'residential' or [highway] = 'minor' or [highway] = 'unclassified' or " - "[highway] = 'road') and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 3); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#bbb"), 7.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'tertiary' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 7.5); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'residential' or [highway] = 'minor' or [highway] = 'unclassified' or " - "[highway] = 'road') and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 4.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'residential' or [highway] = 'minor' or [highway] = 'unclassified' or " - "[highway] = 'road') and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 4.5); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'tertiary' or [highway] = 'residential' or [highway] = 'minor' or " - "[highway] = 'unclassified' or [highway] = 'road') and not ([tunnel]='yes' or " - "[tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#bbb"), 11); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'tertiary' or [highway] = 'residential' or [highway] = 'minor' or " - "[highway] = 'unclassified' or [highway] = 'road') and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 11); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'tertiary' or [highway] = 'residential' or [highway] = 'minor' or " - "[highway] = 'unclassified' or [highway] = 'road') and not ([tunnel]='yes' or " - "[tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#bbb"), 16); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "([highway] = 'tertiary' or [highway] = 'residential' or [highway] = 'minor' or " - "[highway] = 'unclassified' or [highway] = 'road') and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(5000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 16); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'service' and not ([service]='parking_aisle' or [tunnel]='yes' or " - "[tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 3); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'service' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 3); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression( - "[highway] = 'service' and not ([service]='parking_aisle' or[tunnel]='yes' or " - "[tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 8); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'service' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(25000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 8); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'service' and [service]='parking_aisle'")); - rule.set_max_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(1000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("#999"), 4); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 2); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(100000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 2); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 3.6); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(50000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 3.6); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 6.5); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(20000ULL / m_ScaleFactor)); - rule.set_min_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 6.5); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and not ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 9); - stroke.set_line_join(mapnik::ROUND_JOIN); - stroke.set_line_cap(mapnik::ROUND_CAP); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - { - mapnik_otb::rule rule; - rule.set_filter(mapnik_otb::parse_expression("[highway] = 'pedestrian' and ([tunnel]='yes' or [tunnel]='true')")); - rule.set_max_scale(static_cast<unsigned long long>(10000ULL / m_ScaleFactor)); - { - mapnik::line_symbolizer geom = mapnik::line_symbolizer(); - mapnik::stroke stroke = mapnik::stroke(mapnik::color("grey"), 9); - stroke.add_dash(4, 2); - geom.set_stroke(stroke); - rule.append(geom); - } - style.add_rule(rule); - } - mapnikMap.insert_style("minor-roads-casing", style); - } -} -} //namespace otb diff --git a/Modules/Filtering/VectorDataRendering/test/CMakeLists.txt b/Modules/Filtering/VectorDataRendering/test/CMakeLists.txt deleted file mode 100644 index fb5e292bcc3442fe472d772807917e92f295f492..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/test/CMakeLists.txt +++ /dev/null @@ -1,90 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -otb_module_test() - -set(OTBVectorDataRenderingTests -otbVectorDataRenderingTestDriver.cxx -otbVectorDataToMapFilterWorld.cxx -otbVectorDataToMapFilter.cxx -otbVectorDataToMapFilterNoFonts.cxx -otbVectorDataToMapFilterSensorModel.cxx -) - -add_executable(otbVectorDataRenderingTestDriver ${OTBVectorDataRenderingTests}) -target_link_libraries(otbVectorDataRenderingTestDriver ${OTBVectorDataRendering-Test_LIBRARIES}) -otb_module_target_label(otbVectorDataRenderingTestDriver) - -# Tests Declaration - -otb_add_test(NAME coTvVectorDataToMapFilterWorld COMMAND otbVectorDataRenderingTestDriver - --compare-image ${NOTOL} - ${BASELINE}/coTvVectorDataToMapFilterWorld.png - ${TEMP}/coTvVectorDataToMapFilterWorld.png - otbVectorDataToMapFilterWorld - ${INPUTDATA}/world_boundaries/world_boundaries_m.shp - ${INPUTDATA}/world_boundaries/places.shp - ${TEMP}/coTvVectorDataToMapFilterWorld.png - 500 500 #Size - -20 60 #lon/lat - 0.1 -0.1 #spacing lon/lat - ${INPUTDATA}/DejaVuSans.ttf # font - ) - -otb_add_test(NAME coTvVectorDataToMapFilterBinary COMMAND otbVectorDataRenderingTestDriver - --compare-image ${NOTOL} - ${BASELINE}/coTvVectorDataToMapFilterBinary.png - ${TEMP}/coTvVectorDataToMapFilterBinary.png - otbVectorDataToMapFilterBinary - LARGEINPUT{VECTOR/MidiPyrenees/roads.shp} - ${TEMP}/coTvVectorDataToMapFilterBinary.png - ) - -otb_add_test(NAME coTvVectorDataToMapFilter COMMAND otbVectorDataRenderingTestDriver - --compare-image ${NOTOL} - ${BASELINE}/coTvVectorDataToMapFilter.png - ${TEMP}/coTvVectorDataToMapFilter.png - otbVectorDataToMapFilter - LARGEINPUT{VECTOR/MidiPyrenees/roads.shp} - ${TEMP}/coTvVectorDataToMapFilter.png - ${INPUTDATA}/DejaVuSans.ttf # font - ) - - -otb_add_test(NAME coTvVectorDataToMapFilterNoFonts COMMAND otbVectorDataRenderingTestDriver - --compare-image ${NOTOL} - ${BASELINE}/coTvVectorDataToMapFilterNoFonts.png - ${TEMP}/coTvVectorDataToMapFilterNoFonts.png - otbVectorDataToMapFilterNoFonts - LARGEINPUT{VECTOR/MidiPyrenees/roads.shp} - ${TEMP}/coTvVectorDataToMapFilterNoFonts.png - ) - -otb_add_test(NAME coTvVectorDataToMapFilterSensorModel COMMAND otbVectorDataRenderingTestDriver - --compare-image ${NOTOL} - ${BASELINE}/coTvVectorDataToMapFilterSensorModel.png - ${TEMP}/coTvVectorDataToMapFilterSensorModel.png - otbVectorDataToMapFilterSensorModel - LARGEINPUT{VECTOR/MidiPyrenees/roads.shp} - LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF} - ${TEMP}/coTvVectorDataToMapFilterSensorModel.png - ${INPUTDATA}/DejaVuSans.ttf # font - ) - diff --git a/Modules/Filtering/VectorDataRendering/test/otbVectorDataRenderingTestDriver.cxx b/Modules/Filtering/VectorDataRendering/test/otbVectorDataRenderingTestDriver.cxx deleted file mode 100644 index 468267fa3563a3c26e62cef273be2069f74815b9..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/test/otbVectorDataRenderingTestDriver.cxx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "otbTestMain.h" - -void RegisterTests() -{ - REGISTER_TEST(otbVectorDataToMapFilterWorld); - REGISTER_TEST(otbVectorDataToMapFilter); - REGISTER_TEST(otbVectorDataToMapFilterBinary); - REGISTER_TEST(otbVectorDataToMapFilterNoFonts); - REGISTER_TEST(otbVectorDataToMapFilterSensorModel); -} diff --git a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilter.cxx b/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilter.cxx deleted file mode 100644 index bd263b387d01e1498611ae8a5836fdaf4060866a..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilter.cxx +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include "otbVectorDataFileReader.h" -#include "otbImageFileWriter.h" -#include "otbVectorData.h" -#include "otbVectorDataProjectionFilter.h" -#include <fstream> -#include <iostream> - -#include "itkRGBAPixel.h" -#include "otbImage.h" -#include "otbVectorDataToMapFilter.h" - -int otbVectorDataToMapFilter(int argc, char* argv []) -{ - - if (argc < 4) - { - std::cout << argv[0] << " <input vector filename> <input image filename> <font filename>" << std::endl; - - return EXIT_FAILURE; - } - - //Read the vector data - typedef otb::VectorData<> VectorDataType; - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; - VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); - - reader->SetFileName(argv[1]); - - //Reproject the vector data in the proper projection - typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> ProjectionFilterType; - ProjectionFilterType::Pointer projection = ProjectionFilterType::New(); - projection->SetInput(reader->GetOutput()); - - std::string projectionRefWkt = - "PROJCS[\"UTM Zone 31, Northern Hemisphere\", GEOGCS[\"WGS 84\", DATUM[\"WGS_1984\", SPHEROID[\"WGS 84\", 6378137, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], TOWGS84[0, 0, 0, 0, 0, 0, 0], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree\", 0.0174532925199433, AUTHORITY[\"EPSG\",\"9108\"]], AXIS[\"Lat\", NORTH], AXIS[\"Long\", EAST], AUTHORITY[\"EPSG\",\"4326\"]], PROJECTION[\"Transverse_Mercator\"], PARAMETER[\"latitude_of_origin\", 0], PARAMETER[\"central_meridian\", 3], PARAMETER[\"scale_factor\", 0.9996], PARAMETER[\"false_easting\", 500000], PARAMETER[\"false_northing\", 0], UNIT[\"Meter\", 1]]"; - - projection->SetOutputProjectionRef(projectionRefWkt); - - //Convert the vector data into an image - typedef itk::RGBAPixel<unsigned char> PixelType; - typedef otb::Image<PixelType, 2> ImageType; - - ImageType::SizeType size; - size[0] = 500; - size[1] = 500; - - ImageType::PointType origin; - origin[0] = 374149.980555821; //UL easting - origin[1] = 4829183.99443839; //UL northing - - ImageType::SpacingType spacing; - spacing[0] = 0.6; - spacing[1] = -0.6; - - typedef otb::RemoteSensingRegion<double> RegionType; - RegionType region; - RegionType::SizeType sizeInUnit; - sizeInUnit[0] = size[0] * spacing[0]; - sizeInUnit[1] = size[1] * spacing[1]; - region.SetSize(sizeInUnit); - region.SetOrigin(origin); - region.SetRegionProjection(projectionRefWkt); - - typedef otb::VectorDataExtractROI<VectorDataType> ExtractROIType; - ExtractROIType::Pointer extractROI = ExtractROIType::New(); - extractROI->SetRegion(region); - extractROI->SetInput(projection->GetOutput()); - - typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType; - VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New(); - vectorDataRendering->SetInput(extractROI->GetOutput()); - - vectorDataRendering->SetSize(size); - vectorDataRendering->SetOrigin(origin); - vectorDataRendering->SetSpacing(spacing); - vectorDataRendering->SetFontFileName(argv[3]); - vectorDataRendering->AddStyle("minor-roads-casing"); - vectorDataRendering->AddStyle("roads-text"); - - //Save the image in a file - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(vectorDataRendering->GetOutput()); - writer->SetFileName(argv[2]); - writer->Update(); - - return EXIT_SUCCESS; -} - -int otbVectorDataToMapFilterBinary(int argc, char* argv []) -{ - - if (argc < 3) - { - std::cout << argv[0] << " <input vector filename> <input image filename>" << std::endl; - - return EXIT_FAILURE; - } - - //Read the vector data - typedef otb::VectorData<> VectorDataType; - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; - VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); - - reader->SetFileName(argv[1]); - - //Reproject the vector data in the proper projection - typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> ProjectionFilterType; - ProjectionFilterType::Pointer projection = ProjectionFilterType::New(); - projection->SetInput(reader->GetOutput()); - - std::string projectionRefWkt = - "PROJCS[\"UTM Zone 31, Northern Hemisphere\", GEOGCS[\"WGS 84\", DATUM[\"WGS_1984\", SPHEROID[\"WGS 84\", 6378137, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], TOWGS84[0, 0, 0, 0, 0, 0, 0], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree\", 0.0174532925199433, AUTHORITY[\"EPSG\",\"9108\"]], AXIS[\"Lat\", NORTH], AXIS[\"Long\", EAST], AUTHORITY[\"EPSG\",\"4326\"]], PROJECTION[\"Transverse_Mercator\"], PARAMETER[\"latitude_of_origin\", 0], PARAMETER[\"central_meridian\", 3], PARAMETER[\"scale_factor\", 0.9996], PARAMETER[\"false_easting\", 500000], PARAMETER[\"false_northing\", 0], UNIT[\"Meter\", 1]]"; - - projection->SetOutputProjectionRef(projectionRefWkt); - - //Convert the vector data into an image - typedef itk::RGBAPixel<unsigned char> PixelType; - typedef otb::Image<PixelType, 2> ImageType; - - ImageType::SizeType size; - size[0] = 500; - size[1] = 500; - - ImageType::PointType origin; - origin[0] = 374149.980555821; //UL easting - origin[1] = 4829183.99443839; //UL northing - - ImageType::SpacingType spacing; - spacing[0] = 0.6; - spacing[1] = -0.6; - - typedef otb::RemoteSensingRegion<double> RegionType; - RegionType region; - RegionType::SizeType sizeInUnit; - sizeInUnit[0] = size[0] * spacing[0]; - sizeInUnit[1] = size[1] * spacing[1]; - region.SetSize(sizeInUnit); - region.SetOrigin(origin); - region.SetRegionProjection(projectionRefWkt); - - typedef otb::VectorDataExtractROI<VectorDataType> ExtractROIType; - ExtractROIType::Pointer extractROI = ExtractROIType::New(); - extractROI->SetRegion(region); - extractROI->SetInput(projection->GetOutput()); - - typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType; - VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New(); - vectorDataRendering->SetInput(extractROI->GetOutput()); - - vectorDataRendering->SetSize(size); - vectorDataRendering->SetOrigin(origin); - vectorDataRendering->SetSpacing(spacing); - vectorDataRendering->SetRenderingStyleType(VectorDataToMapFilterType::Binary); - - //Save the image in a file - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(vectorDataRendering->GetOutput()); - writer->SetFileName(argv[2]); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterNoFonts.cxx b/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterNoFonts.cxx deleted file mode 100644 index 92425cd08cde668f43b4c303efde4cf2ff19d07c..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterNoFonts.cxx +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include "otbVectorDataFileReader.h" -#include "otbImageFileWriter.h" -#include "otbVectorData.h" -#include "otbVectorDataProjectionFilter.h" -#include <fstream> -#include <iostream> - -#include "itkRGBAPixel.h" -#include "otbImage.h" -#include "otbVectorDataToMapFilter.h" - -int otbVectorDataToMapFilterNoFonts(int argc, char * argv []) -{ - - if (argc < 3) - { - std::cout << argv[0] << " <input vector filename> <input image filename>" << std::endl; - - return EXIT_FAILURE; - } - - //Read the vector data - typedef otb::VectorData<> VectorDataType; - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; - VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); - - reader->SetFileName(argv[1]); - - //Reproject the vector data in the proper projection - typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> ProjectionFilterType; - ProjectionFilterType::Pointer projection = ProjectionFilterType::New(); - projection->SetInput(reader->GetOutput()); - - std::string projectionRefWkt = - "PROJCS[\"UTM Zone 31, Northern Hemisphere\", GEOGCS[\"WGS 84\", DATUM[\"WGS_1984\", SPHEROID[\"WGS 84\", 6378137, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], TOWGS84[0, 0, 0, 0, 0, 0, 0], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree\", 0.0174532925199433, AUTHORITY[\"EPSG\",\"9108\"]], AXIS[\"Lat\", NORTH], AXIS[\"Long\", EAST], AUTHORITY[\"EPSG\",\"4326\"]], PROJECTION[\"Transverse_Mercator\"], PARAMETER[\"latitude_of_origin\", 0], PARAMETER[\"central_meridian\", 3], PARAMETER[\"scale_factor\", 0.9996], PARAMETER[\"false_easting\", 500000], PARAMETER[\"false_northing\", 0], UNIT[\"Meter\", 1]]"; - - projection->SetOutputProjectionRef(projectionRefWkt); - - //Convert the vector data into an image - typedef itk::RGBAPixel<unsigned char> PixelType; - typedef otb::Image<PixelType, 2> ImageType; - - ImageType::SizeType size; - size[0] = 500; - size[1] = 500; - - ImageType::PointType origin; - origin[0] = 374149.980555821; //UL easting - origin[1] = 4829183.99443839; //UL northing - - ImageType::SpacingType spacing; - spacing[0] = 0.6; - spacing[1] = -0.6; - - typedef otb::RemoteSensingRegion<double> RegionType; - RegionType region; - RegionType::SizeType sizeInUnit; - sizeInUnit[0] = size[0] * spacing[0]; - sizeInUnit[1] = size[1] * spacing[1]; - region.SetSize(sizeInUnit); - region.SetOrigin(origin); - region.SetRegionProjection(projectionRefWkt); - - typedef otb::VectorDataExtractROI<VectorDataType> ExtractROIType; - ExtractROIType::Pointer extractROI = ExtractROIType::New(); - extractROI->SetRegion(region); - extractROI->SetInput(projection->GetOutput()); - - typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType; - VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New(); - vectorDataRendering->SetInput(extractROI->GetOutput()); - - vectorDataRendering->SetSize(size); - vectorDataRendering->SetOrigin(origin); - vectorDataRendering->SetSpacing(spacing); - vectorDataRendering->AddStyle("minor-roads-casing"); - - //Save the image in a file - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(vectorDataRendering->GetOutput()); - writer->SetFileName(argv[2]); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterSensorModel.cxx b/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterSensorModel.cxx deleted file mode 100644 index bbe6a7afe719991388f4e7686986c377c63cb1f5..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterSensorModel.cxx +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include <fstream> -#include <iostream> - -#include "otbVectorDataFileReader.h" -#include "otbImageFileWriter.h" -#include "otbVectorData.h" -#include "otbVectorDataProjectionFilter.h" - -#include "itkRGBAPixel.h" -#include "otbImage.h" -#include "otbImageFileReader.h" -#include "otbVectorDataToMapFilter.h" - -int otbVectorDataToMapFilterSensorModel(int argc, char * argv []) -{ - - if (argc < 5) - { - std::cout << argv[0] << " <input vector filename> <input image filename>" - << " <output vector filename> " - << "<font filename>" - << std::endl; - - return EXIT_FAILURE; - } - - //Read the vector data - typedef otb::VectorData<> VectorDataType; - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; - VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); - reader->SetFileName(argv[1]); - - //Read the image (only for the information) - typedef otb::Image<unsigned short int, 2> SensorImageType; - typedef otb::ImageFileReader<SensorImageType> ImageReaderType; - ImageReaderType::Pointer imageReader = ImageReaderType::New(); - imageReader->SetFileName(argv[2]); - imageReader->UpdateOutputInformation(); - - //Reproject the vector data in the proper projection - typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> ProjectionFilterType; - ProjectionFilterType::Pointer projection = ProjectionFilterType::New(); - projection->SetInput(reader->GetOutput()); - - projection->SetOutputKeywordList(imageReader->GetOutput()->GetImageKeywordlist()); - projection->SetOutputOrigin(imageReader->GetOutput()->GetOrigin()); - projection->SetOutputSpacing(imageReader->GetOutput()->GetSignedSpacing()); - - //Convert the vector data into an image - typedef itk::RGBAPixel<unsigned char> PixelType; - typedef otb::Image<PixelType, 2> ImageType; - - ImageType::SizeType size; - size[0] = 500; - size[1] = 500; - - ImageType::PointType origin; -// origin[0] = imageReader->GetOutput()->GetOrigin()[0]; -// origin[1] = imageReader->GetOutput()->GetOrigin()[1]; - origin[0] = 11052; - origin[1] = 7585; - - ImageType::SpacingType spacing; -// spacing[0] = imageReader->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/static_cast<double>(size[0]); -// spacing[1] = imageReader->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/static_cast<double>(size[1]); - spacing[0] = 500 / static_cast<double>(size[0]); - spacing[1] = 500 / static_cast<double>(size[1]); - - std::cout << "Size: " << size << std::endl; - std::cout << "Origin: " << origin << std::endl; - std::cout << "Spacing: " << spacing << std::endl; - - typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType; - VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New(); - vectorDataRendering->SetInput(projection->GetOutput()); - - vectorDataRendering->SetSize(size); - vectorDataRendering->SetOrigin(origin); - vectorDataRendering->SetSpacing(spacing); - vectorDataRendering->SetFontFileName(argv[4]); - vectorDataRendering->AddStyle("minor-roads-casing"); - vectorDataRendering->AddStyle("roads-text"); - - //Save the image in a file - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(vectorDataRendering->GetOutput()); - writer->SetFileName(argv[3]); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterWorld.cxx b/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterWorld.cxx deleted file mode 100644 index 93ca4bb0e542eeff8948248b79f2bca4b4199f85..0000000000000000000000000000000000000000 --- a/Modules/Filtering/VectorDataRendering/test/otbVectorDataToMapFilterWorld.cxx +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include "otbVectorDataFileReader.h" -#include "otbImageFileWriter.h" -#include "otbVectorData.h" -#include "otbVectorDataProjectionFilter.h" -#include <fstream> -#include <iostream> - -#include "itkRGBAPixel.h" -#include "otbImage.h" -#include "otbVectorDataToMapFilter.h" - -int otbVectorDataToMapFilterWorld(int argc, char * argv []) -{ - - if (argc < 11) - { - std::cout << argv[0] << " <input vector filename> <input image filename>" - << " <output vector filename> " - << " <sizeX> <sizeY> " - << " <origin lon> <origin lat> " - << " <spacing lon> <spacing lat> " - << " <font filename>" - << std::endl; - return EXIT_FAILURE; - } - - //Read the vector data - typedef otb::VectorData<> VectorDataType; - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; - - //Reproject the vector data in the proper projection - typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> ProjectionFilterType; - - std::string outputProjRef("GEOGCS[\"GCS_WGS_1984\", DATUM[\"D_WGS_1984\", " - "SPHEROID[\"WGS_1984\", 6378137, 298.257223563]], PRIMEM[\"Greenwich\", 0]," - " UNIT[\"Degree\", 0.017453292519943295]]"); - - VectorDataFileReaderType::Pointer reader0 = VectorDataFileReaderType::New(); - reader0->SetFileName(argv[1]); - ProjectionFilterType::Pointer projection0 = ProjectionFilterType::New(); - projection0->SetInput(reader0->GetOutput()); - projection0->SetOutputProjectionRef(outputProjRef); - - VectorDataFileReaderType::Pointer reader1 = VectorDataFileReaderType::New(); - reader1->SetFileName(argv[2]); - ProjectionFilterType::Pointer projection1 = ProjectionFilterType::New(); - projection1->SetInput(reader1->GetOutput()); - projection1->SetOutputProjectionRef(outputProjRef); - - //Convert the vector data into an image - typedef itk::RGBAPixel<unsigned char> PixelType; - typedef otb::Image<PixelType, 2> ImageType; - - ImageType::SizeType size; - size[0] = atoi(argv[4]); - size[1] = atoi(argv[5]); - - ImageType::PointType origin; - origin[0] = atof(argv[6]); - origin[1] = atof(argv[7]); - - ImageType::SpacingType spacing; - spacing[0] = atof(argv[8]); - spacing[1] = atof(argv[9]); - - typedef otb::VectorDataToMapFilter<VectorDataType, ImageType> VectorDataToMapFilterType; - VectorDataToMapFilterType::Pointer vectorDataRendering = VectorDataToMapFilterType::New(); - vectorDataRendering->SetInput(0, projection0->GetOutput()); - vectorDataRendering->SetInput(1, projection1->GetOutput()); - - vectorDataRendering->SetSize(size); - vectorDataRendering->SetOrigin(origin); - vectorDataRendering->SetSpacing(spacing); - vectorDataRendering->SetFontFileName(argv[10]); - vectorDataRendering->AddStyle("world"); - vectorDataRendering->AddStyle("city"); - vectorDataRendering->UseAsOverlayOff(); - - //Save the image in a file - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(vectorDataRendering->GetOutput()); - writer->SetFileName(argv[3]); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/Modules/IO/IOTileMap/CMakeLists.txt b/Modules/IO/IOTileMap/CMakeLists.txt deleted file mode 100644 index 2c379b9a5c3099f7857f91af289de16ece3bf22a..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -project(OTBIOTileMap) - -set(OTBIOTileMap_LIBRARIES OTBIOTileMap) -otb_module_impl() diff --git a/Modules/IO/IOTileMap/include/otbTileMapImageIO.h b/Modules/IO/IOTileMap/include/otbTileMapImageIO.h deleted file mode 100644 index 6e86d7609ee47537611d241bc4e382af6062d91a..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/include/otbTileMapImageIO.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef otbTileMapImageIO_h -#define otbTileMapImageIO_h - - -/* C++ Libraries */ -#include <string> -#include <vector> -//#include "stdlib.h" - -/* ITK Libraries */ -#include "otbImageIOBase.h" -#include "otbImageRegionTileMapSplitter.h" - -#include "otbCurlHelperInterface.h" - -#include "OTBIOTileMapExport.h" - -namespace otb -{ - -namespace TileMapAddressingStyle -{ -enum TileMapAddressingStyle {GM = 0, OSM = 1, NEARMAP = 2, LOCAL = 3}; -} - -/** \class TileMapImageIO - * \deprecated - * \brief ImageIO object for reading and writing TileMap images - * - * - * - * \ingroup OTBIOTileMap - */ -class OTBIOTileMap_DEPRECATED_EXPORT TileMapImageIO : public otb::ImageIOBase -{ -public: - - typedef unsigned char InputPixelType; - - /** Standard class typedefs. */ - typedef TileMapImageIO Self; - typedef otb::ImageIOBase Superclass; - typedef itk::SmartPointer<Self> Pointer; - - /** Method for creation through the object factory. */ - itkNewMacro(Self); - - /** Run-time type information (and related methods). */ - itkTypeMacro(TileMapImageIO, otb::ImageIOBase); - - typedef itk::ImageIORegion ImageIORegion; - - /** Set/Get the level of compression for the output images. - * 0-9; 0 = none, 9 = maximum. */ - itkSetMacro(CompressionLevel, int); - itkGetMacro(CompressionLevel, int); - - /** Set/Get the maximum number of connections */ - itkSetMacro(MaxConnect, int); - itkGetMacro(MaxConnect, int); - - virtual void SetCacheDirectory(const char* _arg); - virtual void SetCacheDirectory(const std::string& _arg); - - itkGetStringMacro(CacheDirectory); - - itkSetMacro(Depth, int); - itkGetMacro(Depth, int); - - itkGetStringMacro(FileSuffix); - itkSetStringMacro(FileSuffix); - - /** Determine the file type. Returns true if this ImageIO can read the - * file specified. */ - bool CanReadFile(const char*) override; - - /** Determine the file type. Returns true if the ImageIO can stream read the specified file */ - bool CanStreamRead() override - { - return true; - } - - /** Set the spacing and dimension information for the set filename. */ - void ReadImageInformation() override; - - /** Reads the data from disk into the memory buffer provided. */ - void Read(void* buffer) override; - - /** Determine the file type. Returns true if this ImageIO can read the - * file specified. */ - bool CanWriteFile(const char*) override; - - /** Determine the file type. Returns true if the ImageIO can stream write the specified file */ - bool CanStreamWrite() override - { - return true; - } - - /** Writes the spacing and dimensions of the image. - * Assumes SetFileName has been called with a valid file name. */ - void WriteImageInformation() override; - - /** Writes the data to disk from the memory buffer provided. Make sure - * that the IORegion has been set properly. */ - void Write(const void* buffer) override; - - /** Get the number of overviews available into the file specified - * This imageIO didn't support overviews */ - unsigned int GetOverviewsCount() override - { - // MANTIS-1154: Source image is always considered as the best - // resolution overview. - return 1; - } - - /** Get information about overviews available into the file specified - * This imageIO didn't support overviews */ - std::vector<std::string> GetOverviewsInfo() override - { - std::vector<std::string> desc; - return desc; - } - - /** Provide hist about the output container to deal with complex pixel - * type (Not used here) */ - void SetOutputImagePixelType( bool itkNotUsed(isComplexInternalPixelType), - bool itkNotUsed(isVectorImage)) override{} - -protected: - /** Constructor.*/ - TileMapImageIO(); - /** Destructor.*/ - ~TileMapImageIO() override; - - void PrintSelf(std::ostream& os, itk::Indent indent) const override; - /** Read all information on the image*/ - void InternalReadImageInformation(); - /** Write all information on the image*/ - void InternalWriteImageInformation(); - - unsigned int GetActualNumberOfSplitsForWritingCanStreamWrite(unsigned int numberOfRequestedSplits, - const ImageIORegion& pasteRegion) const override; - - ImageIORegion GetSplitRegionForWritingCanStreamWrite(unsigned int ithPiece, - unsigned int numberOfActualSplits, - const ImageIORegion& pasteRegion) const override; - - /** Number of bands of the image*/ - int m_NbBands; - - /** Determines the level of compression for written files. - * Range 0-9; 0 = none, 9 = maximum , default = 4 */ - int m_CompressionLevel; - -private: - /** Struct to save filename & tile associates */ - typedef struct - { - int numTileX; - int numTileY; - double x; - double y; - std::string filename; - } TileNameAndCoordType; - - TileMapImageIO(const Self &) = delete; - void operator =(const Self&) = delete; - - void InternalWrite(double x, double y, const void* buffer); - void BuildFileName(const std::ostringstream& quad, std::ostringstream& filename, bool inCache = true) const; - void FillCacheFaults(void* buffer) const; - int XYToQuadTree(double x, double y, std::ostringstream& quad) const; - int XYToQuadTree2(double x, double y, std::ostringstream& quad) const; - - /** CURL Multi */ - void GenerateTileInfo(double x, double y, int numTileX, int numTileY); - bool CanReadFromCache(const std::string& filename); - void GenerateURL(double x, double y); - void GenerateBuffer(unsigned char * p); - void ReadTile(const std::string& filename, void * buffer); - - std::vector<std::string> m_ListFilename; - std::vector<std::string> m_ListURLs; - std::vector<TileNameAndCoordType> m_ListTiles; - int m_MaxConnect; - - CurlHelperInterface::Pointer m_Curl; - - /** Byte per pixel pixel */ - int m_BytePerPixel; - - /** Tile size (heavily tested for the default 256 only) */ - int m_TileSize; - - /** Resolution depth*/ - int m_Depth; - bool m_UseCache; - std::string m_CacheDirectory; - std::string m_ServerName; - std::string m_FileSuffix; - TileMapAddressingStyle::TileMapAddressingStyle m_AddressMode; - - bool m_FlagWriteImageInformation; - - bool m_FileNameIsServerName; - - typedef otb::ImageRegionTileMapSplitter<2> SplitterType; - SplitterType::Pointer m_TileMapSplitter; -}; - -} // end namespace otb - -#endif // otbTileMapImageIO_h diff --git a/Modules/IO/IOTileMap/include/otbTileMapImageIOFactory.h b/Modules/IO/IOTileMap/include/otbTileMapImageIOFactory.h deleted file mode 100644 index bd0c3e44e8ef2b461209483c83fd9bfacddef7cc..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/include/otbTileMapImageIOFactory.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef otbTileMapImageIOFactory_h -#define otbTileMapImageIOFactory_h - -#include "itkObjectFactoryBase.h" -#include "OTBIOTileMapExport.h" - -namespace otb -{ -/** \class TileMapImageIOFactory - * \deprecated - * \brief Creation of a TileMapImageIO object using object factory. - * - * \ingroup OTBIOTileMap - */ -class OTBIOTileMap_DEPRECATED_EXPORT TileMapImageIOFactory : public itk::ObjectFactoryBase -{ -public: - /** Standard class typedefs. */ - typedef TileMapImageIOFactory Self; - typedef itk::ObjectFactoryBase Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Class methods used to interface with the registered factories. */ - const char* GetITKSourceVersion(void) const override; - const char* GetDescription(void) const override; - - /** Method for class instantiation. */ - itkFactorylessNewMacro(Self); - static TileMapImageIOFactory * FactoryNew() { return new TileMapImageIOFactory; } - - /** Run-time type information (and related methods). */ - itkTypeMacro(TileMapImageIOFactory, itk::ObjectFactoryBase); - - /** Register one factory of this type */ - static void RegisterOneFactory(void) - { - TileMapImageIOFactory::Pointer TileMapFactory = TileMapImageIOFactory::New(); - itk::ObjectFactoryBase::RegisterFactory(TileMapFactory); - } - -protected: - TileMapImageIOFactory(); - ~TileMapImageIOFactory() override; - -private: - TileMapImageIOFactory(const Self &) = delete; - void operator =(const Self&) = delete; - -}; - -} // end namespace otb - -#endif diff --git a/Modules/IO/IOTileMap/include/otbTileMapImageIOHelper.h b/Modules/IO/IOTileMap/include/otbTileMapImageIOHelper.h deleted file mode 100644 index 03e2b36bff43ba0282af30a388a9c9103fd5b0a6..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/include/otbTileMapImageIOHelper.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef otbTileMapImageIOHelper_h -#define otbTileMapImageIOHelper_h - - -#include "itkObject.h" -#include "itkObjectFactory.h" - -#include <string> -#include <sstream> - -#include "OTBIOTileMapExport.h" - -namespace otb -{ - -/** \class TileMapImageIOHelper - * \deprecated - * \brief This class IO TileMapImage - * - * - * \ingroup OTBIOTileMap - */ - -class OTBIOTileMap_DEPRECATED_EXPORT TileMapImageIOHelper: public itk::Object -{ -public: - /** Standard class typedefs. */ - typedef TileMapImageIOHelper Self; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - typedef itk::Object Superclass; - - itkTypeMacro(TileMapImageIOHelper, itk::Object); - itkNewMacro(Self); - - /** Correspondence between depth and scale for the quad tree paradigm*/ - const std::string ConvertDepthToScale(const unsigned int depth) const; - -protected: - TileMapImageIOHelper() {} - ~TileMapImageIOHelper() override {} - -private: - TileMapImageIOHelper(const Self &) = delete; - void operator =(const Self&) = delete; - - -}; // end class TileMapImageIOHelper - -} // end namespace otb - -#endif diff --git a/Modules/IO/IOTileMap/otb-module.cmake b/Modules/IO/IOTileMap/otb-module.cmake deleted file mode 100644 index d08b994a7a1c694f64193d3d169f489faedd26a7..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/otb-module.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set(DOCUMENTATION "This module contains features to read and write TileMap -format images.") - -otb_module(OTBIOTileMap -ENABLE_SHARED - DEPENDS - OTBITK - OTBImageBase - OTBIOGDAL - OTBCommon - OTBCurlAdapters - OTBOSSIMAdapters - - TEST_DEPENDS - OTBTestKernel - OTBProjection - OTBImageIO - OTBTransform - OTBImageManipulation - - DEPRECATED - - DESCRIPTION - "${DOCUMENTATION}" -) diff --git a/Modules/IO/IOTileMap/src/CMakeLists.txt b/Modules/IO/IOTileMap/src/CMakeLists.txt deleted file mode 100644 index 1704719193bf819e513047a0d9d74364f1ac9f84..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/src/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set(OTBIOTileMap_SRC - otbTileMapImageIOFactory.cxx - otbTileMapImageIOHelper.cxx - otbTileMapImageIO.cxx - ) - -add_library(OTBIOTileMap ${OTBIOTileMap_SRC}) -target_link_libraries(OTBIOTileMap - ${OTBIOGDAL_LIBRARIES} - ${OTBImageBase_LIBRARIES} - ${OTBCommon_LIBRARIES} - ${OTBCurlAdapters_LIBRARIES} - - ) - -otb_module_target(OTBIOTileMap) diff --git a/Modules/IO/IOTileMap/src/otbLogo.inc b/Modules/IO/IOTileMap/src/otbLogo.inc deleted file mode 100644 index ea66255df2fa5e51aa98d42a0750bb379db29942..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/src/otbLogo.inc +++ /dev/null @@ -1,651 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -namespace otb { - static const char * kLogoOtb = - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337fedZZXZZXZZX\333\332\326" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\5\5\5T\4\6=" - "\3\4\4\4\4\340\337\333\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\330\327\323KKJ<" - "<:<<;\261\260\255\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\336\335\331\1\1\1\253\10\14n\6\10" - "\"\"!\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\266\265\262\36\36\36" - "\261\261\261UUUmmk\341\340\334\322\321\316\312\312\306\312\312\306\312\312" - "\306\312\312\306\324\323\317\343\342\336\326\325\321\0\0\0\253\11\14Z\5\6" - "FFE\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\264\263\260+++\377\377\377" - "zzz\7\7\6\5\5\5\4\4\4\21\21\21\23\23\23\23\23\23\20\20\20\3\3\3\7\7\7\33" - "\33\32\0\0\0\257\11\15""3\3\4jig\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\250\250\245PPN\13" - "\13\13;;;\377\377\377\311\311\311\300\300\300\343\343\343\372\372\372\377" - "\377\377\377\377\377\377\377\377\377\377\377\370\370\370\337\337\337a``\0" - "\0\0\266\12\16\15\1\1\216\216\213\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\250\247\244++*\20\20\20lll\310\310\310\375" - "\375\375\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377hhh\0" - "\0\0\244\11\14\0\0\0\262\261\256\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\334\333\330\\[Z\14\14\14\202\202\202\361\361\361\371\371\371\273" - "\273\274\246\246\247\377\377\377\277\277\277\206\206\206\257\257\257\351" - "\352\351\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377POO\1\0\0\200\7\12\0\0\0\326\325\321\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\324\323\320211777\333\333\333\324\324\324bbb\15\15\15\0\0\0...\377" - "\377\377\214\214\214\2\2\3\2\2\3\2\2\2>>>\254\254\254\375\375\375\377\377" - "\377\377\377\377\377\377\377766\5\0\0P\4\6\26\26\26\344\343\337\344\343\337" - "\343\342\336\330\327\323\334\333\330\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\327\326\323--,VVV\360\360\360mmm\2\2\2\24\37-2Lo1Jm...\377\377" - "\377\244\244\244\6\11\14Df\2241Kl\26!.\1\1\1""222\322\322\322\377\377\377" - "\377\377\377\35\35\35\0\0\0\0\0\0\12\12\11--,\20\20\17\1\1\1\2\1\1\1\1\1" - "\4\4\4\34\34\34""443llj\314\313\307\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\342\336EEDHHH\342\342\342111\12\17\26""6RxFj\233Fj\2334Nr.." - ".\377\377\377\310\310\310\0\0\0Ab\216Fj\233Fj\233:X\177\20\30\"\11\11\11" - "nnn211\0\0\0\0\0\0\0\0\0\16\2\3j\13\15\250\15\20\275\15\20\306\14\20\303" - "\14\20\266\15\20\237\14\17~\13\15""5\7\10\14\13\13\230\227\224\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\230\230\225\25\25\25\331\331\331&&&\25\40.Be\223" - "Fj\233Fj\233Fj\2334Nr...\377\377\377\364\364\364\4\4\4""0IiFj\233Fj\233B" - "c\220\"2F\2\2\1\0\0\0\0\0\0\0\0\0\12\20\11\36""2\33\16\26\15\0\0\0\24\3\4" - "d\11\13\272\15\21\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\206\14" - "\17\11\5\5\253\252\247\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\33700/\212\212\212IIJ\17\27!Dg\227" - "Fj\233Fj\233Fj\233Fj\2334Nr...\377\377\377\377\377\377BBB\25\37,Fj\2330E" - "c\7\11\14\7\12\16!1F+@]\4\5\10\0\0\0""2V0p\312op\312ob\255`:b7\13\17\11\21" - "\3\3\225\14\17\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20i\12\14$" - "$$\342\341\335\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\323\322\317\2\2\2\223\223\223\3\5\7>^\212Fj\233Fj\233Fj\233" - "Fj\233Fj\2334Nr...\377\377\377\377\377\377\270\271\271\1\1\1\26\37+\5\7\12" - "(<VDf\225Fj\233Fj\2330Hi\0\0\0""9e7p\312op\312op\312op\312ol\300j-H)\6\2" - "\2\222\14\17\313\14\20\313\14\20\313\14\20\313\14\20\302\15\21\16\3\3\251" - "\250\246\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\275\274\271\33\33\33""222!2IFj\233Fj\233Fj\233Fj\233Fj\233Fj\233" - "4Nr...\377\377\377\377\377\377\363\363\363\32\32\31\1\1\1""4NoFj\233Fj\233" - "Fj\233Fj\2333Lm\0\0\0:f8p\312op\312op\312op\312op\312op\312o3S/\12\2\2\255" - "\15\20\313\14\20\313\14\20\313\14\20\313\14\20E\7\10qpn\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\276\275\272\3\3\3\4" - "\6\11?_\213Fj\233Fj\233Fj\233Fj\233Fj\233Fj\2334Nr...\377\377\377\374\373" - "\373FEELKK???\3\5\7#5K;Y\2006Rw\37.B\3\4\5\0\0\0.P,p\312op\312op\312op\312" - "op\312op\312oo\307m\30%\26A\7\10\313\14\20\313\14\20\313\14\20\313\14\20" - "l\11\13TSR\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\226\225\222!0D=\\\207Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233" - "4Nr+++\377\377\377\206\205\205GFF\374\374\374\372\373\372\204\205\204\25" - "\25\25\0\0\0\0\0\0\"#\"EDD\0\0\0\31(\26p\312op\312op\312op\312op\312op\312" - "op\312oK\203I\35\3\4\313\14\20\313\14\20\313\14\20\313\14\20p\11\13SRQ\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337yyv/" - "GhFj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\2337Sz\14\14\14\346\345\345" - ",++\357\356\356\377\377\377\377\377\377\377\377\377\373\373\373\331\331\331" - "\332\332\332\375\376\376\206\205\205\6\3\3\2\2\1d\257ap\312op\312op\312o" - "p\312op\312op\312oP\216N!\3\4\313\14\20\313\14\20\313\14\20\313\14\20Q\10" - "\12fec\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337yxv0IkFj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Df\225\2\3\5SR" - "S\267\266\266\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377qpp<\6\7\34\4\5,H)p\312op\312op\312o" - "p\312op\312op\312o-N,=\5\6\313\14\20\313\14\20\313\14\20\313\14\20\37\5\6" - "\233\232\230\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337~}{-EeFj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233" - "\23\35+/..\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377]\\\\P\6\10\221\14\17\2\1\1>" - "f:p\310np\312op\312oo\307nDr@\2\1\1\213\13\15\313\14\20\313\14\20\313\14" - "\20\254\14\17\4\4\4\323\322\316\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\232\231\227#4MFj\233Fj\233Fj\233Fj\233Fj\233" - "Fj\233Fj\233Fj\233Fj\2335Pv\6\5\6\312\312\312\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377IHH`" - "\7\11\313\14\20\177\14\16\4\1\1\26\"\24""5Y2.M,\17\26\15\3\1\1p\12\14\313" - "\14\20\313\14\20\313\14\20\313\14\20V\10\12DDC\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\315\314\310\23\33" - "'Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233\36.D\37\37" - "\37\345\345\346\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377433p\10\12\313\14\20\313\14\20\250\15\20Y\10\12C" - "\7\10F\7\10h\11\13\260\15\20\313\14\20\313\14\20\313\14\20\313\14\20\261" - "\15\20\7\1\1\256\255\252\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337:::=\\\207Fj\233Fj\233Fj" - "\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Eh\230\26!1\40\40\40\304\304\304" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\40\37\37\200\11\13\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313" - "\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\312\14\20""8\7\10" - "NML\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\226\226\223\34+>Fj\233Fj\233Fj\233F" - "j\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Dh\230\37/D\2\2\3QQQ\256\256\256" - "\344\344\344\361\361\361\335\335\335\247\247\247\11\10\10r\7\11\313\14\20" - "\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313" - "\14\20\313\14\20\313\14\20j\13\15\32\32\31\323\322\316\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\342\341\3359982LpFj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj" - "\233Fj\233Fj\233Fj\233Fj\2339V}\33)<\7\13\20\0\0\1\0\0\0\1\1\2\11\15\23\16" - "\25\36*\4\5\312\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\313" - "\14\20\313\14\20\313\14\20\313\14\20s\14\16\17\16\16\265\264\261\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343" - "\337\344\343\337\344\343\337\344\343\337\344\343\337\312\311\306\31\34\37" - ";Z\203Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233" - "Fj\233Fj\233Dg\227Dg\227Eh\230Ei\232\"-;\4\4\3w\14\16\313\14\20\313\14\20" - "\313\14\20\313\14\20\313\14\20\313\14\20\313\14\20\271\15\21E\11\12\22\22" - "\21\263\262\257\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\263\262\257\24\30\36""8U}Fj\233Fj\233Fj\233Fj\233" - "Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Dg\226\30$4g" - "fd\250\247\244\13\12\12Y\11\13\266\16\21\313\14\20\313\14\20\313\14\20\262" - "\16\21d\12\14\15\3\3>=<\314\313\307\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\274" - "\273\270$%&(<XEi\231Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233Fj\233" - "Fj\233Fj\2339V~\22\31\"}}z\344\343\337\344\343\337\267\266\263876\4\2\2+" - "\5\5A\5\6&\5\6\3\2\2""887\236\236\233\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\331\330\324hhf\23\30\37*?]Ac\220Fj\233" - "Fj\233Fj\233Fj\233Fj\233Fj\233Ei\2324Os\27\"2998\266\265\262\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\305\304\300\224\223\220" - "\210\210\206\232\231\226\313\312\307\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337" - "\344\343\337\316\315\312xwu000\21\30\"\33)<!2H!3J\35,@\24\36,\34\36!YXW\255" - "\254\251\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\331\330\324\270\267\264\250\247\244\247\246\243\263" - "\262\257\314\313\307\344\342\336\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344\343\337\344" - "\343\337\344\343\337\344\343\337\344\343\337"; -} diff --git a/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx b/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx deleted file mode 100644 index cbb4019c6183e839e1c72865cd44805023f67f95..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx +++ /dev/null @@ -1,887 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "otbTileMapImageIO.h" - -#include <cstring> -#include <cmath> - -#include <iostream> -#include <fstream> - - -#include "itksys/SystemTools.hxx" -#include "otbSystem.h" -#include "otbMacro.h" - -#include "otbGDALImageIO.h" - -#include "otbCurlHelper.h" - -#include "otbImageKeywordlist.h" -#include "itkMetaDataObject.h" -#include "otbMetaDataKey.h" - -#include "otbLogo.inc" - -namespace otb -{ - -TileMapImageIO::TileMapImageIO() -{ - // By default set number of dimensions to two. - this->SetNumberOfDimensions(2); - - // By default set pixel type to scalar. - m_PixelType = SCALAR; - - // By default set component type to unsigned char - m_ComponentType = UCHAR; - m_UseCompression = false; - m_CompressionLevel = 4; // Range 0-9; 0 = no file compression, 9 = maximum file compression - - // Set default spacing to one - m_Spacing[0] = 1.0; - m_Spacing[1] = 1.0; - // Set default origin to [0.5 , 0.5] - // (consistency between ImageIO, see Mantis #942) - m_Origin[0] = 0.5; - m_Origin[1] = 0.5; - - m_NbBands = 3; - m_FlagWriteImageInformation = true; - - //Resolution depth - m_Depth = 8; - - m_BytePerPixel = 1; - m_TileSize = 256; - - m_UseCache = false; - m_ServerName = ""; - m_CacheDirectory = "."; - m_FileSuffix = "png"; - m_AddressMode = TileMapAddressingStyle::OSM; - - m_FileNameIsServerName = false; - - // Set maximum of connections to 10 - m_MaxConnect = 10; - - m_Curl = CurlHelper::New(); - - this->AddSupportedWriteExtension(".otb"); - this->AddSupportedWriteExtension(".OTB"); - - this->AddSupportedReadExtension(".otb"); - this->AddSupportedReadExtension(".OTB"); - - m_TileMapSplitter = SplitterType::New(); - - this->UseStreamedWritingOn(); - this->UseStreamedReadingOn(); -} - -TileMapImageIO::~TileMapImageIO() -{ -} - -// Tell only if the file can be read with TileMap. -bool TileMapImageIO::CanReadFile(const char* file) -{ - // First check the extension - if (file == nullptr) - { - itkDebugMacro(<< "No filename specified."); - return false; - } - - std::string filename = file; - std::string::size_type gmPos = filename.rfind(".otb"); - - if ((gmPos != std::string::npos) - && (gmPos == filename.length() - 4)) - { - m_FileNameIsServerName = false; - return true; - } - // Filename is http server - else if (filename.find("http://") == 0 || - filename.find("https://") == 0) - { - m_FileNameIsServerName = true; - // If the url is available - if (m_Curl->TestUrlAvailability(filename)) - { - return true; - } - itkDebugMacro(<< "Url is unavailable."); - } - return false; -} - -// Used to print information about this object -void TileMapImageIO::PrintSelf(std::ostream& os, itk::Indent indent) const -{ - Superclass::PrintSelf(os, indent); - os << indent << "Compression Level : " << m_CompressionLevel << "\n"; -} - -// Read image with TileMap -void TileMapImageIO::Read(void* buffer) -{ - unsigned char * p = static_cast<unsigned char *>(buffer); - if (p == nullptr) - { - itkExceptionMacro(<< "Memory allocation error"); - return; - } - - int totLines = this->GetIORegion().GetSize()[1]; - int totSamples = this->GetIORegion().GetSize()[0]; - int firstLine = this->GetIORegion().GetIndex()[1]; - int firstSample = this->GetIORegion().GetIndex()[0]; - - int nTilesX = (int) ceil(totSamples / static_cast<double>(m_TileSize)) + 1; - int nTilesY = (int) ceil(totLines / static_cast<double>(m_TileSize)) + 1; - - // Clear vectors - m_ListFilename.clear(); - m_ListURLs.clear(); - m_ListTiles.clear(); - - - //Read all the required tiles - for (int numTileY = 0; numTileY < nTilesY; numTileY++) - { - for (int numTileX = 0; numTileX < nTilesX; numTileX++) - { - double xTile = (firstSample + m_TileSize * numTileX) / ((1 << m_Depth) * static_cast<double>(m_TileSize)); - double yTile = (firstLine + m_TileSize * numTileY) / ((1 << m_Depth) * static_cast<double>(m_TileSize)); - - std::string lFilename; - - // Generate Tile filename - this->GenerateTileInfo(xTile, yTile, numTileX, numTileY); - - // Try to read tile from cache - if (!this->CanReadFromCache(m_ListTiles.back().filename)) - { - this->GenerateURL(m_ListTiles.back().x, m_ListTiles.back().y); - m_ListFilename.push_back(m_ListTiles.back().filename); - } - } - } - - m_Curl->RetrieveFileMulti(m_ListURLs, m_ListFilename, m_MaxConnect); - - m_ListURLs.clear(); - - // Generate buffer - this->GenerateBuffer(p); - - otbMsgDevMacro(<< "TileMapImageIO::Read() completed"); -} - -/* - * This method build tile filename - */ -void TileMapImageIO::GenerateTileInfo(double x, double y, int numTileX, int numTileY) -{ - std::ostringstream quad2; - XYToQuadTree2(x, y, quad2); - - std::ostringstream filename; - BuildFileName(quad2, filename); - - // Build tile information - TileNameAndCoordType lTileInfos; - lTileInfos.numTileX = numTileX; - lTileInfos.numTileY = numTileY; - lTileInfos.x = x; - lTileInfos.y = y; - lTileInfos.filename = filename.str(); - - // Add to vector - m_ListTiles.push_back(lTileInfos); -} - -/* - * This method try to read tile from cache - */ -bool TileMapImageIO::CanReadFromCache(const std::string& filename) -{ - // Verify that the file exists and is not a directory - bool fileExists = itksys::SystemTools::FileExists(filename, true); - if (!fileExists) - { - return false; - } - - otb::ImageIOBase::Pointer imageIO; - imageIO = otb::GDALImageIO::New(); - return imageIO->CanReadFile(filename.c_str()); -} - -/* - * This method generate URLs - */ -void TileMapImageIO::GenerateURL(double x, double y) -{ - std::ostringstream urlStream; - - // Google Map - if (m_AddressMode == TileMapAddressingStyle::GM) - { - std::ostringstream quad; - XYToQuadTree(x, y, quad); - - urlStream << m_ServerName; - urlStream << quad.str(); - } - // Open Street Map - else if (m_AddressMode == TileMapAddressingStyle::OSM) - { - urlStream << m_ServerName; - urlStream << m_Depth; - urlStream << "/"; - urlStream << (long int) (((double) x * (1 << m_Depth))); - urlStream << "/"; - urlStream << (long int) (((double) y * (1 << m_Depth))); - urlStream << "." << m_FileSuffix; - } - // Near Map - else if (m_AddressMode == TileMapAddressingStyle::NEARMAP) - { - urlStream << m_ServerName; - urlStream << "hl=en&x="; - urlStream << std::floor(x * (1 << m_Depth)); - urlStream << "&y="; - urlStream << std::floor(y * (1 << m_Depth)); - urlStream << "&z="; - urlStream << m_Depth; - urlStream << "&nml=Vert&s=Ga"; - } - // Local addressing - else if (m_AddressMode == TileMapAddressingStyle::LOCAL) - { - std::ostringstream quad, filename; - XYToQuadTree2(x, y, quad); - BuildFileName(quad, filename, false); - urlStream << m_ServerName; - urlStream << filename.str(); - } - else - { - itkExceptionMacro(<< "TileMapImageIO : Bad addressing Style"); - } - - // Add url to vector - m_ListURLs.push_back(urlStream.str()); -} - -/* - * This method generate the output buffer - */ -void TileMapImageIO::GenerateBuffer(unsigned char *p) -{ - int totLines = this->GetIORegion().GetSize()[1]; - int totSamples = this->GetIORegion().GetSize()[0]; - int firstLine = this->GetIORegion().GetIndex()[1]; - int firstSample = this->GetIORegion().GetIndex()[0]; - int nComponents = this->GetNumberOfComponents(); - - unsigned char * bufferTile = new unsigned char[m_TileSize * m_TileSize * nComponents]; - for (unsigned int currentTile = 0; currentTile < m_ListTiles.size(); currentTile++) - { - - // Read tile from cache - this->ReadTile(m_ListTiles[currentTile].filename, bufferTile); - - int numTileX = m_ListTiles[currentTile].numTileX; - int numTileY = m_ListTiles[currentTile].numTileY; - - for (int tileJ = 0; tileJ < m_TileSize; tileJ++) - { - long int yImageOffset = (long int) (m_TileSize * floor(firstLine / static_cast<double>(m_TileSize)) + m_TileSize * numTileY - firstLine + tileJ); - if ((yImageOffset >= 0) && (yImageOffset < totLines)) - { - long int xImageOffset = (long int) - (m_TileSize * floor(firstSample / static_cast<double>(m_TileSize)) + m_TileSize * numTileX - firstSample); - unsigned char * dst = p + nComponents * (xImageOffset + totSamples * yImageOffset); - unsigned char * src = bufferTile + nComponents * m_TileSize * tileJ; - int size = nComponents * m_TileSize; - - if (xImageOffset < 0) - { - dst -= nComponents * xImageOffset; - src -= nComponents * xImageOffset; - size += nComponents * xImageOffset; - } - if (xImageOffset + m_TileSize > totSamples) - { - size += nComponents * (totSamples - xImageOffset - m_TileSize); - } - if (size > 0) - { - memcpy(dst, src, size); - } - } - } //end of tile copy - } //end of full image copy - delete[] bufferTile; -} - -/* - * This method read tile in the cache - */ -void TileMapImageIO::ReadTile(const std::string& filename, void * buffer) -{ - otbMsgDevMacro(<< "Retrieving " << filename); - unsigned char * bufferCacheFault = nullptr; - - otb::ImageIOBase::Pointer imageIO; - imageIO = otb::GDALImageIO::New(); - - bool lCanRead = imageIO->CanReadFile(filename.c_str()); - - if (lCanRead == true) - { - imageIO->SetFileName(filename); - imageIO->ReadImageInformation(); - itk::ImageIORegion ioRegion(2); - ioRegion.SetIndex(0, 0); - ioRegion.SetIndex(1, 0); - ioRegion.SetSize(0, m_TileSize); - ioRegion.SetSize(1, m_TileSize); - imageIO->SetIORegion(ioRegion); - - imageIO->Read(buffer); - } - else - { - bufferCacheFault = new unsigned char[m_TileSize * m_TileSize * 3]; - FillCacheFaults(bufferCacheFault); - memcpy(buffer, bufferCacheFault, m_TileSize * m_TileSize * 3); - delete [] bufferCacheFault; - } -} - -void TileMapImageIO::BuildFileName(const std::ostringstream& quad, std::ostringstream& filename, bool inCache) const -{ - - int quadsize = quad.str().size(); - std::ostringstream directory; - if (inCache) - { - directory << m_CacheDirectory; - } - //build directory name - int i = 0; - while ((i < 8) && (i < quadsize)) - { - directory << "/"; - directory << (quad.str().c_str())[i]; - ++i; - } - - itksys::SystemTools::MakeDirectory(directory.str()); - - filename << directory.str(); - filename << "/"; - filename << "otb-"; - filename << quad.str(); - filename << "." << m_FileSuffix; - -} - -/* Fill up dhe image information reading the ascii configuration file */ -void TileMapImageIO::ReadImageInformation() -{ - - m_Dimensions[0] = (1 << m_Depth) * m_TileSize; - m_Dimensions[1] = (1 << m_Depth) * m_TileSize; - otbMsgDevMacro(<< "Get Dimensions : x=" << m_Dimensions[0] << " & y=" << m_Dimensions[1]); - - // Default Spacing - m_Spacing[0] = 1; - m_Spacing[1] = 1; - m_Origin[0] = 0.5; - m_Origin[1] = 0.5; - - - if (m_FileName.empty() == true) - { - itkExceptionMacro(<< "TileMap read : empty image file name file."); - } - - if (m_FileName.find("http://") == 0) - { - m_FileNameIsServerName = true; - } - - if (!m_FileNameIsServerName) - { - std::ifstream file(m_FileName, std::ifstream::in); - std::getline(file, m_ServerName); - if (m_ServerName.find("http://") != 0) - { - itkExceptionMacro(<< "Can't read server name from file"); - } - std::getline(file, m_FileSuffix); - std::string mode; - std::getline(file, mode); - switch (atoi(mode.c_str())) - { - case 0: - m_AddressMode = TileMapAddressingStyle::GM; - break; - case 1: - m_AddressMode = TileMapAddressingStyle::OSM; - break; - case 2: - m_AddressMode = TileMapAddressingStyle::NEARMAP; - break; - case 3: - m_AddressMode = TileMapAddressingStyle::LOCAL; - break; - default: - itkExceptionMacro(<< "Addressing style unknown"); - } - - otbMsgDevMacro(<< "File parameters: " << m_ServerName << " " << m_FileSuffix << " " << m_AddressMode); - } - else - { - m_ServerName = m_FileName; - if (m_ServerName.find("http://") != 0) - { - itkExceptionMacro(<< "Can't read server name from file"); - } - std::string osmServer = "http://tile.openstreetmap.org/"; - std::string nmServer = "http://www.nearmap.com/maps/"; - std::string otbServer1 = "http://tile.orfeo-toolbox.org/hillShade/"; - - if (m_ServerName == osmServer) - { - m_FileSuffix = "png"; - m_AddressMode = TileMapAddressingStyle::OSM; - } - else if (m_ServerName == nmServer) - { - m_FileSuffix = "jpg"; - m_AddressMode = TileMapAddressingStyle::NEARMAP; - } - else if (m_ServerName == otbServer1) - { - m_FileSuffix = "jpg"; - m_AddressMode = TileMapAddressingStyle::LOCAL; - } - else - { - m_FileSuffix = "jpg"; - m_AddressMode = TileMapAddressingStyle::GM; - } - - // File suffix and address mode must be set with accessors - otbMsgDevMacro(<< "File parameters: " << m_ServerName << " " << m_FileSuffix << " " << m_AddressMode); - } - - // The OSM tiles are 4 bands png, while HillShade & NearMap are 3 bands jpeg - if (m_AddressMode == TileMapAddressingStyle::OSM) - this->SetNumberOfComponents(4); - else - this->SetNumberOfComponents(3); - - this->SetNumberOfDimensions(2); - this->SetFileTypeToBinary(); - this->SetComponentType(UCHAR); - - ImageKeywordlist otb_kwl; - itk::MetaDataDictionary& dict = this->GetMetaDataDictionary(); - itk::ExposeMetaData<ImageKeywordlist>(dict, - MetaDataKey::OSSIMKeywordlistKey, - otb_kwl); - if( otb_kwl.GetSize() != 0 ) - { - std::ostringstream depth; - depth << this->GetDepth(); - otb_kwl.AddKey("depth", depth.str()); - } - -} - -bool TileMapImageIO::CanWriteFile(const char* name) -{ - // First if filename is provided - if (name == nullptr) - { - itkDebugMacro(<< "No filename specified."); - return false; - } - - // Check for file extension - std::string filename = name; - std::string::size_type gmPos = filename.rfind(".otb"); - if ((gmPos != std::string::npos) - && (gmPos == filename.length() - 3)) - { - return true; - } - return false; -} - -void TileMapImageIO::WriteImageInformation(void) -{ -} - -void TileMapImageIO::Write(const void* buffer) -{ - - const unsigned char * p = static_cast<const unsigned char *>(buffer); - if (p == nullptr) - { - itkExceptionMacro(<< "Memory allocation error"); - return; - } - - if (m_FlagWriteImageInformation == true) - { - this->WriteImageInformation(); - m_FlagWriteImageInformation = false; - } - - int totLines = this->GetIORegion().GetSize()[1]; - int totSamples = this->GetIORegion().GetSize()[0]; - int firstLine = this->GetIORegion().GetIndex()[1]; - int firstSample = this->GetIORegion().GetIndex()[0]; - int originLine = (int) this->GetOrigin(1); - int originSample = (int) this->GetOrigin(0); - int nComponents = this->GetNumberOfComponents(); - - otbMsgDevMacro(<< "TileMapImageIO::Write: Size " << totLines << ", " << totSamples); - otbMsgDevMacro(<< "TileMapImageIO::Write: Index " << firstLine << ", " << firstSample); - otbMsgDevMacro(<< "TileMapImageIO::Write: Origin " << originLine << ", " << originSample); - - otbMsgDevMacro(<< " Image size : " << m_Dimensions[0] << "," << m_Dimensions[1]); - otbMsgDevMacro(<< " Region read (IORegion) : " << this->GetIORegion()); - otbMsgDevMacro(<< " Nb Of Components : " << this->GetNumberOfComponents()); - - otbMsgDevMacro(<< " sizeof(streamsize) : " << sizeof(std::streamsize)); - otbMsgDevMacro(<< " sizeof(streampos) : " << sizeof(std::streampos)); - otbMsgDevMacro(<< " sizeof(streamoff) : " << sizeof(std::streamoff)); - otbMsgDevMacro(<< " sizeof(std::ios::beg) : " << sizeof(std::ios::beg)); - otbMsgDevMacro(<< " sizeof(size_t) : " << sizeof(size_t)); - otbMsgDevMacro(<< " sizeof(unsigned long) : " << sizeof(unsigned long)); - - //Using integer division: - int nTilesX = (originSample + totSamples - 1) / m_TileSize - originSample / m_TileSize + 1; - int nTilesY = (originLine + totLines - 1) / m_TileSize - originLine / m_TileSize + 1; - otbMsgDevMacro(<< "Number of tile to process " << nTilesX << "x" << nTilesY); - - unsigned char * bufferTile = new unsigned char[m_TileSize * m_TileSize * nComponents]; - - //Read all the required tiles - for (int numTileY = 0; numTileY < nTilesY; numTileY++) - { - for (int numTileX = 0; numTileX < nTilesX; numTileX++) - { - - //Set tile buffer to 0 - for (int iInit = 0; iInit < m_TileSize * m_TileSize * nComponents; iInit++) - { - bufferTile[iInit] = 0; - } - - for (int tileJ = 0; tileJ < m_TileSize; tileJ++) - { - long int yImageOffset = (long int) (m_TileSize * floor((originLine + firstLine) / static_cast<double>(m_TileSize)) - + m_TileSize * numTileY - (originLine + firstLine) + tileJ); - if ((yImageOffset >= 0) && (yImageOffset < totLines)) - { - long int xImageOffset = (long int) - (m_TileSize * - floor((originSample + - firstSample) / static_cast<double>(m_TileSize)) + m_TileSize * numTileX - (originSample + firstSample)); - unsigned char * dst = bufferTile + nComponents * m_TileSize * tileJ; - const unsigned char * src = p + nComponents * (xImageOffset + totSamples * yImageOffset); - int size = nComponents * m_TileSize; - if (xImageOffset < 0) - { - src -= nComponents * xImageOffset; - dst -= nComponents * xImageOffset; - size += nComponents * xImageOffset; - } - if (xImageOffset + m_TileSize > totSamples) - { - size += nComponents * (totSamples - xImageOffset - m_TileSize); - } - if (size > 0) - { - memcpy(dst, src, size); - } - - } - } //end of tile copy - - double xTile = (originSample + firstSample + m_TileSize * numTileX) / ((1 << m_Depth) * static_cast<double>(m_TileSize)); - double yTile = (originLine + firstLine + m_TileSize * numTileY) / ((1 << m_Depth) * static_cast<double>(m_TileSize)); - //Write the tile - InternalWrite(xTile, yTile, bufferTile); - - } - } //end of full image copy - - delete[] bufferTile; - - otbMsgDevMacro(<< "TileMapImageIO::Write() completed"); -} - -void TileMapImageIO::InternalWrite(double x, double y, const void* buffer) -{ - std::ostringstream quad; - - otbMsgDevMacro(<< x << ", " << y); - - XYToQuadTree2(x, y, quad); - - std::ostringstream filename; - BuildFileName(quad, filename); - - otb::ImageIOBase::Pointer imageIO; - imageIO = otb::GDALImageIO::New(); - bool lCanWrite = imageIO->CanWriteFile(filename.str().c_str()); - - - if (lCanWrite) - { - itksys::SystemTools::RemoveFile(filename.str()); - - imageIO->CanStreamWrite(); - imageIO->SetNumberOfDimensions(2); - imageIO->SetDimensions(0, m_TileSize); - imageIO->SetDimensions(1, m_TileSize); - imageIO->SetSpacing(0, 1); - imageIO->SetSpacing(1, 1); - imageIO->SetOrigin(0, 0.5); - imageIO->SetOrigin(1, 0.5); - imageIO->SetNumberOfComponents(3); - - vnl_vector<double> axisDirection(2); - - axisDirection[0] = 1; - axisDirection[1] = 0; - imageIO->SetDirection(0, axisDirection); - axisDirection[0] = 0; - axisDirection[1] = 1; - imageIO->SetDirection(1, axisDirection); - - imageIO->SetUseCompression(1); - - imageIO->SetFileName(filename.str()); - imageIO->WriteImageInformation(); - - itk::ImageIORegion ioRegion(2); - for (unsigned int i = 0; i < 2; ++i) - { - ioRegion.SetSize(i, m_TileSize); - ioRegion.SetIndex(i, 0); - } - - imageIO->SetIORegion(ioRegion); - - imageIO->Write(buffer); - } - else - { - itkExceptionMacro(<< "TileMap write : bad file name."); - } - -} - -/** Generate the quadtree address in qrts style */ -int TileMapImageIO::XYToQuadTree(double x, double y, std::ostringstream& quad) const -{ - int lDepth = m_Depth; - while (lDepth--) // (post-decrement) - { - // make sure we only look at fractional part - x -= floor(x); - y -= floor(y); - int quad_index = ((x >= 0.5 ? 1 : 0) + (y >= 0.5 ? 2 : 0)); - - switch (quad_index) - { - case 0: - quad << "q"; - break; - case 1: - quad << "r"; - break; - case 2: - quad << "t"; - break; - case 3: - quad << "s"; - break; - } -// level down - x *= 2; - y *= 2; - } - - return 0; -} - -/** Generate the quadtree address in 0123 style */ -int TileMapImageIO::XYToQuadTree2(double x, double y, std::ostringstream& quad) const -{ - int lDepth = m_Depth; - while (lDepth--) // (post-decrement) - { - // make sure we only look at fractional part - x -= floor(x); - y -= floor(y); - int quad_index = ((x >= 0.5 ? 1 : 0) + (y >= 0.5 ? 2 : 0)); - - switch (quad_index) - { - case 0: - quad << "0"; - break; - case 1: - quad << "1"; - break; - case 2: - quad << "2"; - break; - case 3: - quad << "3"; - break; - } -// level down - x *= 2; - y *= 2; - } - - return 0; -} - -unsigned int -TileMapImageIO::GetActualNumberOfSplitsForWritingCanStreamWrite(unsigned int numberOfRequestedSplits, - const ImageIORegion& pasteRegion) const -{ - typedef itk::ImageRegion<2> RegionType; - RegionType tileMapRegion; - RegionType::IndexType index; - index[0] = this->GetOrigin(0); - index[1] = this->GetOrigin(1); - itk::ImageIORegionAdaptor<2>::Convert(pasteRegion, tileMapRegion, index); - return m_TileMapSplitter->GetNumberOfSplits(tileMapRegion, numberOfRequestedSplits); -} - -itk::ImageIORegion -TileMapImageIO::GetSplitRegionForWritingCanStreamWrite(unsigned int ithPiece, - unsigned int numberOfActualSplits, - const ImageIORegion& pasteRegion) const -{ - typedef itk::ImageRegion<2> RegionType; - RegionType tileMapRegion; - RegionType::IndexType index; - index[0] = this->GetOrigin(0); - index[1] = this->GetOrigin(1); - itk::ImageIORegionAdaptor<2>::Convert(pasteRegion, tileMapRegion, index); - ImageIORegion returnRegion; - itk::ImageIORegionAdaptor<2>::Convert(m_TileMapSplitter->GetSplit(ithPiece, - numberOfActualSplits, - tileMapRegion), returnRegion, index); - return returnRegion; -} - -/** RGB buffer filling when the tile is not found */ -void TileMapImageIO::FillCacheFaults(void* buffer) const -{ - //replicate to make 256x256x3 pixels - for (int line = 0; line < m_TileSize; line++) - { - for (int col = 0; col < m_TileSize/64; col++) - { - memcpy(((unsigned char *) buffer) + line * m_TileSize * 3 + 64 * 3 * col, - kLogoOtb + (line % 64) * 64 * 3, - 64 * 3); - } - } -} - -void TileMapImageIO::SetCacheDirectory(const char* _arg) -{ - if (_arg && (_arg == this->m_CacheDirectory)) - { - return; - } - - if (_arg) - { - // if existing dir, check writable - if ( itksys::SystemTools::FileIsDirectory( _arg ) ) - { - std::ostringstream oss; - oss<<_arg<<"/foo"; - if( itksys::SystemTools::Touch( oss.str(), true ) == false ) - { - itkExceptionMacro( "Error, no write permission in given CacheDirectory "<<_arg<<"."); - } - else - { - itksys::SystemTools::RemoveFile( oss.str() ); - } - } - // if existing file - else if( itksys::SystemTools::FileExists(_arg) == true ) - { - itkExceptionMacro( "Error, given CacheDirectory "<<_arg<<" is an existing file."); - } - // doesn't exist, try to create it - else if( itksys::SystemTools::MakeDirectory( _arg ) == false ) - { - itkExceptionMacro( "Error, no permission to create the given CacheDirectory "<<_arg<<"."); - } - else - { - itksys::SystemTools::RemoveADirectory( _arg ); - } - this->m_CacheDirectory = _arg; - this->m_UseCache = true; - } - else - { - this->m_CacheDirectory = ""; - this->m_UseCache = false; - } - - this->Modified(); -} - -void TileMapImageIO::SetCacheDirectory(const std::string& _arg) -{ - this->SetCacheDirectory(_arg.c_str()); -} - -} // end namespace otb diff --git a/Modules/IO/IOTileMap/src/otbTileMapImageIOFactory.cxx b/Modules/IO/IOTileMap/src/otbTileMapImageIOFactory.cxx deleted file mode 100644 index 8373797676e34d70264f0b6626d4e3622065d3a5..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/src/otbTileMapImageIOFactory.cxx +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "otbTileMapImageIOFactory.h" - -#include "itkCreateObjectFunction.h" -#include "otbTileMapImageIO.h" -#include "itkVersion.h" - -namespace otb -{ - -TileMapImageIOFactory::TileMapImageIOFactory() -{ - this->RegisterOverride("otbImageIOBase", - "otbTileMapImageIO", - "TileMap Image IO", - 1, - itk::CreateObjectFunction<TileMapImageIO>::New()); -} - -TileMapImageIOFactory::~TileMapImageIOFactory() -{ -} - -const char* -TileMapImageIOFactory::GetITKSourceVersion(void) const -{ - return ITK_SOURCE_VERSION; -} - -const char* -TileMapImageIOFactory::GetDescription() const -{ - return "TileMap ImageIO Factory, enabling TileMap image format loading in OTB"; -} - -// Undocumented API used to register during static initialization. -// DO NOT CALL DIRECTLY. - -static bool TileMapImageIOFactoryHasBeenRegistered; - -void TileMapImageIOFactoryRegister__Private(void) -{ - if( ! TileMapImageIOFactoryHasBeenRegistered ) - { - TileMapImageIOFactoryHasBeenRegistered = true; - TileMapImageIOFactory::RegisterOneFactory(); - } -} - -} // end namespace otb diff --git a/Modules/IO/IOTileMap/src/otbTileMapImageIOHelper.cxx b/Modules/IO/IOTileMap/src/otbTileMapImageIOHelper.cxx deleted file mode 100644 index 1eb888aef94c87bb2c171aff1b1f32d50ebee8b7..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/src/otbTileMapImageIOHelper.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "otbTileMapImageIOHelper.h" -namespace otb -{ -/** get scale from depth */ -const std::string TileMapImageIOHelper::ConvertDepthToScale(const unsigned int depth) const -{ - std::string res; - res += "level "; - std::stringstream out; - out << depth; - res += out.str(); - res += " (around 1 : "; - switch (depth) - { - case 1: - res += "222 million)"; - break; - case 2: - res += "111 million)"; - break; - case 3: - res += "55 million)"; - break; - case 4: - res += "28 million"; - break; - case 5: - res += "14 million"; - break; - case 6: - res += "7 million)"; - break; - case 7: - res += "3 million)"; - break; - case 8: - res += "2 million)"; - break; - case 9: - res += "867, 000)"; - break; - case 10: - res += "433, 000)"; - break; - case 11: - res += "217, 000)"; - break; - case 12: - res += "108, 000)"; - break; - case 13: - res += "54, 000)"; - break; - case 14: - res += "27, 000)"; - break; - case 15: - res += "14, 000)"; - break; - case 16: - res += "6, 771)"; - break; - case 17: - res += "3, 385)"; - break; - case 18: - res += "1, 693)"; - break; - default: - res += "222 million)"; - break; - } - return res; -} - -} // end namespace otb diff --git a/Modules/IO/IOTileMap/test/CMakeLists.txt b/Modules/IO/IOTileMap/test/CMakeLists.txt deleted file mode 100644 index 29afb4c7c6b8541f99461ce3397ac0bf975351d1..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/test/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -otb_module_test() - -set(OTBIOTileMapTests -otbIOTileMapTestDriver.cxx -otbTileMapImageIOHelperTest.cxx -otbTileMapImageIOTest.cxx -otbTileMapWriter.cxx -) - -add_executable(otbIOTileMapTestDriver ${OTBIOTileMapTests}) -target_link_libraries(otbIOTileMapTestDriver ${OTBIOTileMap-Test_LIBRARIES}) -otb_module_target_label(otbIOTileMapTestDriver) - -# Tests Declaration - - -otb_add_test(NAME ioTvTileMapImageIOHelperTest COMMAND otbIOTileMapTestDriver - --compare-ascii ${EPSILON_9} ${BASELINE_FILES}/ioTvTileMapImageIOHelperTest.txt - ${TEMP}/ioTvTileMapImageIOHelperTest.txt - otbTileMapImageIOHelperTest - ${TEMP}/ioTvTileMapImageIOHelperTest.txt - ) - -otb_add_test(NAME ioTvTileMapImageIOWeb COMMAND otbIOTileMapTestDriver - otbTileMapImageIOTest - http://tile.openstreetmap.org/ - ${TEMP}/ioTvTileMapImageIOWebOutput.png - ${TEMP} - 1.4835345 43.55968261 13 - ) -set_property(TEST ioTvTileMapImageIOWeb PROPERTY RESOURCE_LOCK web_access) - -otb_add_test(NAME ioTvTileMapImageIOFile COMMAND otbIOTileMapTestDriver - otbTileMapImageIOTest - ${OTB_DATA_ROOT}/Examples/osmfile.otb - ${TEMP}/ioTvTileMapImageIOFileOutput.png - ${TEMP} - 1.4835345 43.55968261 13 - ) -set_property(TEST ioTvTileMapImageIOFile PROPERTY RESOURCE_LOCK web_access) - -#otb_add_test(NAME ioTvTileMapWriter COMMAND otbIOTileMapTestDriver - #otbTileMapWriter - #LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF} - #${OTB_DATA_ROOT}/Input/DEM/srtm_directory - #${TEMP} - #500 # extract index[0] - #500 # extract index[1] - #200 # extract size[0] - #200 # extract size[1] - #) - diff --git a/Modules/IO/IOTileMap/test/otbIOTileMapTestDriver.cxx b/Modules/IO/IOTileMap/test/otbIOTileMapTestDriver.cxx deleted file mode 100644 index 04b39a1ad887d188ba7418cc526694ec1cbafc58..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/test/otbIOTileMapTestDriver.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "otbTestMain.h" - -void RegisterTests() -{ - REGISTER_TEST(otbTileMapImageIOHelperTest); - REGISTER_TEST(otbTileMapImageIOTest); - REGISTER_TEST(otbTileMapWriter); -} diff --git a/Modules/IO/IOTileMap/test/otbTileMapImageIOHelperTest.cxx b/Modules/IO/IOTileMap/test/otbTileMapImageIOHelperTest.cxx deleted file mode 100644 index e6ca622d96906418b0910ab2b0606ba5f9ecf519..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/test/otbTileMapImageIOHelperTest.cxx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <cstdlib> -#include <fstream> -#include "otbTileMapImageIOHelper.h" - - -int otbTileMapImageIOHelperTest(int itkNotUsed(argc), char * argv[]) -{ - otb::TileMapImageIOHelper::Pointer myTileMapImageIOHelper; - myTileMapImageIOHelper = otb::TileMapImageIOHelper::New(); - - char * filename = argv[1]; - std::ofstream file; - file.open(filename); - - for (unsigned int i=0; i < 22; ++i) - { - file << i << ": " << myTileMapImageIOHelper->ConvertDepthToScale(i) << std::endl; - } - - file.close(); - return EXIT_SUCCESS; -} diff --git a/Modules/IO/IOTileMap/test/otbTileMapImageIOTest.cxx b/Modules/IO/IOTileMap/test/otbTileMapImageIOTest.cxx deleted file mode 100644 index f9504941c4fec4ce36f613aeb115d11a42646f10..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/test/otbTileMapImageIOTest.cxx +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -#include "itkRGBPixel.h" -#include "otbImageFileReader.h" -#include "otbTileMapImageIO.h" -#include "otbTileMapTransform.h" -#include "otbInverseSensorModel.h" -#include "otbExtractROI.h" -#include "otbImageFileWriter.h" - -int otbTileMapImageIOTest(int argc, char* argv[]) -{ - - if (argc != 7) - { - std::cout << argv[0] << " <inputFilename> <outputFilename> " - << "<cacheDirectory> <lon> <lat> <depth>" - << std::endl; - - return EXIT_FAILURE; - } - - char * inputFilename = argv[1]; - char * outputFilename = argv[2]; - char * cacheDirectory = argv[3]; - double lon = atof(argv[4]); - double lat = atof(argv[5]); - int depth = atoi(argv[6]); - - typedef itk::RGBPixel<unsigned char> RGBPixelType; - typedef otb::Image<RGBPixelType, 2> ImageType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::TileMapImageIO ImageIOType; - - ImageIOType::Pointer tileIO = ImageIOType::New(); - ReaderType::Pointer readerTile = ReaderType::New(); - tileIO->SetDepth(depth); - tileIO->SetCacheDirectory(cacheDirectory); - readerTile->SetImageIO(tileIO); - readerTile->SetFileName(inputFilename); - readerTile->UpdateOutputInformation(); - - typedef otb::TileMapTransform<otb::TransformDirection::FORWARD> TransformType; - TransformType::Pointer transform = TransformType::New(); - transform->SetDepth(depth); - - typedef itk::Point <double, 2> PointType; - PointType lonLatPoint; - lonLatPoint[0] = lon; - lonLatPoint[1] = lat; - - PointType tilePoint; - tilePoint = transform->TransformPoint(lonLatPoint); - - long int startX = static_cast<long int>(tilePoint[0]); - long int startY = static_cast<long int>(tilePoint[1]); - long int sizeX = 500; - long int sizeY = 500; - - std::cerr << startX << ", " << startY << std::endl; - std::cerr << sizeX << ", " << sizeY << std::endl; - - typedef otb::ExtractROI<RGBPixelType, RGBPixelType> ExtractROIFilterType; - ExtractROIFilterType::Pointer extractROIOsmFilter = ExtractROIFilterType::New(); - extractROIOsmFilter->SetStartX(startX - sizeX / 2); - extractROIOsmFilter->SetStartY(startY - sizeY / 2); - extractROIOsmFilter->SetSizeX(sizeX); - extractROIOsmFilter->SetSizeY(sizeY); - - extractROIOsmFilter->SetInput(readerTile->GetOutput()); - - typedef otb::ImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetFileName(outputFilename); - writer->SetInput(extractROIOsmFilter->GetOutput()); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/Modules/IO/IOTileMap/test/otbTileMapWriter.cxx b/Modules/IO/IOTileMap/test/otbTileMapWriter.cxx deleted file mode 100644 index 53ca823b15a7a1ec36ebb6c69f042a9cc150b5de..0000000000000000000000000000000000000000 --- a/Modules/IO/IOTileMap/test/otbTileMapWriter.cxx +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include "itkRGBPixel.h" -#include "otbTileMapTransform.h" -#include "otbOrthoRectificationFilter.h" -#include "otbImageFileReader.h" -#include "otbImageFileWriter.h" -#include "itkPoint.h" -#include "otbTileMapImageIO.h" -#include "itkRescaleIntensityImageFilter.h" -#include "otbPerBandVectorImageFilter.h" -#include "otbPrintableImageFilter.h" - -int otbTileMapWriter(int argc, char *argv[]) -{ - if (argc != 4 && argc != 8) - { - std::cerr << "Usage: " << argv[0] - << "<image> <SRTM directory> <output directory> <extract star index X (optional)> <extract star index Y(optional)> <extract star index X(optional)> <extract star index Y(optional)>" << std::endl; - return EXIT_FAILURE; - - } - - int depth = 14; - - typedef otb::Image<unsigned int, 2> ImageType; - typedef otb::Image<double, 2> DoubleImageType; - - typedef otb::VectorImage<unsigned int, 2> VectorImageType; - typedef otb::VectorImage<unsigned char, 2> CharVectorImageType; - typedef otb::VectorImage<double, 2> DoubleVectorImageType; - - typedef otb::ImageFileReader<VectorImageType> VectorReaderType; - VectorReaderType::Pointer readerXS = VectorReaderType::New(); - readerXS->SetFileName(argv[1]); - - typedef otb::TileMapTransform<otb::TransformDirection::INVERSE> MapProjectionType; - typedef otb::OrthoRectificationFilter - <ImageType, DoubleImageType, MapProjectionType> OrthoRectifFilterType; - typedef otb::ImageFileWriter<CharVectorImageType> WriterType; - - otb::DEMHandler::Instance()->OpenDEMDirectory(argv[2]); - - MapProjectionType::Pointer mapProjection = MapProjectionType::New(); - mapProjection->SetLevel(depth); - - ImageType::IndexType start; - start[0] = 0; - start[1] = 0; - - ImageType::SizeType size; - size[0] = 2000; - size[1] = 2000; - - ImageType::SpacingType spacing; - spacing[0] = 1; - spacing[1] = 1; - - typedef itk::Point <double, 2> PointType; - PointType lonLatUL; -// lonLatUL[0] = 103.843; //Sentosa -// lonLatUL[1] = 1.23037; -// lonLatUL[1] = 1.30164; //Tests pour matching google (Orchard Road) -// lonLatUL[0] = 103.838; -// lonLatUL[1] = 1.35610168284995; //Tests streaming (coin UL) -// lonLatUL[0] = 103.760262770741; -// lonLatUL[1] = 43.5596826111; //Tests Toulouse -// lonLatUL[0] = 1.4835345; -// lonLatUL[0] = -68.1; //Tests LaPaz -// lonLatUL[1] = -16.5; - lonLatUL[0] = 51.15; //Tests Iran spot5 - lonLatUL[1] = 35.9; - - typedef otb::TileMapTransform<otb::TransformDirection::FORWARD> MapProjectionForwardType; - MapProjectionForwardType::Pointer mapProjectionForward = MapProjectionForwardType::New(); - mapProjectionForward->SetLevel(depth); - PointType pointULexact; - pointULexact = mapProjectionForward->TransformPoint(lonLatUL); - - PointType pointLRexact; - pointLRexact[0] = pointULexact[0] + size[0] * spacing[0]; - pointLRexact[1] = pointULexact[1] + size[1] * spacing[1]; - - PointType lonLatLR; - lonLatLR = mapProjection->TransformPoint(pointLRexact); - - typedef otb::PerBandVectorImageFilter<VectorImageType, - DoubleVectorImageType, OrthoRectifFilterType> VectorOrthoRectifFilterType; - - OrthoRectifFilterType::Pointer orthoRectifXS = - OrthoRectifFilterType::New(); - VectorOrthoRectifFilterType::Pointer orthoRectifXSVector = - VectorOrthoRectifFilterType::New(); - orthoRectifXSVector->SetFilter(orthoRectifXS); - - orthoRectifXS->SetMapProjection(mapProjection); - - orthoRectifXSVector->SetInput(readerXS->GetOutput()); - - orthoRectifXS->SetOutputStartIndex(start); - orthoRectifXS->SetOutputSize(size); - orthoRectifXS->SetOutputSpacing(spacing); - orthoRectifXS->SetOutputOrigin(pointULexact); - - typedef otb::MultiChannelExtractROI<DoubleVectorImageType::InternalPixelType, DoubleVectorImageType::InternalPixelType> ExtractorType; - ExtractorType::Pointer extractor = ExtractorType::New(); - - typedef otb::PrintableImageFilter<DoubleVectorImageType> PrintableImageFilterType; - PrintableImageFilterType::Pointer printable = PrintableImageFilterType::New(); - printable->SetChannel(1); - printable->SetChannel(2); - printable->SetChannel(3); - - if(argc==8) - { - extractor->SetStartX(atoi(argv[4])); - extractor->SetStartY(atoi(argv[5])); - extractor->SetSizeX(atoi(argv[6])); - extractor->SetSizeY(atoi(argv[7])); - extractor->SetInput(orthoRectifXSVector->GetOutput()); - - printable->SetInput(extractor->GetOutput()); - - } - else - { - printable->SetInput(orthoRectifXSVector->GetOutput()); - } - - - typedef otb::ImageRegionTileMapSplitter<2> SplitterType; - SplitterType::Pointer splitter = SplitterType::New(); - - typedef otb::TileMapImageIO ImageIOType; - ImageIOType::Pointer tileMapIO = ImageIOType::New(); - tileMapIO->SetDepth(depth); - tileMapIO->SetCacheDirectory(argv[3]); - tileMapIO->SetFileSuffix("jpg"); - - WriterType::Pointer writer = WriterType::New(); - writer->SetFileName("test.otb"); - writer->SetImageIO(tileMapIO); - writer->SetNumberOfThreads(1); - writer->SetInput(printable->GetOutput()); - - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/Modules/IO/ImageIO/otb-module.cmake b/Modules/IO/ImageIO/otb-module.cmake index 7692218a57663cd19956628b787b34f827173a4d..0d4085613d2c8b266700d946ce912961627debb1 100644 --- a/Modules/IO/ImageIO/otb-module.cmake +++ b/Modules/IO/ImageIO/otb-module.cmake @@ -39,9 +39,6 @@ otb_module(OTBImageIO OTBObjectList OTBStreaming - OPTIONAL_DEPENDS - OTBIOTileMap #This module is deprecated - TEST_DEPENDS OTBStatistics OTBTestKernel diff --git a/Modules/IO/ImageIO/src/CMakeLists.txt b/Modules/IO/ImageIO/src/CMakeLists.txt index e1e43c6579ecc595913b414efab2f8f6679e2b04..1ff8a6aebbe39989916ce81a94496523eb0057cb 100644 --- a/Modules/IO/ImageIO/src/CMakeLists.txt +++ b/Modules/IO/ImageIO/src/CMakeLists.txt @@ -37,8 +37,6 @@ target_link_libraries(OTBImageIO ${OTBCommon_LIBRARIES} ${OTBExtendedFilename_LIBRARIES} ${OTBOSSIMAdapters_LIBRARIES} - #Deprecated modules - ${OTBIOTileMap_LIBRARIES} ) diff --git a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx index 664fd51b85b2126f749296874d8c29998296c34e..57a55219c81fd6a766d3156b84c8ebad7078bc14 100644 --- a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx +++ b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx @@ -33,10 +33,6 @@ #include "otbBSQImageIOFactory.h" #include "otbRADImageIOFactory.h" -#if OTB_USE_DEPRECATED -#include "otbTileMapImageIOFactory.h" -#endif - namespace otb { @@ -100,9 +96,6 @@ ImageIOFactory::RegisterBuiltInFactories() itk::ObjectFactoryBase::RegisterFactory(GDALImageIOFactory::New()); itk::ObjectFactoryBase::RegisterFactory(ONERAImageIOFactory::New()); itk::ObjectFactoryBase::RegisterFactory(MSTARImageIOFactory::New()); -#if OTB_USE_DEPRECATED - itk::ObjectFactoryBase::RegisterFactory(TileMapImageIOFactory::New()); -#endif firstTime = false; } } diff --git a/Modules/IO/ImageIO/test/CMakeLists.txt b/Modules/IO/ImageIO/test/CMakeLists.txt index d9c01a09d810355b0aff9405302cc69032845b27..4e4ce8361b5a6b4fd7339810e4c4076f97d7bec3 100644 --- a/Modules/IO/ImageIO/test/CMakeLists.txt +++ b/Modules/IO/ImageIO/test/CMakeLists.txt @@ -77,10 +77,6 @@ otbMultiImageFileWriterTest.cxx otbWriteGeomFile.cxx ) -if(OTB_USE_DEPRECATED) - set(OTBImageIOTests ${OTBImageIOTests} otbImageFileReaderServerName.cxx) -endif() - add_executable(otbImageIOTestDriver ${OTBImageIOTests}) target_link_libraries(otbImageIOTestDriver ${OTBImageIO-Test_LIBRARIES}) otb_module_target_label(otbImageIOTestDriver) @@ -522,19 +518,6 @@ otb_add_test(NAME ioTvONERAImageFileWriterComplex COMMAND otbImageIOTestDriver LARGEINPUT{ONERA/spa3_0215_rad.ent} ${TEMP}/ioImageFileReaderONERAComplexWrite.ent ) -if(OTB_USE_DEPRECATED) - otb_add_test(NAME ioTvImageFileReaderServerNameOTBTest COMMAND otbImageIOTestDriver - otbImageFileReaderServerName - ${OTB_DATA_ROOT}/Examples/osmfile.otb) - set_property(TEST ioTvImageFileReaderServerNameOTBTest PROPERTY RESOURCE_LOCK web_access) -endif() - -#dashboard_hell -# otb_add_test(NAME ioTvImageFileReaderServerNameHTTPTest COMMAND otbImageIOTestDriver -# otbImageFileReaderServerName -# http://tile.openstreetmap.org/) -# set_property(TEST ioTvImageFileReaderServerNameHTTPTest PROPERTY RESOURCE_LOCK web_access) - otb_add_test(NAME ioTvPipelineMetadataHandlingTest COMMAND otbImageIOTestDriver --compare-metadata ${EPSILON_9} ${INPUTDATA}/HFAGeoreferenced.img diff --git a/Modules/IO/ImageIO/test/otbImageFileReaderServerName.cxx b/Modules/IO/ImageIO/test/otbImageFileReaderServerName.cxx deleted file mode 100644 index c7bb4c2b1774c2c62199f7e3d6a45d860e8dd99a..0000000000000000000000000000000000000000 --- a/Modules/IO/ImageIO/test/otbImageFileReaderServerName.cxx +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - - -#include "otbImage.h" -#include "itkMacro.h" -#include <iostream> - -#include "otbImageFileReader.h" - -int otbImageFileReaderServerName(int itkNotUsed(argc), char* argv[]) -{ - // Verify the number of parameters in the command line - const char * inputFilename = argv[1]; - - typedef unsigned char InputPixelType; - const unsigned int Dimension = 2; - - typedef otb::Image<InputPixelType, Dimension> InputImageType; - typedef otb::ImageFileReader<InputImageType> ReaderType; - - ReaderType::Pointer reader = ReaderType::New(); - - reader->SetFileName(inputFilename); - - reader->GenerateOutputInformation(); - - if (reader->GetOutput()->GetImageKeywordlist().GetSize() == 0) - { - std::cerr << "Error: Keyword list is empty " << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} diff --git a/Modules/IO/ImageIO/test/otbImageIOTestDriver.cxx b/Modules/IO/ImageIO/test/otbImageIOTestDriver.cxx index d92b29cfd41761023e98370683bf15e51ce719a5..fc2c0f51e2429123a268edeed58036ef55ef7cd6 100644 --- a/Modules/IO/ImageIO/test/otbImageIOTestDriver.cxx +++ b/Modules/IO/ImageIO/test/otbImageIOTestDriver.cxx @@ -152,7 +152,4 @@ void RegisterTests() REGISTER_TEST(otbImageFileWriterOptBandTest); REGISTER_TEST(otbMultiImageFileWriterTest); REGISTER_TEST(otbWriteGeomFile); -#if OTB_USE_DEPRECATED - REGISTER_TEST(otbImageFileReaderServerName); -#endif } diff --git a/Modules/ThirdParty/Mapnik/CMakeLists.txt b/Modules/ThirdParty/Mapnik/CMakeLists.txt deleted file mode 100644 index 96ec047a42f1060e8602c1c4f4fcc70c8b33190d..0000000000000000000000000000000000000000 --- a/Modules/ThirdParty/Mapnik/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -project(OTBMapnik) - -set(OTBMapnik_SYSTEM_INCLUDE_DIRS - ${MAPNIK_INCLUDE_DIRS} - ${ICUUC_INCLUDE_DIRS} - ${LTDL_INCLUDE_DIRS} - ${FREETYPE_INCLUDE_DIRS} - ${AGG_INCLUDE_DIRS} - ) - -set(OTBMapnik_LIBRARIES - ${MAPNIK_LIBRARIES} - ${ICUUC_LIBRARIES} - ${LTDL_LIBRARIES} - ${FREETYPE_LIBRARIES} - ) - -otb_module_impl() diff --git a/Modules/ThirdParty/Mapnik/otb-module-init.cmake b/Modules/ThirdParty/Mapnik/otb-module-init.cmake deleted file mode 100644 index 54d5bb900c806357069e89742ad3875cd82f80ff..0000000000000000000000000000000000000000 --- a/Modules/ThirdParty/Mapnik/otb-module-init.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -find_package ( LTDL REQUIRED ) -find_package ( ICUUC REQUIRED ) -find_package ( Agg REQUIRED ) -find_package ( Freetype REQUIRED ) -find_package ( Mapnik REQUIRED ) diff --git a/Modules/ThirdParty/Mapnik/otb-module.cmake b/Modules/ThirdParty/Mapnik/otb-module.cmake deleted file mode 100644 index dc2bb04a0f17bb6321363664618bd9af83ed5dd2..0000000000000000000000000000000000000000 --- a/Modules/ThirdParty/Mapnik/otb-module.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set(DOCUMENTATION "This module imports Mapnik to the build system") - -otb_module(OTBMapnik - DEPENDS - - TEST_DEPENDS - - DEPRECATED - - DESCRIPTION - "${DOCUMENTATION}" - ) - -otb_module_activation_option("Enable Mapnik dependent modules" OFF) diff --git a/NOTICE b/NOTICE index 543e30708cdfb858149731f4546c40869629970e..8d9eaf1b406f447afb06a24c185757711965e45b 100644 --- a/NOTICE +++ b/NOTICE @@ -141,13 +141,6 @@ This software includes code from the libkml project. https://github.com/google/libkml/blob/master/LICENSE -This software includes code from the Mapnik project. - Copyright (c) 2015, Artem Pavlenko - http://mapnik.org/ - Mapnik is released under GNU LGPL v2.1 license: - http://mapnik.org/pages/license.html - - This software includes code from the MuParser project. Copyright (c) 2011-2016, Ingo Berg https://github.com/beltoforion/muparser diff --git a/SuperBuild/CMake/External_otb.cmake b/SuperBuild/CMake/External_otb.cmake index 987f301a165564e91a32b052263f54e227ac395a..66aa92000b082ba042fc65ec6b0c9f584bc24c45 100644 --- a/SuperBuild/CMake/External_otb.cmake +++ b/SuperBuild/CMake/External_otb.cmake @@ -199,7 +199,6 @@ ExternalProject_Add(OTB -DOTB_USE_CURL:BOOL=${OTB_USE_CURL} -DOTB_USE_LIBKML:BOOL=${OTB_USE_LIBKML} -DOTB_USE_LIBSVM:BOOL=${OTB_USE_LIBSVM} - -DOTB_USE_MAPNIK:BOOL=${OTB_USE_MAPNIK} -DOTB_USE_MUPARSER:BOOL=${OTB_USE_MUPARSER} -DOTB_USE_MUPARSERX:BOOL=${OTB_USE_MUPARSERX} -DOTB_USE_OPENCV:BOOL=${OTB_USE_OPENCV} diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 9e72344d39c0c893f497dc02014010a538ba4b67..6a09279c823c5a3115de232dbae1a2e93b0a5e4d 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -308,7 +308,6 @@ else() option(OTB_USE_LIBKML "Enable module libKML in OTB" ON) endif() option(OTB_USE_LIBSVM "Enable module libSVM in OTB" ON) -option(OTB_USE_MAPNIK "Enable module Mapnik in OTB" OFF) option(OTB_USE_MUPARSER "Enable module muparser in OTB" ON) option(OTB_USE_MUPARSERX "Enable module muparserX in OTB" ON) option(OTB_USE_OPENCV "Enable module OpenCV in OTB" ON)