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/Cookbook/Scripts/otb_warnings.py b/Documentation/Cookbook/Scripts/otb_warnings.py index 34566d2d851a6547ef50cf71f0d613ce4934987e..61af6ff2b244b165f964632f6dc595ede845979d 100644 --- a/Documentation/Cookbook/Scripts/otb_warnings.py +++ b/Documentation/Cookbook/Scripts/otb_warnings.py @@ -18,17 +18,6 @@ def parameter_warnings(app_warn, app, key): if "." in name: warn("name contains a special character (.)") - # disabled because there are so many for now - #if description == "": - #warn("missing description") - - # disabled because there are so many for now - #if len(description) > 0 and description[-1] != ".": - #warn("description does not end with a period") - - if len(description) > 0 and " :" in description: - warn("description has a space before a colon") - def application_documentation_warnings(app): "Emit warnings about application documentation" @@ -38,16 +27,9 @@ def application_documentation_warnings(app): description = app.GetDescription() longdescription = app.GetDocLongDescription() - # disable because there are so many for now - #if not longdescription[-1] == ".": - #warn("Application Long Description does not end with a period (.)") - if re.search("\\n [a-zA-Z]", longdescription): warn("Application Long Description contains '\\n ' pattern (usually not intended)") - if " :" in longdescription: - warn("Application Long Description has a space before a colon") - if app.GetNumberOfExamples() == 0: warn("Application has no examples") diff --git a/Documentation/Cookbook/rst/AdvancedUse.rst b/Documentation/Cookbook/rst/AdvancedUse.rst index 09d3d6cb80c599a57fcb6e4b3b8c8c440f54a006..d3c436edfe24ab5ca026b594f11ea25c40c37027 100644 --- a/Documentation/Cookbook/rst/AdvancedUse.rst +++ b/Documentation/Cookbook/rst/AdvancedUse.rst @@ -396,10 +396,10 @@ Some examples are provided below: :: - $ otbcli_Convert -in OTB-Data/Examples/QB_1_ortho.tif -out "/tmp/example1.tif?&gdal:co:TILED=YES&gdal:co:COMPRESS=DEFLATE" + $ otbcli_DynamicConvert -in OTB-Data/Examples/QB_1_ortho.tif -out "/tmp/example1.tif?&gdal:co:TILED=YES&gdal:co:COMPRESS=DEFLATE" - Process only first band from a file :: - $ otbcli_Convert -in "OTB-Data/Examples/QB_1_ortho.tif?&bands=1" -out /tmp/example2.tif + $ otbcli_DynamicConvert -in "OTB-Data/Examples/QB_1_ortho.tif?&bands=1" -out /tmp/example2.tif diff --git a/Documentation/Cookbook/rst/OTB-Applications.rst b/Documentation/Cookbook/rst/OTB-Applications.rst index 585c1aa93ce937096d213cbd857b213c74ad3b3a..45ffa46e87f12388756a1e077ce92c5605b501a7 100644 --- a/Documentation/Cookbook/rst/OTB-Applications.rst +++ b/Documentation/Cookbook/rst/OTB-Applications.rst @@ -33,9 +33,9 @@ The complete list of applications is described in the Chapter :ref:`apprefdoc`. All standard applications share the same implementation and automatically expose generated interfaces. However they are accessed in a slightly different way: the command-line interface is prefixed by ``otbcli_``, while the Qt interface is prefixed by -``otbgui_``. For cwinstance, calling ``otbcli_Convert`` will launch the -command-line interface of the Convert application, while -``otbgui_Convert`` will launch the GUI. +``otbgui_``. For instance, calling ``otbcli_DynamicConvert`` will launch the +command-line interface of the DynamicConvert application, while +``otbgui_DynamicConvert`` will launch the GUI. Command-line launcher --------------------- 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 c660a15789af5ce3bb99ecd4bea3a6c6956889d9..b4ad2a3145da54529041519df2f1632c8fe07d50 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/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx b/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx index 27813b1dde4fd4658e1d5cfd1baf0a34ce4b469a..339c94e979845de6becd9877b2f0f994e0da7401 100644 --- a/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx +++ b/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx @@ -55,12 +55,13 @@ private: " algorithm.\n\n" "The MAD algorithm produces a set of N change maps (where N is the" " maximum number of bands in first and second input images), with the" - " following properties:\n" - " - Change maps are differences of a pair of linear combinations of " + " following properties:\n\n" + + "* Change maps are differences of a pair of linear combinations of " " bands from image 1 and bands from image 2 chosen to maximize the " " correlation, \n" - " - Each change map is orthogonal to the others.\n" - " \n" + "* Each change map is orthogonal to the others.\n\n" + "This is a statistical method which can handle different modalities" " and even different bands and number of bands between images. \n" " \n" diff --git a/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx b/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx index 970814f0720562547f6bd77ce209311c5cda35d0..3a7c64aa3aa41658ea475b51dd345e9b0c9b3c4b 100644 --- a/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx +++ b/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx @@ -134,7 +134,7 @@ private: void DoUpdateParameters() override { - // Nothing to do here : all parameters are independent + // Nothing to do here: all parameters are independent } void DoExecute() override diff --git a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx index d0a57ffa4bc7d86b704921e2d1e2f1d27301d817..7f77cb9893ab22289cb411c849a21523f55907b8 100644 --- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx @@ -256,7 +256,7 @@ protected: GetInternalApplication("training")->SetParameterString("io.out", modelFileName); ExecuteInternal( "training" ); - otbAppLogINFO("output model : " << GetInternalApplication("training")->GetParameterString("io.out")); + otbAppLogINFO("output model: " << GetInternalApplication("training")->GetParameterString("io.out")); } void ComputeImageStatistics( ImageBaseType * img, @@ -267,7 +267,7 @@ protected: GetInternalApplication("imgstats")->SetParameterString("out", imagesStatsFileName); ExecuteInternal( "imgstats" ); - otbAppLogINFO("image statistics file : " << GetInternalApplication("imgstats")->GetParameterString("out")); + otbAppLogINFO("image statistics file: " << GetInternalApplication("imgstats")->GetParameterString("out")); } @@ -288,7 +288,7 @@ protected: std::ifstream infile(modelFileName); if(!infile) { - itkExceptionMacro(<< "File : " << modelFileName << " couldn't be opened"); + itkExceptionMacro(<< "File: " << modelFileName << " couldn't be opened"); } // get the line with the centroids (starts with "2 ") @@ -327,7 +327,7 @@ protected: class KMeansFileNamesHandler { - public : + public: KMeansFileNamesHandler(const std::string &outPath) { tmpVectorFile = outPath + "_imgEnvelope.shp"; @@ -403,21 +403,21 @@ private: SetDescription("Unsupervised KMeans image classification"); SetDocName("Unsupervised KMeans image classification"); - SetDocLongDescription("Performs unsupervised KMeans image classification." - "KMeansClassification is a composite application, " - "using an existing training and classification application." - "The SharkKMeans model is used.\n" - "KMeansClassification application is only available if OTB is compiled with Shark support" - "(CMake option OTB_USE_SHARK=ON)\n" - "The steps of this composite application :\n" - "1) ImageEnveloppe : create a shapefile (1 polygon),\n" - "2) PolygonClassStatistics : compute the statistics,\n" - "3) SampleSelection : select the samples by constant strategy in the shapefile " + SetDocLongDescription("Unsupervised KMeans image classification. " + "This is a composite application, using existing training and classification applications. " + "The SharkKMeans model is used.\n\n" + "This application is only available if OTB is compiled with Shark support" + "(CMake option :code:`OTB_USE_SHARK=ON`).\n\n" + + "The steps of this composite application:\n\n" + "1) ImageEnvelope: create a shapefile (1 polygon),\n" + "2) PolygonClassStatistics: compute the statistics,\n" + "3) SampleSelection: select the samples by constant strategy in the shapefile " "(1000000 samples max),\n" - "4) SamplesExtraction : extract the samples descriptors (update of SampleSelection output file),\n" - "5) ComputeImagesStatistics : compute images second order statistics,\n" - "6) TrainVectorClassifier : train the SharkKMeans model,\n" - "7) ImageClassifier : performs the classification of the input image " + "4) SampleExtraction: extract the samples descriptors (update of SampleSelection output file),\n" + "5) ComputeImagesStatistics: compute images second order statistics,\n" + "6) TrainVectorClassifier: train the SharkKMeans model,\n" + "7) ImageClassifier: perform the classification of the input image " "according to a model file.\n\n" "It's possible to choice random/periodic modes of the SampleSelection application.\n" "If you want keep the temporary files (sample selected, model file, ...), " @@ -426,8 +426,8 @@ private: SetDocLimitations("The application doesn't support NaN in the input image"); SetDocAuthors("OTB-Team"); - SetDocSeeAlso("ImageEnveloppe PolygonClassStatistics SampleSelection SamplesExtraction " - "PolygonClassStatistics TrainVectorClassifier ImageClassifier\n" + SetDocSeeAlso("ImageEnvelope, PolygonClassStatistics, SampleSelection, SampleExtraction, " + "PolygonClassStatistics, TrainVectorClassifier, ImageClassifier.\n\n" "[1] http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/algorithms/kmeans.html"); AddDocTag(Tags::Learning); diff --git a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx index ac4b60b7bfd1214655e224a2ddcef8ff4c5141f5..981f4f346821763850fdcc139035e35375ce36e7 100644 --- a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx +++ b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx @@ -70,44 +70,45 @@ private: "PolygonClassStatistics. The statistics file is then used to compute the " "sampling rates for each class in each image. Several types of sampling " " are implemented. Each one is a combination of a mono-image strategy " - "and a multi-image mode. The mono-image strategies are :\n\n" - " * smallest (default) : select the same number of sample in each " + "and a multi-image mode. The mono-image strategies are:\n\n" + + "* smallest (default): select the same number of sample in each " "class so that the smallest one is fully sampled.\n" - " * constant : select the same number of samples N in each class " + "* constant: select the same number of samples N in each class " "(with N below or equal to the size of the smallest class).\n" - " * byclass : set the required number for each class manually, with an " + "* byclass: set the required number for each class manually, with an " "input CSV file (first column is class name, second one is the required " "samples number).\n\n" "The multi-image modes (mim) are proportional, equal and custom. The custom " "mode lets the users choose the distribution of samples among the " "images. The different behaviours are described below. Ti(c) and Ni(c) " " refers resp. to the total number and needed number of samples in " - "image i for class c. Let's call L the total number of images.\n" - " * strategy = all\n\n" - " - Same behaviour for all modes : take all samples\n\n" - " * strategy = constant :" + "image i for class c. Let's call L the total number of images.\n\n" + "* strategy = all\n\n" + " - Same behaviour for all modes: take all samples\n\n" + "* strategy = constant:" " let's call M the global number of samples required per class." " For each image i and each class c:\n\n" " - if mim = proportional, then Ni( c ) = M * Ti( c ) / sum_k( Tk(c) )\n\n" " - if mim = equal , then Ni( c ) = M / L\n\n" " - if mim = custom , then Ni( c ) = Mi where Mi is the custom requested number of samples for image i\n\n" - " * strategy = byClass :" + "* strategy = byClass :" " let's call M(c) the global number of samples for class c)." " For each image i and each class c:\n\n" " - if mim = proportional, then Ni( c ) = M(c) * Ti( c ) / sum_k( Tk(c) )\n\n" " - if mim = equal , then Ni( c ) = M(c) / L\n\n" " - if mim = custom , then Ni( c ) = Mi(c) where Mi(c) is the custom requested number of samples for image i and class c\n\n" - " * strategy = percent :" + "* strategy = percent :" " For each image i and each class c:\n\n" " - if mim = proportional, then Ni( c ) = p * Ti( c ) where p is the global percentage of samples\n\n" " - if mim = equal , then Ni( c ) = p * sum_k(Tk(c)]/L where p is the global percentage of samples\n\n" " - if mim = custom , then Ni( c ) = p(i) * Ti(c) where p(i) is the percentage of samples for image i. c\n\n" - " * strategy = total :" + "* strategy = total :" " For each image i and each class c:\n\n" " - if mim = proportional, then Ni( c ) = total * (sum_k(Ti(k))/sum_kl(Tl(k))) * (Ti(c)/sum_k(Ti(k))) where total is the total number of samples specified.\n\n" " - if mim = equal , then Ni( c ) = (total / L) * (Ti(c)/sum_k(Ti(k))) where total is the total number of samples specified.\n\n" " - if mim = custom , then Ni( c ) = total(i) * (Ti(c)/sum_k(Ti(k))) where total(i) is the total number of samples specified for image i. \n\n" - " * strategy = smallest class\n\n" + "* strategy = smallest class\n\n" " - if mim = proportional, then the smallest class size (computed globally) is used for the strategy constant+proportional.\n\n" " - if mim = equal , then the smallest class size (computed globally) is used for the strategy constant+equal.\n\n" " - if mim = custom , then the smallest class is computed and used for each image separately." diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index af39d262e52379e4b3789842ce4a455e8afadb2f..1b585d927f958d3069ea9c91b0562bf10fa03c1d 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -70,17 +70,17 @@ private: AddParameter(ParameterType_InputVectorData, "inshp", "Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile"); - AddParameter(ParameterType_InputFilename, "instats", "XML file containing mean and variance of each feature."); + AddParameter(ParameterType_InputFilename, "instats", "XML file containing mean and variance of each feature"); SetParameterDescription("instats", "XML file containing mean and variance of each feature."); - AddParameter(ParameterType_OutputFilename, "insvm", "Input model filename."); + AddParameter(ParameterType_OutputFilename, "insvm", "Input model filename"); SetParameterDescription("insvm", "Input model filename."); AddParameter(ParameterType_ListView, "feat", "Features"); SetParameterDescription("feat","Features to be calculated"); - AddParameter(ParameterType_String,"cfield","Field containing the predicted class."); + AddParameter(ParameterType_String,"cfield","Field containing the predicted class"); SetParameterDescription("cfield","Field containing the predicted class"); SetParameterString("cfield","predicted"); diff --git a/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx b/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx index 92d159b8b3341132564b52664be90b8cf16bf7aa..2134db123a5fbff6425004aec2bb19aba0722dca 100644 --- a/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx @@ -74,18 +74,18 @@ private: // Documentation SetDocName("Polygon Class Statistics"); - SetDocLongDescription("The application processes a set of geometries " - "intended for training (they should have a field giving the associated " - "class). The geometries are analyzed against a support image to compute " - "statistics : \n" - " - number of samples per class\n" - " - number of samples per geometry\n" + SetDocLongDescription("Process a set of geometries intended for training (they should have a field giving the associated " + "class). The geometries are analyzed against a support image to compute statistics:\n\n" + "* Number of samples per class\n" + "* Number of samples per geometry\n\n" + "An optional raster mask can be used to discard samples. Different types" - " of geometry are supported : polygons, lines, points. The behaviour is " - "different for each type of geometry :\n" - " - polygon: select pixels whose center is inside the polygon\n" - " - lines : select pixels intersecting the line\n" - " - points : select closest pixel to the point"); + " of geometry are supported: polygons, lines, points. The behaviour is " + "different for each type of geometry:\n\n" + "* Polygon: select pixels whose center is inside the polygon\n" + "* Lines: select pixels intersecting the line\n" + "* Points: select closest pixel to the point"); + SetDocLimitations("None"); SetDocAuthors("OTB-Team"); SetDocSeeAlso(" "); diff --git a/Modules/Applications/AppClassification/app/otbSOMClassification.cxx b/Modules/Applications/AppClassification/app/otbSOMClassification.cxx index 1b0b7ffcc7da5682e3c02550ef4f026cf0371eb9..ebd8dc2140f1ed9b20b08e8fb2bb55a173e70991 100644 --- a/Modules/Applications/AppClassification/app/otbSOMClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbSOMClassification.cxx @@ -146,10 +146,11 @@ private: SetParameterDescription("iv", "Maximum initial neuron weight"); MandatoryOff("iv"); + AddRANDParameter(); + AddRAMParameter(); // TODO : replace StreamingLines by RAM param ? - AddRANDParameter(); // Default parameters SetDefaultParameterFloat("tp", 1.0); SetDefaultParameterInt("sx", 32); diff --git a/Modules/Applications/AppClassification/app/otbSampleAugmentation.cxx b/Modules/Applications/AppClassification/app/otbSampleAugmentation.cxx index 6446b4f434a4aa82ee7e05e11dc81d3905cbbfd3..dd6e4b67a9fe04dab5679965cde7b6df5a42d4aa 100644 --- a/Modules/Applications/AppClassification/app/otbSampleAugmentation.cxx +++ b/Modules/Applications/AppClassification/app/otbSampleAugmentation.cxx @@ -94,7 +94,7 @@ private: "be generated."); SetDefaultParameterInt("samples",100); - AddParameter(ParameterType_ListView, "exclude", "Field names for excluded features."); + AddParameter(ParameterType_ListView, "exclude", "Field names for excluded features"); SetParameterDescription("exclude", "List of field names in the input vector data that will not be generated in the output file."); @@ -122,8 +122,7 @@ private: "by using the SMOTE algorithm (http://dx.doi.org/10.1613/jair.953) " "on input samples which are " "randomly selected with replacement."); - AddParameter(ParameterType_Int, "strategy.smote.neighbors", - "Number of nearest neighbors."); + AddParameter(ParameterType_Int, "strategy.smote.neighbors", "Number of nearest neighbors"); SetParameterDescription("strategy.smote.neighbors", "Number of nearest neighbors to be used in the " "SMOTE algorithm"); diff --git a/Modules/Applications/AppClassification/app/otbSampleSelection.cxx b/Modules/Applications/AppClassification/app/otbSampleSelection.cxx index b0a807425b0807711611909b5362a36292558912..823a95d70eba2ba067437e777bafe420eaefa946 100644 --- a/Modules/Applications/AppClassification/app/otbSampleSelection.cxx +++ b/Modules/Applications/AppClassification/app/otbSampleSelection.cxx @@ -213,10 +213,10 @@ private: ElevationParametersHandler::AddElevationParameters(this, "elev"); - AddRAMParameter(); - AddRANDParameter(); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "support_image.tif"); SetDocExampleParameterValue("vec", "variousVectors.sqlite"); diff --git a/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx b/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx index 9f0cecea8441570a6e0662258a17c725a41d87d9..d101d983de3410bb1d347e9f03888ff30fe995dd 100644 --- a/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx @@ -126,7 +126,7 @@ private: "Caution, the 'cfield' must not exist in the input file if you are updating the file."); SetParameterString("cfield","predicted"); - AddParameter(ParameterType_ListView, "feat", "Field names to be calculated."); + AddParameter(ParameterType_ListView, "feat", "Field names to be calculated"); SetParameterDescription("feat","List of field names in the input vector data used as features for training. " "Put the same field names as the TrainVectorClassifier application."); diff --git a/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx b/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx index 4c24dc1287247b41f2d7418db2919f928549c522..89d5023c47dccc9a2b839c4efa7191e0542d48a0 100644 --- a/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx +++ b/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx @@ -32,20 +32,18 @@ void LearningApplicationBase<TInputValue, TOutputValue>::InitSharkKMeansParams() { AddChoice( "classifier.sharkkm", "Shark kmeans classifier" ); SetParameterDescription("classifier.sharkkm", "http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/algorithms/kmeans.html "); - //MaxNumberOfIterations - AddParameter( ParameterType_Int, "classifier.sharkkm.maxiter", - "Maximum number of iteration for the kmeans algorithm." ); - SetParameterInt( "classifier.sharkkm.maxiter", 10 ); - SetMinimumParameterIntValue( "classifier.sharkkm.maxiter", 0 ); - SetParameterDescription( "classifier.sharkkm.maxiter", - "The maximum number of iteration for the kmeans algorithm. 0=unlimited" ); - //MaxNumberOfIterations - AddParameter( ParameterType_Int, "classifier.sharkkm.k", "The number of class used for the kmeans algorithm." ); - SetParameterInt( "classifier.sharkkm.k", 2 ); - SetParameterDescription( "classifier.sharkkm.k", - "The number of class used for the kmeans algorithm. Default set to 2 class" ); - SetMinimumParameterIntValue( "classifier.sharkkm.k", 2 ); + // MaxNumberOfIterations + AddParameter(ParameterType_Int, "classifier.sharkkm.maxiter", "Maximum number of iterations for the kmeans algorithm"); + SetParameterInt("classifier.sharkkm.maxiter", 10); + SetMinimumParameterIntValue("classifier.sharkkm.maxiter", 0); + SetParameterDescription("classifier.sharkkm.maxiter", "The maximum number of iterations for the kmeans algorithm. 0=unlimited"); + + // Number of classes + AddParameter(ParameterType_Int, "classifier.sharkkm.k", "Number of classes for the kmeans algorithm"); + SetParameterInt("classifier.sharkkm.k", 2); + SetParameterDescription("classifier.sharkkm.k", "The number of classes used for the kmeans algorithm. Default set to 2 class"); + SetMinimumParameterIntValue("classifier.sharkkm.k", 2); } template<class TInputValue, class TOutputValue> diff --git a/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx b/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx index a87570027ae7ca746b5bbefc0f383335fdb435ef..3b4fcd115491e0ffd231e0f809cc624cbea949c7 100644 --- a/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx +++ b/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx @@ -36,7 +36,7 @@ void TrainVectorBase::DoInit() AddParameter( ParameterType_InputVectorDataList, "io.vd", "Input Vector Data" ); SetParameterDescription( "io.vd", - "Input geometries used for training (note : all geometries from the layer will be used)" ); + "Input geometries used for training (note: all geometries from the layer will be used)" ); AddParameter( ParameterType_InputFilename, "io.stats", "Input XML image statistics file" ); MandatoryOff( "io.stats" ); diff --git a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx index d367a97ec1b422403325bed89759064c6e338b44..2c4a2e2d794ca28c86b87ac10365418869480dd3 100644 --- a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx +++ b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx @@ -87,7 +87,7 @@ private: SetDescription("Compute homologous points between images using keypoints"); SetDocLongDescription("This application allows computing homologous points between images using keypoints. " " SIFT or SURF keypoints can be used and the band on which keypoints are computed can be set independently for both images." - " The application offers two modes :" + " The application offers two modes:" " the first is the full mode where keypoints are extracted from the full extent of both images" " (please note that in this mode large image file are not supported). " "The second mode, called geobins, allows one to set-up spatial binning to get fewer points" @@ -143,7 +143,7 @@ private: SetMinimumParameterFloatValue("threshold",0.0); SetDefaultParameterFloat("threshold",0.6); - AddParameter(ParameterType_Bool,"backmatching","Use back-matching to filter matches."); + AddParameter(ParameterType_Bool,"backmatching","Use back-matching to filter matches"); SetParameterDescription("backmatching","If set to true, matches should be consistent in both ways."); AddParameter(ParameterType_Choice,"mode","Keypoints search mode"); @@ -179,7 +179,7 @@ private: SetMinimumParameterIntValue("mode.geobins.margin",0); SetDefaultParameterInt("mode.geobins.margin",10); - AddParameter(ParameterType_Float,"precision","Estimated precision of the colocalisation function (in pixels)."); + AddParameter(ParameterType_Float,"precision","Estimated precision of the colocalisation function (in pixels)"); SetParameterDescription("precision","Estimated precision of the colocalisation function in pixels"); SetDefaultParameterFloat("precision",0.); @@ -425,7 +425,7 @@ private: largestRegion.ShrinkByRadius(image_border_margin); region1.Crop(largestRegion); - otbAppLogINFO("("<<i+1<<"/"<<nb_bins_x<<", "<<j+1<<"/"<<nb_bins_y<<") Considering region1 : "<<region1.GetIndex()<<", "<<region1.GetSize()); + otbAppLogINFO("("<<i+1<<"/"<<nb_bins_x<<", "<<j+1<<"/"<<nb_bins_y<<") Considering region1: "<<region1.GetIndex()<<", "<<region1.GetSize()); extractChannel1->SetExtractionRegion(region1); diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx index 34390791ab52ba160523ae8fbbe4e5e0fbbdc241..1e4a9848686339096436228be53507b9e61a9273 100644 --- a/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx +++ b/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx @@ -88,8 +88,7 @@ private: SetParameterDescription("io", "This group of parameters allows setting input and output data."); AddParameter(ParameterType_InputVectorData, "io.vd", "Input Vector Data"); - SetParameterDescription("io.vd", "Input geometries used for training (note " - ": all geometries from the layer will be used)"); + SetParameterDescription("io.vd", "Input geometries used for training (note: all geometries from the layer will be used)"); AddParameter(ParameterType_OutputFilename, "io.out", "Output model"); SetParameterDescription("io.out", "Output file containing the estimated model (.txt format)."); @@ -98,9 +97,8 @@ private: MandatoryOff("io.stats"); SetParameterDescription("io.stats", "XML file containing mean and variance of each feature."); - AddParameter(ParameterType_StringList, "feat", "Field names to be used for training."); // - SetParameterDescription("feat","List of field names in the input vector data" - " used as features for training."); // + AddParameter(ParameterType_StringList, "feat", "Field names to be used for training"); + SetParameterDescription("feat","List of field names in the input vector data used as features for training."); Superclass::DoInit(); diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx index d9031f4cef9e5346d9cf79c6d57d44667d3d1a62..c83d379ebfa6d9f21828016d9faf35eac2fd4548 100644 --- a/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx +++ b/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx @@ -80,7 +80,7 @@ protected: DimensionalityReductionModelFactoryType::CleanFactories(); } -private: +private: void DoInit() override { SetName("VectorDimensionalityReduction"); @@ -115,11 +115,10 @@ private: "In overwrite mode, the original features will be lost."); MandatoryOff("out"); - AddParameter(ParameterType_ListView, "feat", "Input features to use for reduction."); // - SetParameterDescription("feat","List of field names in the input vector " - "data used as features for reduction."); // + AddParameter(ParameterType_ListView, "feat", "Input features to use for reduction"); + SetParameterDescription("feat", "List of field names in the input vector data used as features for reduction."); - AddParameter(ParameterType_Choice, "featout", "Output feature"); // + AddParameter(ParameterType_Choice, "featout", "Output feature"); SetParameterDescription("featout", "Naming of output features"); AddChoice("featout.prefix", "Prefix"); @@ -134,22 +133,24 @@ private: SetParameterDescription("featout.list", "Use a list with all names"); AddParameter(ParameterType_StringList, "featout.list.names", "Feature name list"); - SetParameterDescription("featout.list.names","List of field names for the output " - "features which result from the reduction."); // - - AddParameter(ParameterType_Int, "pcadim", "Principal component dimension"); // - SetParameterDescription("pcadim","This optional parameter can be set to " - "reduce the number of eignevectors used in the PCA model file. This " - "parameter can't be used for other models"); // + SetParameterDescription("featout.list.names", + "List of field names for the output " + "features which result from the reduction."); + + AddParameter(ParameterType_Int, "pcadim", "Principal component dimension"); + SetParameterDescription("pcadim", + "This optional parameter can be set to " + "reduce the number of eignevectors used in the PCA model file. This " + "parameter can't be used for other models"); MandatoryOff("pcadim"); - - AddParameter(ParameterType_Choice, "mode", "Writing mode"); // + + AddParameter(ParameterType_Choice, "mode", "Writing mode"); SetParameterDescription("mode", "This parameter determines if the output " "file is overwritten or updated [overwrite/update]. If an output file " "name is given, the original file is copied before creating the new features."); AddChoice("mode.overwrite", "Overwrite"); - SetParameterDescription("mode.overwrite","Overwrite mode"); // + SetParameterDescription("mode.overwrite", "Overwrite mode"); AddChoice("mode.update", "Update"); SetParameterDescription("mode.update", "Update mode"); @@ -160,7 +161,7 @@ private: SetDocExampleParameterValue("model", "model.txt"); SetDocExampleParameterValue("out", "vectorDataOut.shp"); SetDocExampleParameterValue("feat", "perimeter area width"); - //SetOfficialDocLink(); + SetOfficialDocLink(); } void DoUpdateParameters() override diff --git a/Modules/Applications/AppEdge/app/otbEdgeExtraction.cxx b/Modules/Applications/AppEdge/app/otbEdgeExtraction.cxx index ec740ac5f4a937e492ceee933f5839b8160b222e..c8f6a739101566358dd7b5ea171775de414c9d63 100644 --- a/Modules/Applications/AppEdge/app/otbEdgeExtraction.cxx +++ b/Modules/Applications/AppEdge/app/otbEdgeExtraction.cxx @@ -87,8 +87,6 @@ private: SetDefaultParameterInt("channel", 1); SetMinimumParameterIntValue("channel", 1); - AddRAMParameter(); - AddParameter(ParameterType_Choice, "filter", "Edge feature"); SetParameterDescription("filter", "Choice of edge feature"); @@ -126,6 +124,8 @@ private: SetDefaultParameterFloat("filter.canny.lowerthreshold", 3.0); */ + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); SetDocExampleParameterValue("channel", "1"); diff --git a/Modules/Applications/AppFiltering/app/otbSmoothing.cxx b/Modules/Applications/AppFiltering/app/otbSmoothing.cxx index 550cc25350e186deaf52f88ca3189d08d1f0da4d..09649c86e12a56a812dea62247eb8b0ad8221643 100644 --- a/Modules/Applications/AppFiltering/app/otbSmoothing.cxx +++ b/Modules/Applications/AppFiltering/app/otbSmoothing.cxx @@ -62,7 +62,7 @@ private: SetDocName( "Smoothing" ); SetDocLongDescription( "This application applies a smoothing filter to an " - "image. Three methodes can be used : a gaussian filter , a mean filter " + "image. Three methodes can be used: a gaussian filter , a mean filter " ", or an anisotropic diffusion using the Perona-Malik algorithm." ); SetDocLimitations( "None") ; SetDocAuthors( "OTB-Team" ); @@ -75,8 +75,6 @@ private: AddParameter( ParameterType_OutputImage , "out" , "Output Image" ); SetParameterDescription( "out" , "Output smoothed image." ); - AddRAMParameter(); - AddParameter( ParameterType_Choice, "type" , "Smoothing Type" ); SetParameterDescription( "type", "Smoothing kernel to apply" ); @@ -118,6 +116,8 @@ private: SetParameterString( "type" , "anidif"); + AddRAMParameter(); + // Doc example parameter settings SetExampleComment( "Image smoothing using a mean filter." , 0 ); SetDocExampleParameterValue( "in" , "Romania_Extract.tif" ); @@ -138,7 +138,7 @@ private: void DoUpdateParameters() override { - // Nothing to do here : all parameters are independent + // Nothing to do here: all parameters are independent } void DoExecute() override diff --git a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx index 38ee5a8c6f9a3e2a396cb978688d061d9064ff30..3029dbd330eddf9071129df26d474fac7cde156f 100644 --- a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx +++ b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx @@ -103,13 +103,13 @@ private: "spectrum associated with each pixel is a linear combination of pure" "materials in the recovery area, commonly known as endmembers. Endmembers can" "be estimated using the VertexComponentAnalysis application.\n\n" - "The application allows estimating the abundance maps with several algorithms :\n" - " * Unconstrained Least Square (ucls)\n" - //" * Fully Constrained Least Square (fcls)\n" - " * Image Space Reconstruction Algorithm (isra)\n" - " * Non-negative constrained\n" - " * Least Square (ncls)\n" - " * Minimum Dispersion Constrained Non Negative Matrix Factorization (MDMDNMF)." + "The application allows estimating the abundance maps with several algorithms:\n\n" + "* Unconstrained Least Square (ucls)\n" +// "* Fully Constrained Least Square (fcls)\n" + "* Image Space Reconstruction Algorithm (isra)\n" + "* Non-negative constrained\n" + "* Least Square (ncls)\n" + "* Minimum Dispersion Constrained Non Negative Matrix Factorization (MDMDNMF)." ); SetDocLimitations("None"); SetDocAuthors("OTB-Team"); diff --git a/Modules/Applications/AppImageUtils/app/CMakeLists.txt b/Modules/Applications/AppImageUtils/app/CMakeLists.txt index e89f03ee6f9ca3ae2b2e931e455411704f99a63d..b3834d621c17924421e8e9158e31a697d18b0e76 100644 --- a/Modules/Applications/AppImageUtils/app/CMakeLists.txt +++ b/Modules/Applications/AppImageUtils/app/CMakeLists.txt @@ -23,12 +23,6 @@ otb_create_application( SOURCES otbDownloadSRTMTiles.cxx LINK_LIBRARIES ${${otb-module}_LIBRARIES}) - -otb_create_application( - NAME Convert - SOURCES otbConvert.cxx - LINK_LIBRARIES ${${otb-module}_LIBRARIES}) - otb_create_application( NAME PixelValue SOURCES otbPixelValue.cxx diff --git a/Modules/Applications/AppImageUtils/app/otbConcatenateImages.cxx b/Modules/Applications/AppImageUtils/app/otbConcatenateImages.cxx index eb9d3129959f6bcf6539908eeb57e7a5c33b2d68..7f84bc254a493d2cff68f7446af7f1c7353e50bb 100644 --- a/Modules/Applications/AppImageUtils/app/otbConcatenateImages.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConcatenateImages.cxx @@ -66,7 +66,7 @@ private: "and generates a single multi-channel image. The channel order is the same as the list."); SetDocLimitations("All input images must have the same size."); SetDocAuthors("OTB-Team"); - SetDocSeeAlso("Rescale application, Convert, SplitImage"); + SetDocSeeAlso("Rescale application, DynamicConvert, SplitImage"); AddDocTag(Tags::Manip); AddDocTag("Concatenation"); diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx deleted file mode 100644 index 41619d099161c66c556202025d93dc2403cf5898..0000000000000000000000000000000000000000 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ /dev/null @@ -1,528 +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 <numeric> - -#include "otbWrapperApplication.h" -#include "otbWrapperApplicationFactory.h" - -#include "otbVectorRescaleIntensityImageFilter.h" -#include "otbUnaryImageFunctorWithVectorImageFilter.h" -#include "otbStreamingShrinkImageFilter.h" -#include "itkListSample.h" -#include "otbListSampleToHistogramListGenerator.h" -#include "itkImageRegionConstIterator.h" - -#include "otbImageListToVectorImageFilter.h" -#include "otbMultiToMonoChannelExtractROI.h" -#include "otbImageList.h" - -namespace otb -{ -namespace Wrapper -{ - -namespace Functor -{ -template< class TScalar > -class ITK_EXPORT LogFunctor -{ -public: - LogFunctor(){}; - ~LogFunctor(){}; - TScalar operator() (const TScalar& v) const - { - return std::log(v); - } -}; -} // end namespace Functor - - -class Convert : public Application -{ -public: - /** Standard class typedefs. */ - typedef Convert Self; - typedef Application Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard macro */ - itkNewMacro(Self); - - itkTypeMacro(Convert, otb::Application); - - /** Filters typedef */ - typedef itk::Statistics::ListSample<FloatVectorImageType::PixelType> ListSampleType; - typedef itk::Statistics::DenseFrequencyContainer2 DFContainerType; - typedef ListSampleToHistogramListGenerator<ListSampleType, - FloatVectorImageType::InternalPixelType, - DFContainerType> HistogramsGeneratorType; - typedef StreamingShrinkImageFilter<FloatVectorImageType, - FloatVectorImageType> ShrinkFilterType; - typedef Functor::LogFunctor<FloatVectorImageType::InternalPixelType> TransferLogFunctor; - typedef UnaryImageFunctorWithVectorImageFilter<FloatVectorImageType, - FloatVectorImageType, - TransferLogFunctor> TransferLogType; - - -private: - - void DoInit() override - { - SetName("Convert"); - SetDescription("Convert an image to a different format, optionally rescaling the data" - " and/or changing the pixel type."); - // Documentation - SetDocName("Image Conversion"); - SetDocLongDescription("This application performs an image pixel type conversion " - "(short, ushort, uchar, int, uint, float and double types are handled). " - "The output image is written in the specified format (ie. that corresponds " - "to the given extension).\n The conversion can include a rescale of the data range, " - "by default it's set from 2% to 98% of the data values. The rescale can be linear or log2. \n " - "The choice of the output channels can be done with the extended filename, " - "but less easy to handle. To do this, a 'channels' parameter allows you to select " - "the desired bands at the output. There are 3 modes, the available choices are: \n" - " * grayscale : to display mono image as standard color image \n" - " * rgb : select 3 bands in the input image (multi-bands) \n" - " * all : keep all bands."); - SetDocLimitations("The application does not support complex pixel types as output."); - SetDocAuthors("OTB-Team"); - SetDocSeeAlso("Rescale"); - - AddDocTag(Tags::Deprecated); - AddDocTag(Tags::Manip); - AddDocTag("Conversion"); - AddDocTag("Image Dynamic"); - - AddParameter(ParameterType_InputImage, "in", "Input image"); - SetParameterDescription("in", "Input image"); - - AddParameter(ParameterType_Choice, "type", "Rescale type"); - SetParameterDescription("type", "Transfer function for the rescaling"); - AddChoice("type.none", "None"); - AddChoice("type.linear", "Linear"); - AddChoice("type.log2", "Log2"); - SetParameterString("type", "none"); - - AddParameter(ParameterType_Float,"type.linear.gamma","Gamma correction factor"); - SetParameterDescription("type.linear.gamma","Gamma correction factor"); - SetDefaultParameterFloat("type.linear.gamma",1.0); - MandatoryOff("type.linear.gamma"); - - AddParameter(ParameterType_InputImage, "mask", "Input mask"); - SetParameterDescription("mask", - "Optional mask to indicate which pixels are valid for computing the histogram quantiles. " - "Only pixels where the mask is less than 0.5 will contribute to the histogram. " - "The mask must have the same dimensions as the input image."); - MandatoryOff("mask"); - DisableParameter("mask"); - - AddParameter(ParameterType_Group,"hcp","Histogram Cutting Parameters"); - SetParameterDescription("hcp","Parameters to cut the histogram edges before rescaling"); - - AddParameter(ParameterType_Float, "hcp.high", "High Cut Quantile"); - SetParameterDescription("hcp.high", "Quantiles to cut from histogram high values " - "before computing min/max rescaling (in percent, 2 by default)"); - MandatoryOff("hcp.high"); - SetDefaultParameterFloat("hcp.high", 2.0); - DisableParameter("hcp.high"); - - AddParameter(ParameterType_Float, "hcp.low", "Low Cut Quantile"); - SetParameterDescription("hcp.low", "Quantiles to cut from histogram low values " - "before computing min/max rescaling (in percent, 2 by default)"); - MandatoryOff("hcp.low"); - SetDefaultParameterFloat("hcp.low", 2.0); - DisableParameter("hcp.low"); - - AddParameter(ParameterType_OutputImage, "out", "Output Image"); - SetParameterDescription("out", "Output image"); - SetDefaultOutputPixelType("out",ImagePixelType_uint8); - - AddParameter(ParameterType_Choice, "channels", "Channels selection"); - SetParameterDescription("channels", "It's possible to select the channels " - "of the output image. There are 3 modes, the available choices are:"); - - AddChoice("channels.all", "Default mode"); - SetParameterDescription("channels.all", "Select all bands in the input image, (1,...,n)."); - - AddChoice("channels.grayscale", "Grayscale mode"); - SetParameterDescription("channels.grayscale", "Display single channel as standard color image."); - AddParameter(ParameterType_Int, "channels.grayscale.channel", "Grayscale channel"); - SetDefaultParameterInt("channels.grayscale.channel", 1); - SetMinimumParameterIntValue("channels.grayscale.channel", 1); - - AddChoice("channels.rgb", "RGB composition"); - SetParameterDescription("channels.rgb", "Select 3 bands in the input image " - "(multi-bands), by default (1,2,3)."); - - AddParameter(ParameterType_Int, "channels.rgb.red", "Red Channel"); - SetParameterDescription("channels.rgb.red", "Red channel index."); - SetMinimumParameterIntValue("channels.rgb.red", 1); - AddParameter(ParameterType_Int, "channels.rgb.green", "Green Channel"); - SetParameterDescription("channels.rgb.green", "Green channel index."); - SetMinimumParameterIntValue("channels.rgb.green", 1); - AddParameter(ParameterType_Int, "channels.rgb.blue", "Blue Channel"); - SetParameterDescription("channels.rgb.blue", "Blue channel index."); - SetMinimumParameterIntValue("channels.rgb.blue", 1); - - AddRAMParameter(); - - // Doc example parameter settings - SetDocExampleParameterValue("in", "QB_Toulouse_Ortho_XS.tif"); - SetDocExampleParameterValue("out", "otbConvertWithScalingOutput.png"); - SetDocExampleParameterValue("type", "linear"); - SetDocExampleParameterValue("channels", "rgb"); - - SetOfficialDocLink(); - } - - void DoUpdateParameters() override - { - // Read information - if ( HasValue("in") ) - { - typedef otb::ImageMetadataInterfaceBase ImageMetadataInterfaceType; - ImageMetadataInterfaceType::Pointer metadataInterface = - ImageMetadataInterfaceFactory::CreateIMI(GetParameterImage("in")->GetMetaDataDictionary()); - - int nbBand = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); - SetMaximumParameterIntValue("channels.grayscale.channel", nbBand); - SetMaximumParameterIntValue("channels.rgb.red", nbBand); - SetMaximumParameterIntValue("channels.rgb.green", nbBand); - SetMaximumParameterIntValue("channels.rgb.blue", nbBand); - - if (nbBand > 1) - { - // get band index : Red/Green/Blue - int bandRed = metadataInterface->GetDefaultDisplay()[0] + 1; - int bandGreen = metadataInterface->GetDefaultDisplay()[1] + 1; - int bandBlue = metadataInterface->GetDefaultDisplay()[2] + 1; - SetDefaultParameterInt("channels.rgb.red", bandRed); - SetDefaultParameterInt("channels.rgb.green", bandGreen); - SetDefaultParameterInt("channels.rgb.blue", bandBlue); - } - } - - - } - - template<class TImageType> - void GenericDoExecute() - { - - // Clear previously registered filters - m_Filters.clear(); - - std::string rescaleType = this->GetParameterString("type"); - - if( (rescaleType != "none") && (rescaleType != "linear") && (rescaleType != "log2") ) - { - itkExceptionMacro("Unknown rescale type "<<rescaleType<<"."); - } - - if( rescaleType == "none" ) - { - // selected channel - typename TImageType::Pointer tempImage; - tempImage = GetSelectedChannels<TImageType>(); - - SetParameterOutputImage<TImageType>("out", tempImage); - - } - else // linear or log2 - { - FloatVectorImageType::Pointer mask; - - if (IsParameterEnabled("mask")) mask = this->GetParameterImage("mask"); - - // selected channel - typename FloatVectorImageType::Pointer tempImage; - tempImage = GetSelectedChannels<FloatVectorImageType>(); - - const unsigned int nbComp(tempImage->GetNumberOfComponentsPerPixel()); - - typedef otb::VectorRescaleIntensityImageFilter<FloatVectorImageType, TImageType> RescalerType; - typename TImageType::PixelType minimum; - typename TImageType::PixelType maximum; - minimum.SetSize(nbComp); - maximum.SetSize(nbComp); - minimum.Fill( itk::NumericTraits<typename TImageType::InternalPixelType>::min() ); - maximum.Fill( itk::NumericTraits<typename TImageType::InternalPixelType>::max() ); - - typename RescalerType::Pointer rescaler = RescalerType::New(); - - rescaler->SetOutputMinimum(minimum); - rescaler->SetOutputMaximum(maximum); - - // We need to subsample the input image in order to estimate its - // histogram - - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); - - // Shrink factor is computed so as to load a quicklook of 1000 - // pixels square at most - typename FloatVectorImageType::SizeType imageSize = tempImage->GetLargestPossibleRegion().GetSize(); - unsigned int shrinkFactor = - std::max(imageSize[0], imageSize[1]) < 1000 ? 1 : std::max(imageSize[0], imageSize[1])/1000; - - otbAppLogDEBUG( << "Shrink factor used to compute Min/Max: "<<shrinkFactor ); - - otbAppLogDEBUG( << "Shrink starts..." ); - - shrinkFilter->SetShrinkFactor(shrinkFactor); - shrinkFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram")); - AddProcess(shrinkFilter->GetStreamer(), "Computing shrink Image for min/max estimation..."); - - if ( rescaleType == "log2") - { - //define the transfer log - m_TransferLog = TransferLogType::New(); - m_TransferLog->SetInput(tempImage); - m_TransferLog->UpdateOutputInformation(); - - shrinkFilter->SetInput(m_TransferLog->GetOutput()); - rescaler->SetInput(m_TransferLog->GetOutput()); - shrinkFilter->Update(); - } - else - { - shrinkFilter->SetInput(tempImage); - rescaler->SetInput(tempImage); - shrinkFilter->Update(); - } - - ShrinkFilterType::Pointer maskShrinkFilter = ShrinkFilterType::New(); - - otbAppLogDEBUG( << "Evaluating input Min/Max..." ); - itk::ImageRegionConstIterator<FloatVectorImageType> - it(shrinkFilter->GetOutput(), shrinkFilter->GetOutput()->GetLargestPossibleRegion()); - itk::ImageRegionConstIterator<FloatVectorImageType> itMask; - - typename ListSampleType::Pointer listSample = ListSampleType::New(); - listSample->SetMeasurementVectorSize(tempImage->GetNumberOfComponentsPerPixel()); - - // Now we generate the list of samples - if (IsParameterEnabled("mask")) - { - maskShrinkFilter->SetShrinkFactor(shrinkFactor); - maskShrinkFilter->SetInput(mask); - maskShrinkFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram")); - maskShrinkFilter->Update(); - - itMask = itk::ImageRegionConstIterator<FloatVectorImageType>( - maskShrinkFilter->GetOutput(),maskShrinkFilter->GetOutput()->GetLargestPossibleRegion()); - - // Remove masked pixels - it.GoToBegin(); - itMask.GoToBegin(); - while (!it.IsAtEnd()) - { - // float values, so the threshold is set to 0.5 - if (itMask.Get()[0] < 0.5) - { - listSample->PushBack(it.Get()); - } - ++it; - ++itMask; - } - if (listSample->Size() == 0) - { - otbAppLogINFO( << "All pixels were masked, the application assume a wrong mask " - "and include all the image"); - } - } - - // if mask is disable and all pixels were masked - if ((!IsParameterEnabled("mask")) || (listSample->Size() == 0)) - { - for(it.GoToBegin(); !it.IsAtEnd(); ++it) - { - listSample->PushBack(it.Get()); - } - } - - // And then the histogram - typename HistogramsGeneratorType::Pointer histogramsGenerator = HistogramsGeneratorType::New(); - histogramsGenerator->SetListSample(listSample); - histogramsGenerator->SetNumberOfBins(255); - histogramsGenerator->NoDataFlagOn(); - histogramsGenerator->Update(); - - // And extract the lower and upper quantile - typename FloatVectorImageType::PixelType inputMin(nbComp), inputMax(nbComp); - - auto histOutput = histogramsGenerator->GetOutput(); - assert(histOutput); - - for(unsigned int i = 0; i < nbComp; ++i) - { - auto && elm = histOutput->GetNthElement(i); - assert(elm); - inputMin[i] = elm->Quantile(0, 0.01 * GetParameterFloat("hcp.low")); - inputMax[i] = elm->Quantile(0, 1.0 - 0.01 * GetParameterFloat("hcp.high")); - } - - otbAppLogDEBUG( << std::setprecision(5) << "Min/Max computation done : min=" << inputMin - << " max=" << inputMax ); - - rescaler->AutomaticInputMinMaxComputationOff(); - rescaler->SetInputMinimum(inputMin); - rescaler->SetInputMaximum(inputMax); - - if ( rescaleType == "linear") - { - rescaler->SetGamma(GetParameterFloat("type.linear.gamma")); - } - - m_Filters.push_back(rescaler.GetPointer()); - - SetParameterOutputImage<TImageType>("out", rescaler->GetOutput()); - } - } - - // Get the bands order - std::vector<int> GetChannels() - { - std::vector<int> channels; - - int nbChan = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); - std::string channelMode = GetParameterString("channels"); - - if(channelMode == "grayscale") - { - if (GetParameterInt("channels.grayscale.channel") <= nbChan) - { - channels = {GetParameterInt("channels.grayscale.channel"), - GetParameterInt("channels.grayscale.channel"), - GetParameterInt("channels.grayscale.channel")}; - } - else - { - itkExceptionMacro(<< "The channel has an invalid index"); - } - } - else if (channelMode == "rgb") - { - if ((GetParameterInt("channels.rgb.red") <= nbChan) - && ( GetParameterInt("channels.rgb.green") <= nbChan) - && ( GetParameterInt("channels.rgb.blue") <= nbChan)) - { - channels = {GetParameterInt("channels.rgb.red"), - GetParameterInt("channels.rgb.green"), - GetParameterInt("channels.rgb.blue")}; - } - else - { - itkExceptionMacro(<< "At least one needed channel has an invalid index"); - } - } - else if (channelMode == "all") - { - // take all bands - channels.resize(nbChan); - std::iota(channels.begin(), channels.end(), 1); - } - return channels; - } - - // return an image with the bands order modified of the input image - template<class TImageType> - typename TImageType::Pointer GetSelectedChannels() - { - typedef MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType, - typename TImageType::InternalPixelType> ExtractROIFilterType; - typedef otb::ImageList<otb::Image<typename TImageType::InternalPixelType> > ImageListType; - typedef ImageListToVectorImageFilter<ImageListType, - TImageType > ListConcatenerFilterType; - - typename ImageListType::Pointer imageList; - typename ListConcatenerFilterType::Pointer concatener; - - imageList = ImageListType::New(); - concatener = ListConcatenerFilterType::New(); - - //m_Filters.push_back(imageList.GetPointer()); - m_Filters.push_back(concatener.GetPointer()); - - const bool monoChannel = IsParameterEnabled("channels.grayscale"); - - // get band order - std::vector<int> channels = GetChannels(); - - for (auto && channel : channels) - { - typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); - m_Filters.push_back(extractROIFilter.GetPointer()); - extractROIFilter->SetInput(GetParameterImage("in")); - if (!monoChannel) extractROIFilter->SetChannel(channel); - extractROIFilter->UpdateOutputInformation(); - imageList->PushBack(extractROIFilter->GetOutput()); - } - - concatener->SetInput(imageList); - concatener->UpdateOutputInformation(); - - return concatener->GetOutput(); - } - - - void DoExecute() override - { - switch ( this->GetParameterOutputImagePixelType("out") ) - { - case ImagePixelType_uint8: - GenericDoExecute<UInt8VectorImageType>(); - break; - case ImagePixelType_int16: - GenericDoExecute<Int16VectorImageType>(); - break; - case ImagePixelType_uint16: - GenericDoExecute<UInt16VectorImageType>(); - break; - case ImagePixelType_int32: - GenericDoExecute<Int32VectorImageType>(); - break; - case ImagePixelType_uint32: - GenericDoExecute<UInt32VectorImageType>(); - break; - case ImagePixelType_float: - GenericDoExecute<FloatVectorImageType>(); - break; - case ImagePixelType_double: - GenericDoExecute<DoubleVectorImageType>(); - break; - default: - itkExceptionMacro("Unknown pixel type " << this->GetParameterOutputImagePixelType("out") <<"." << std::endl - << "The Convert application does not support complex pixel type as output." << std::endl - << "You can use instead the ExtractROI application to perform complex image conversion."); - break; - } - } - - TransferLogType::Pointer m_TransferLog; - std::vector<itk::LightObject::Pointer> m_Filters; -}; - -} -} - -OTB_APPLICATION_EXPORT(otb::Wrapper::Convert) - diff --git a/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx b/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx index 2919b5f1c3589e1576478ab62f156c99ab2e7300..ebfeacb421326446d547ed12b03ac2c3a5927f17 100644 --- a/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx @@ -22,7 +22,7 @@ #include "otbWrapperApplicationFactory.h" #include "otbVectorRescaleIntensityImageFilter.h" -#include "otbUnaryImageFunctorWithVectorImageFilter.h" +#include "otbFunctorImageFilter.h" #include "otbStreamingShrinkImageFilter.h" #include "itkListSample.h" #include "otbListSampleToHistogramListGenerator.h" @@ -39,20 +39,6 @@ namespace otb namespace Wrapper { -namespace Functor -{ - template< class TScalar > -class ITK_EXPORT LogFunctor -{ -public: - TScalar operator() (const TScalar& v) const - { - return std::log(v); - } -}; -} // end namespace Functor - - class DynamicConvert : public Application { @@ -80,11 +66,6 @@ public: typedef StreamingShrinkImageFilter<UInt8ImageType, UInt8ImageType> UInt8ShrinkFilterType; - typedef Functor::LogFunctor<FloatVectorImageType::InternalPixelType> TransferLogFunctor; - typedef UnaryImageFunctorWithVectorImageFilter<FloatVectorImageType, - FloatVectorImageType, - TransferLogFunctor> TransferLogType; - private: void DoInit() override @@ -111,7 +92,7 @@ private: ); SetDocLimitations("The application does not support complex pixel types as output."); SetDocAuthors("OTB-Team"); - SetDocSeeAlso("Convert, Rescale"); + SetDocSeeAlso("Rescale"); AddDocTag(Tags::Manip); AddDocTag("Conversion"); @@ -277,13 +258,26 @@ private: if ( rescaleType == "log2") { - //define the transfer log - m_TransferLog = TransferLogType::New(); - m_TransferLog->SetInput(tempImage); - m_TransferLog->UpdateOutputInformation(); - - shrinkFilter->SetInput(m_TransferLog->GetOutput()); - rescaler->SetInput(m_TransferLog->GetOutput()); + // define lambda function that applies a log to all bands of the input pixel + auto logFunction = [](FloatVectorImageType::PixelType & vectorOut, const FloatVectorImageType::PixelType & vectorIn) { + assert(vectorOut.Size() == vectorIn.Size() && "Input vector types don't have the same size"); + + for (unsigned int i = 0; i < vectorIn.Size() ; i++) { + vectorOut[i] = std::log(vectorIn[i]); + } + + }; +// creates functor filter + auto transferLogFilter = NewFunctorFilter(logFunction,tempImage->GetNumberOfComponentsPerPixel(),{{0,0}}); + + // save a reference to the functor + m_Filters.push_back(transferLogFilter.GetPointer()); + + transferLogFilter->SetVariadicInputs(tempImage); + transferLogFilter->UpdateOutputInformation(); + + shrinkFilter->SetInput(transferLogFilter->GetOutput()); + rescaler->SetInput(transferLogFilter->GetOutput()); shrinkFilter->Update(); } else @@ -528,8 +522,6 @@ private: } } - itk::ProcessObject::Pointer m_TmpFilter; - TransferLogType::Pointer m_TransferLog; std::vector<itk::LightObject::Pointer> m_Filters; }; diff --git a/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx b/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx index 15c5e1ea5acc615e114f98a50e95a915df777c9f..d31a2271c16b39492afc4d842de20d1bfa802c46 100644 --- a/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx +++ b/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx @@ -80,8 +80,6 @@ private: AddParameter(ParameterType_OutputImage, "out", "Output Image"); SetParameterDescription("out","will be used to get the prefix and the extension of the images to write"); - AddRAMParameter(); - AddParameter(ParameterType_Int, "level", "Number Of Levels"); SetDefaultParameterInt("level", 1); SetParameterDescription( "level", "Number of levels in the pyramid (default is 1)."); @@ -102,6 +100,8 @@ private: <<" subsampling previous level of pyramid instead of processing the full input."; SetParameterDescription("fast", desc.str()); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "QB_Toulouse_Ortho_XS.tif"); SetDocExampleParameterValue("out", "multiResolutionImage.tif"); diff --git a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx index ea8bb52d905adbee6cb8277fce8002076655d466..0fbc145ac952af905b50462be5bb85442bc1c15a 100644 --- a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx +++ b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx @@ -98,7 +98,7 @@ private: AddParameter(ParameterType_Int , "mode.epsg.code" , "EPSG code"); SetParameterDescription("mode.epsg.code" , "This code is used to define a geographical coordinate system. " - "If no system is specified, WGS84 (EPSG : 4326) is used by default."); + "If no system is specified, WGS84 (EPSG: 4326) is used by default."); MandatoryOff("mode.epsg.code"); AddParameter(ParameterType_ListView,"cl","Channels"); diff --git a/Modules/Applications/AppImageUtils/app/otbRescale.cxx b/Modules/Applications/AppImageUtils/app/otbRescale.cxx index ad0992f5048a89db4af581e732dc1e44859e806c..ab7b27c23ee0ced32ff7a8ba7abe3964de0d86a5 100644 --- a/Modules/Applications/AppImageUtils/app/otbRescale.cxx +++ b/Modules/Applications/AppImageUtils/app/otbRescale.cxx @@ -69,8 +69,6 @@ private: AddParameter(ParameterType_OutputImage, "out", "Output Image"); SetParameterDescription( "out" , "The rescaled image filename." ); - AddRAMParameter(); - AddParameter(ParameterType_Float, "outmin", "Output min value"); AddParameter(ParameterType_Float, "outmax", "Output max value"); SetDefaultParameterFloat("outmin", 0.0); @@ -81,6 +79,8 @@ private: MandatoryOff("outmin"); MandatoryOff("outmax"); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "QB_Toulouse_Ortho_PAN.tif"); SetDocExampleParameterValue("out", "rescaledImage.png uchar"); diff --git a/Modules/Applications/AppImageUtils/app/otbTileFusion.cxx b/Modules/Applications/AppImageUtils/app/otbTileFusion.cxx index 7ba75ba1a3007513cc3d864b0287a2aa340ea451..0712b8fae121249d4309da9110b914fea71b7eab 100644 --- a/Modules/Applications/AppImageUtils/app/otbTileFusion.cxx +++ b/Modules/Applications/AppImageUtils/app/otbTileFusion.cxx @@ -60,7 +60,7 @@ private: AddDocTag(Tags::Manip); AddParameter(ParameterType_InputImageList, "il", "Input Tile Images"); - SetParameterDescription("il", "Input images to concatenate (in lexicographic order, for instance : (0,0) (1,0) (0,1) (1,1))."); + SetParameterDescription("il", "Input images to concatenate (in lexicographic order, for instance: (0,0) (1,0) (0,1) (1,1))."); AddParameter(ParameterType_Int, "cols", "Number of tile columns"); SetParameterDescription("cols", "Number of columns in the tile array"); diff --git a/Modules/Applications/AppImageUtils/otb-module.cmake b/Modules/Applications/AppImageUtils/otb-module.cmake index 6b378f1f31adc8b54cab8249c2ec2a95f208de00..fa60474ae7c69ef15ed3ebc03a1bc8939ec346af 100644 --- a/Modules/Applications/AppImageUtils/otb-module.cmake +++ b/Modules/Applications/AppImageUtils/otb-module.cmake @@ -38,6 +38,7 @@ otb_module(OTBAppImageUtils OTBStatistics OTBStreaming OTBTransform + OTBFunctor TEST_DEPENDS OTBCommandLine diff --git a/Modules/Applications/AppImageUtils/test/CMakeLists.txt b/Modules/Applications/AppImageUtils/test/CMakeLists.txt index 4e099298e98ab6930a22e531b09108b24c9fa3ec..187ad31a80de51fb145bb4dbb3e33b5c2f64181e 100644 --- a/Modules/Applications/AppImageUtils/test/CMakeLists.txt +++ b/Modules/Applications/AppImageUtils/test/CMakeLists.txt @@ -27,66 +27,6 @@ otb_test_application(NAME apTuUtDownloadSRTMTiles -tiledir ${INPUTDATA}/DEM/srtm_directory ) - - - -#----------- Convert TESTS ---------------- -otb_test_application(NAME apTvUtConvertBasic - APP Convert - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif - -out ${TEMP}/apTvUtConvertBasicOutput.tif float - VALID --compare-image ${NOTOL} - ${OTBAPP_BASELINE}/apTvUtConvertBasicOutput.tif - ${TEMP}/apTvUtConvertBasicOutput.tif -) - -otb_test_application(NAME apTuUtConvertExtendedFilename_writer - APP Convert - OPTIONS -in ${INPUTDATA}/ToulouseExtract_WithGeom.tif - -out ${TEMP}/apTvUtGeomExtendedFilename.tif?&gdal:co:TILED=YES&writegeom=false - ) - -otb_test_application(NAME apTvUtConvertWithScaling - APP Convert - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif - -out ${TEMP}/apTvUtConvertWithScalingOutput.tif - -type linear - VALID --compare-image ${NOTOL} - ${OTBAPP_BASELINE}/apTvUtConvertWithScalingOutput.tif - ${TEMP}/apTvUtConvertWithScalingOutput.tif -) - -otb_test_application(NAME apTvUtConvertExtendedFilename_readerGEOM - APP Convert - OPTIONS -in ${INPUTDATA}/ToulouseExtract_WithGeom.tif?&geom=${INPUTDATA}/ToulouseExtract_ModifiedGeom.geom - -out ${TEMP}/apTvUtGeomExtendedFilename.tif - VALID --compare-ascii ${EPSILON_7} - ${INPUTDATA}/ToulouseExtract_ModifiedGeom.geom - ${TEMP}/apTvUtGeomExtendedFilename.geom) - -otb_test_application(NAME apTvUtConvertSelectChannels - APP Convert - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif - -out ${TEMP}/apTvUtConvertSelectChannelsRgbOutput.tif - -channels rgb - -channels.rgb.red 2 - -channels.rgb.green 3 - -channels.rgb.blue 1 - -type linear - VALID --compare-image ${NOTOL} - ${OTBAPP_BASELINE}/apTvUtConvertSelectChannelsRgbOutput.tif - ${TEMP}/apTvUtConvertSelectChannelsRgbOutput.tif) - -otb_test_application(NAME apTvUtConvertMonoChannel - APP Convert - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif - -out ${TEMP}/apTvUtConvertMonoChannelOutput.tif - -channels grayscale - -type linear - VALID --compare-image ${NOTOL} - ${OTBAPP_BASELINE}/apTvUtConvertMonoChannelOutput.tif - ${TEMP}/apTvUtConvertMonoChannelOutput.tif) - #----------- DynamicConvert TESTS ------------ otb_test_application(NAME apTvUtDynamicConvertBasic APP DynamicConvert @@ -101,6 +41,20 @@ otb_test_application(NAME apTvUtDynamicConvertBasic ${OTBAPP_BASELINE}/apTvUtConvertSelectChannelsRgbOutput.tif ${TEMP}/apTvUtDynamicConvertOutput.tif) +otb_test_application(NAME apTuUtDynamicConvertExtendedFilename_writer + APP DynamicConvert + OPTIONS -in ${INPUTDATA}/ToulouseExtract_WithGeom.tif + -out ${TEMP}/apTvUtGeomExtendedFilename.tif?&gdal:co:TILED=YES&writegeom=false + ) + +otb_test_application(NAME apTvUtDynamicConvertExtendedFilename_readerGEOM + APP DynamicConvert + OPTIONS -in ${INPUTDATA}/ToulouseExtract_WithGeom.tif?&geom=${INPUTDATA}/ToulouseExtract_ModifiedGeom.geom + -out ${TEMP}/apTvUtGeomExtendedFilename.tif + VALID --compare-ascii ${EPSILON_7} + ${INPUTDATA}/ToulouseExtract_ModifiedGeom.geom + ${TEMP}/apTvUtGeomExtendedFilename.geom) + otb_test_application(NAME apTvUtDynamicConvertLog2 APP DynamicConvert OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif diff --git a/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx b/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx index 4b6bdffed57a5e9624c606371fa3ef63b78d932c..3328ea00c240302fc30afe9af46e6a2883328387 100644 --- a/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx +++ b/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx @@ -150,8 +150,6 @@ private: AddParameter(ParameterType_OutputImage, "out", "Output Image"); SetParameterDescription("out", "Radiometric indices output image"); - AddRAMParameter(); - AddParameter(ParameterType_Group, "channels", "Channels selection"); SetParameterDescription("channels", "Channels selection"); @@ -199,6 +197,8 @@ private: "* Soil:BI - Brightness index (Red, Green)\n" "* Soil:BI2 - Brightness index 2 (NIR, Red, Green)"); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); SetDocExampleParameterValue("list", "Vegetation:NDVI Vegetation:RVI Vegetation:IPVI"); diff --git a/Modules/Applications/AppMathParser/app/otbBandMath.cxx b/Modules/Applications/AppMathParser/app/otbBandMath.cxx index b738cdfa4f3646185004c2d520c4691af76570f2..fdcc05c795218158b44f82ed3d6a5d956ff44973 100644 --- a/Modules/Applications/AppMathParser/app/otbBandMath.cxx +++ b/Modules/Applications/AppMathParser/app/otbBandMath.cxx @@ -109,14 +109,14 @@ private: "Output image which is the result of the mathematical expressions on input" " image list operands."); - AddRAMParameter(); - AddParameter( ParameterType_String, "exp", "Expression"); SetParameterDescription( "exp", "The muParser mathematical expression to apply on input images." ); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue( "il", diff --git a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx index 70f8a6874dba5fc3d11f9bbb190a7e429e7edda9..15993a3c792b3fe49df9875349741cd448dd8a02 100644 --- a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx +++ b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx @@ -208,8 +208,6 @@ private: AddParameter( ParameterType_OutputImage, "out", "Output Image" ); SetParameterDescription( "out", "Output image." ); - AddRAMParameter(); - AddParameter( ParameterType_String, "exp", "Expressions" ); SetParameterDescription( "exp", @@ -230,6 +228,8 @@ private: ); MandatoryOff( "outcontext" ); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue( "il", diff --git a/Modules/Applications/AppMoments/app/otbLocalStatisticExtraction.cxx b/Modules/Applications/AppMoments/app/otbLocalStatisticExtraction.cxx index 388a96d55ae98537ddfc1933d39f4f87acf65278..c5ebc83f243454625112ae0d85d2bb03ad714141 100644 --- a/Modules/Applications/AppMoments/app/otbLocalStatisticExtraction.cxx +++ b/Modules/Applications/AppMoments/app/otbLocalStatisticExtraction.cxx @@ -79,13 +79,13 @@ SetParameterDescription("channel", "The selected channel index"); SetDefaultParameterInt("channel", 1); SetMinimumParameterIntValue("channel", 1); -AddRAMParameter(); - AddParameter(ParameterType_Int, "radius", "Neighborhood radius"); SetParameterDescription("radius", "The computational window radius."); SetMinimumParameterIntValue("radius",1); SetDefaultParameterInt("radius",3); +AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); SetDocExampleParameterValue("channel", "1"); diff --git a/Modules/Applications/AppMorphology/app/otbBinaryMorphologicalOperation.cxx b/Modules/Applications/AppMorphology/app/otbBinaryMorphologicalOperation.cxx index 788cb5e191f94e0b0b8e62a525f292d273c69561..44a1ccb002e525efd9ff6d23d829af4ec8ca4e87 100644 --- a/Modules/Applications/AppMorphology/app/otbBinaryMorphologicalOperation.cxx +++ b/Modules/Applications/AppMorphology/app/otbBinaryMorphologicalOperation.cxx @@ -101,8 +101,6 @@ SetParameterDescription( "channel" , "The selected channel index" ); SetDefaultParameterInt( "channel" , 1 ); SetMinimumParameterIntValue( "channel" , 1 ); -AddRAMParameter(); - AddParameter( ParameterType_Choice , "structype" , "Type of structuring element" ); SetParameterDescription( "structype" , @@ -166,6 +164,8 @@ SetParameterDescription( "filter.closing.foreval" , "Set the foreground value, default is 1.0." ); SetDefaultParameterFloat( "filter.closing.foreval" , 1.0 ); +AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); SetDocExampleParameterValue("out", "opened.tif"); diff --git a/Modules/Applications/AppMorphology/app/otbGrayScaleMorphologicalOperation.cxx b/Modules/Applications/AppMorphology/app/otbGrayScaleMorphologicalOperation.cxx index 1176a8127cc55b8507476fbe74bb8f8449a2803f..f3d70518b671224939cca6ea90a09d2751e91762 100644 --- a/Modules/Applications/AppMorphology/app/otbGrayScaleMorphologicalOperation.cxx +++ b/Modules/Applications/AppMorphology/app/otbGrayScaleMorphologicalOperation.cxx @@ -97,8 +97,6 @@ SetParameterDescription("channel", "The selected channel index"); SetDefaultParameterInt("channel", 1); SetMinimumParameterIntValue("channel", 1); -AddRAMParameter(); - AddParameter(ParameterType_Choice, "structype", "Structuring Element Type"); SetParameterDescription("structype", "Choice of the structuring element type"); AddParameter(ParameterType_Int, "xradius", "Structuring element X radius"); @@ -120,6 +118,8 @@ AddChoice("filter.erode", "Erode"); AddChoice("filter.opening", "Opening"); AddChoice("filter.closing", "Closing"); +AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); SetDocExampleParameterValue("out", "opened.tif"); diff --git a/Modules/Applications/AppMorphology/app/otbMorphologicalClassification.cxx b/Modules/Applications/AppMorphology/app/otbMorphologicalClassification.cxx index bd47a89c76fa513d62c17a7226df82582de5527b..4e80186a99efd8a36f6b721c0a42f8267585910b 100644 --- a/Modules/Applications/AppMorphology/app/otbMorphologicalClassification.cxx +++ b/Modules/Applications/AppMorphology/app/otbMorphologicalClassification.cxx @@ -95,7 +95,7 @@ private: "\n" ":math:`f(n) = \\begin{cases} \\stackrel{\\smile}{k} & : f-\\psi_{N}(f)>\\sigma \\\\ \\stackrel{\\frown}{k} & : \\psi_{N}(f)-f>\\sigma \\\\ \\bar{k} & : \\mid f - \\psi_{N}(f) \\mid \\leq \\sigma \\end{cases}`" "\n\n" - "The output is a labeled image (0 : Flat, 1 : Convex, 2 : Concave)" ); + "The output is a labeled image (0: Flat, 1: Convex, 2: Concave)" ); SetDocLimitations( "Generation of the morphological classification is not streamable, " "pay attention to this fact when setting the radius size of the " @@ -110,9 +110,7 @@ private: SetParameterDescription( "in" , "The input image to be classified." ); AddParameter( ParameterType_OutputImage , "out" , "Output Image" ); - SetParameterDescription( "out", - "The output classified image with 3 different values (0 : Flat, " - "1 : Convex, 2 : Concave)" ); + SetParameterDescription( "out", "The output classified image with 3 different values (0: Flat, 1: Convex, 2: Concave)" ); AddParameter( ParameterType_Int , "channel" , "Selected Channel" ); SetParameterDescription( "channel" , @@ -120,8 +118,6 @@ private: SetDefaultParameterInt( "channel" , 1 ); SetMinimumParameterIntValue( "channel" , 1 ); - AddRAMParameter(); - // Structuring Element (Ball | Cross) AddParameter( ParameterType_Choice , "structype" , "Structuring Element Type" ); @@ -143,6 +139,8 @@ private: SetDefaultParameterFloat( "sigma" , 0.5 ); SetMinimumParameterFloatValue( "sigma" , 0 ); + AddRAMParameter(); + SetDocExampleParameterValue( "in", "ROI_IKO_PAN_LesHalles.tif" ); SetDocExampleParameterValue( "channel", "1" ); SetDocExampleParameterValue( "structype", "ball" ); diff --git a/Modules/Applications/AppMorphology/app/otbMorphologicalMultiScaleDecomposition.cxx b/Modules/Applications/AppMorphology/app/otbMorphologicalMultiScaleDecomposition.cxx index 052e8d9be3cf5eb312f5b542e4a47bec2a3841c4..934d2996d16a30f6b07d8e6f9040663c15037238 100644 --- a/Modules/Applications/AppMorphology/app/otbMorphologicalMultiScaleDecomposition.cxx +++ b/Modules/Applications/AppMorphology/app/otbMorphologicalMultiScaleDecomposition.cxx @@ -119,8 +119,6 @@ private: SetDefaultParameterInt( "channel", 1 ); SetMinimumParameterIntValue( "channel", 1 ); - AddRAMParameter(); - // Strucring Element (Ball | Cross) AddParameter( ParameterType_Choice, "structype", "Structuring Element Type" ); SetParameterDescription( "structype", "Choice of the structuring element type" ); @@ -132,7 +130,7 @@ private: SetDefaultParameterInt( "radius", 5 ); SetMinimumParameterIntValue( "radius", 1 ); - AddParameter( ParameterType_Int, "step", "Radius step." ); + AddParameter( ParameterType_Int, "step", "Radius step" ); SetParameterDescription( "step", "Radius step along the profile (in pixels)" ); SetDefaultParameterInt( "step", 1 ); SetMinimumParameterIntValue( "step", 1 ); @@ -142,6 +140,8 @@ private: SetDefaultParameterInt( "levels", 1 ); SetMinimumParameterIntValue( "levels", 1 ); + AddRAMParameter(); + SetDocExampleParameterValue("in", "ROI_IKO_PAN_LesHalles.tif"); SetDocExampleParameterValue("structype", "ball"); SetDocExampleParameterValue("channel", "1"); diff --git a/Modules/Applications/AppMorphology/app/otbMorphologicalProfilesAnalysis.cxx b/Modules/Applications/AppMorphology/app/otbMorphologicalProfilesAnalysis.cxx index a7bc15c56bfde1cc0cd1615327be8810a50f9b74..ae3c31abac736608f76fd892662613504159dfb8 100644 --- a/Modules/Applications/AppMorphology/app/otbMorphologicalProfilesAnalysis.cxx +++ b/Modules/Applications/AppMorphology/app/otbMorphologicalProfilesAnalysis.cxx @@ -78,28 +78,29 @@ private: // Documentation SetDocName( "Morphological Profiles Analysis" ); - SetDocLongDescription( "This algorithm is derived from the following publication:\n" - "\n" + SetDocLongDescription( "This algorithm is derived from the following publication:\n\n" + "Martino Pesaresi and Jon Alti Benediktsson, Member, IEEE: A new approach\n" "for the morphological segmentation of high resolution satellite imagery.\n" "IEEE Transactions on geoscience and remote sensing, vol. 39, NO. 2,\n" - "February 2001, p. 309-320.\n" - "\n" - "Depending of the profile selection, the application provides::\n\n" - "- The multi scale geodesic morphological opening or closing profile of the input image.\n" - "- The multi scale derivative of the opening or closing profile.\n" - "- The parameter (called characteristic) of the maximum derivative value of the multi scale closing or opening profile for which this maxima occurs.\n" - "- The labeled classification of the input image.\n" - "\n" - "The behavior of the classification is :\n" - "\n" + "February 2001, p. 309-320.\n\n" + + "Depending of the profile selection, the application provides:\n\n" + + "* The multi scale geodesic morphological opening or closing profile of the input image.\n" + "* The multi scale derivative of the opening or closing profile.\n" + "* The parameter (called characteristic) of the maximum derivative value of the multi scale closing or opening profile for which this maxima occurs.\n" + "* The labeled classification of the input image.\n\n" + + "The behavior of the classification is:\n\n" + "Given :math:`x_1` and :math:`x_2` two membership values,\n" ":math:`L_1, L_2` two labels associated, and :math:`\\sigma` a tolerance\n" "value, the following decision rule is applied:\n" "\n" ":math:`L = \\begin{cases} L_{1} & : x_{1}>x_{2} \\quad and \\quad x_{1}>\\sigma \\\\ L_{2} & : x_{2}>x_{1} \\quad and \\quad x_{2}>\\sigma \\\\ 0 & : otherwise. \\end{cases}` \n" "\n" - "The output image can be :" + "The output image can be:" "- A :math:`N` multi band image for the opening/closing normal or derivative profiles.\n" "- A mono band image for the opening/closing characteristics.\n" "- A labeled image for the classification." ); @@ -121,8 +122,6 @@ private: SetDefaultParameterInt( "channel", 1 ); SetMinimumParameterIntValue( "channel", 1 ); - AddRAMParameter(); - // Structuring Element (Ball | Cross) AddParameter( ParameterType_Choice, "structype", "Structuring Element Type" ); SetParameterDescription( "structype", "Choice of the structuring element type" ); @@ -139,7 +138,7 @@ private: SetDefaultParameterInt( "radius", 5 ); SetMinimumParameterIntValue( "radius", 1 ); - AddParameter( ParameterType_Int, "step", "Radius step." ); + AddParameter( ParameterType_Int, "step", "Radius step" ); SetParameterDescription( "step", "Radius step along the profile (in pixels)" ); SetDefaultParameterInt( "step", 1 ); SetMinimumParameterIntValue( "step", 1 ); @@ -160,6 +159,8 @@ private: SetDefaultParameterFloat( "profile.classification.sigma", 1 ); SetMinimumParameterFloatValue( "profile.classification.sigma", 0 ); + AddRAMParameter(); + SetDocExampleParameterValue( "in", "ROI_IKO_PAN_LesHalles.tif" ); SetDocExampleParameterValue( "channel", "1" ); SetDocExampleParameterValue( "structype", "ball" ); @@ -175,7 +176,7 @@ private: void DoUpdateParameters() override { - // Nothing to do here : all parameters are independent + // Nothing to do here: all parameters are independent } void DoExecute() override diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx index 83bc42529266966c872d062d540d1c0f287f1679..5d17c47f07529c78a681f7f68d7b56552deb4942 100644 --- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx +++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx @@ -133,12 +133,12 @@ private: SetDocLongDescription("The application allows converting pixel values from DN (for Digital Numbers) to reflectance. Calibrated values are called surface reflectivity and its values lie in the range [0, 1].\nThe first level is called Top Of Atmosphere (TOA) reflectivity. It takes into account the sensor gain, sensor spectral response and the solar illuminations.\nThe second level is called Top Of Canopy (TOC) reflectivity. In addition to sensor gain and solar illuminations, it takes into account the optical thickness of the atmosphere, the atmospheric pressure, the water vapor amount, the ozone amount, as well as the composition and amount of aerosol gasses.\nIt is also possible to indicate an AERONET file which contains atmospheric parameters (version 1 and version 2 of Aeronet file are supported. Note that computing TOC reflectivity will internally compute first TOA and then TOC reflectance. \n" "\n--------------------------\n\n" "If the sensor is not supported by the metadata interface factory of OTB, users still have the possibility to give the needed parameters to the application.\n" -"For TOA conversion, these parameters are : \n" +"For TOA conversion, these parameters are: \n" "- day and month of acquisition, or flux normalization coefficient;\n" "- sun elevation angle;\n" "- gains and biases, one pair of values for each band (passed by a file);\n" "- solar illuminations, one value for each band (passed by a file).\n\n" -"For the conversion from DN (for Digital Numbers) to spectral radiance (or 'TOA radiance') L, the following formula is used :\n\n" +"For the conversion from DN (for Digital Numbers) to spectral radiance (or 'TOA radiance') L, the following formula is used:\n\n" "(1)\tL(b) = DN(b)/gain(b)+bias(b)\t(in W/m2/steradians/micrometers)\twith b being a band ID.\n\n" @@ -147,16 +147,16 @@ private: "Note that sometimes, the values provided by certain metadata files assume the formula L(b) = gain(b)*DC(b)+bias(b).\n" "In this case, be sure to provide the inverse gain values so that the application can correctly interpret them.\n\n" -"In order to convert TOA radiance to TOA reflectance, the following formula is used :\n\n" +"In order to convert TOA radiance to TOA reflectance, the following formula is used:\n\n" -"(2)\tR(b) = (pi*L(b)*d*d) / (ESUN(b)*cos(θ))\t(no dimension)\twhere : \n\n" +"(2)\tR(b) = (pi*L(b)*d*d) / (ESUN(b)*cos(θ))\t(no dimension)\twhere: \n\n" "- L(b) is the spectral radiance for band b \n" "- pi is the famous mathematical constant (3.14159...) \n" "- d is the earth-sun distance (in astronomical units) and depends on the acquisition's day and month \n" "- ESUN(b) is the mean TOA solar irradiance (or solar illumination) in W/m2/micrometers\n" "- θ is the solar zenith angle in degrees.\n\n" -"Note that the application asks for the solar elevation angle, and will perform the conversion to the zenith angle itself (zenith_angle = 90 - elevation_angle , units : degrees).\n" +"Note that the application asks for the solar elevation angle, and will perform the conversion to the zenith angle itself (zenith_angle = 90 - elevation_angle , units: degrees).\n" "Note also that ESUN(b) not only depends on the band b, but also on the spectral sensitivity of the sensor in this particular band. " "In other words, the influence of spectral sensitivities is included within the ESUN different values.\n" "These values are provided by the user thanks to a txt file following the same convention as before.\n" @@ -191,8 +191,6 @@ private: AddParameter(ParameterType_OutputImage, "out", "Output"); SetParameterDescription("out","Output calibrated image filename"); - AddRAMParameter(); - AddParameter(ParameterType_Choice, "level", "Calibration Level"); AddChoice("level.toa", "Image to Top Of Atmosphere reflectance"); AddChoice("level.toatoim", "TOA reflectance to Image"); @@ -345,6 +343,8 @@ private: MandatoryOff("atmo.pixsize"); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "QB_1_ortho.tif"); SetDocExampleParameterValue("level", "toa"); diff --git a/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx b/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx index 49e8d7ffd92eacd6a82626739cd0972748259be9..76b8fca0489b24d0847876fa4f5e83d2c870d291 100644 --- a/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx +++ b/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx @@ -66,8 +66,6 @@ private: AddParameter(ParameterType_OutputImage, "out", "Output Image"); SetParameterDescription("out", "Output calibrated image. This image contains the backscatter (sigmaNought) of the input image."); - AddRAMParameter(); - AddParameter(ParameterType_Bool, "noise", "Disable Noise"); SetParameterDescription("noise", "Flag to disable noise. For 5.2.0 release, the noise values are only read by TerraSARX product."); @@ -83,6 +81,8 @@ private: SetParameterDescription("lut.dn","Use DN value lookup value from product metadata"); SetDefaultParameterInt("lut", 0); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "RSAT_imagery_HH.tif"); SetDocExampleParameterValue("out", "SarRadiometricCalibration.tif" ); diff --git a/Modules/Applications/AppSARUtils/app/otbDespeckle.cxx b/Modules/Applications/AppSARUtils/app/otbDespeckle.cxx index ed17af2e2cee6689e39ec4fb73c55b193bc42fbf..a3d2bf8593c9c10225dd94420e15e0e276d09be0 100644 --- a/Modules/Applications/AppSARUtils/app/otbDespeckle.cxx +++ b/Modules/Applications/AppSARUtils/app/otbDespeckle.cxx @@ -105,8 +105,6 @@ private: AddParameter(ParameterType_OutputImage, "out", "Output Image"); SetParameterDescription("out", "Output image."); - AddRAMParameter(); - AddParameter(ParameterType_Choice,"filter","Speckle filtering method"); AddChoice("filter.lee","Lee"); @@ -157,6 +155,7 @@ private: SetDefaultParameterInt("filter.gammamap.rad", 1); SetDefaultParameterFloat("filter.gammamap.nblooks", 1.); + AddRAMParameter(); // Doc example parameter settings SetDocExampleParameterValue("in", "sar.tif"); diff --git a/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx index 637110043ea7e2a03670e03cca92f8bda9c494d2..2ea55ae90ffb41038a2d47762a20d2af3c35a9e6 100644 --- a/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx @@ -144,7 +144,7 @@ private: "The application can output the overall Hoover scores along with colored" "images of the MS and GT segmentation showing the state of each region " "(correct detection, over-segmentation, under-segmentation, missed).\n\n" - "The Hoover metrics are described in : Hoover et al., \"An experimental" + "The Hoover metrics are described in: Hoover et al., \"An experimental" " comparison of range image segmentation algorithms\", IEEE PAMI vol. 18, no. 7, July 1996."); SetDocLimitations("None"); SetDocAuthors("OTB-Team"); diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx index 44056bd97ca2019c42da541be5a801877872a766..ec561e72132abf04d3fae0db2e9ad04cca4b6f89 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx @@ -243,7 +243,7 @@ private: "Please also note that the output image type should be set to uint32 to" " ensure that there are enough labels available.\n\n" "The output of this application can be passed to the" - " LSMSSmallRegionMerging [3] or LSMSVectorization [4] applications to" + " LSMSSmallRegionsMerging [3] or LSMSVectorization [4] applications to" " complete the LSMS workflow."); SetDocLimitations("This application is part of the Large-Scale Mean-Shift segmentation" " workflow (LSMS) [1] and may not be suited for any other purpose. This" diff --git a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx index 9d11b930460ff5dd94f2503aa0234bc62161f842..5f0aa2b53bbff73b3f468ca023d62f00533bce03 100644 --- a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx @@ -58,9 +58,9 @@ private: // Documentation SetDocName("Large-Scale MeanShift"); SetDocLongDescription("This application chains together the 4 steps of the " - "MeanShit framework, that is the MeanShiftSmoothing [1], the " - "LSMSSegmentation [2], the LSMSSmallRegionsMerging [3] and the " - "LSMSVectorization [4].\n\n" + "MeanShit framework, that is the MeanShiftSmoothing, the " + "LSMSSegmentation, the LSMSSmallRegionsMerging and the " + "LSMSVectorization.\n\n" "This application can be a preliminary step for an object-based analysis.\n\n" "It generates a vector data file containing the regions extracted with " "the MeanShift algorithm. The spatial and range radius parameters allow " @@ -75,10 +75,10 @@ private: ); SetDocLimitations("None"); SetDocAuthors("OTB-Team"); - SetDocSeeAlso("[1] MeanShiftSmoothing\n" - "[2] LSMSSegmentation\n" - "[3] LSMSSmallRegionsMerging\n" - "[4] LSMSVectorization"); + SetDocSeeAlso("MeanShiftSmoothing\n" + "LSMSSegmentation\n" + "LSMSSmallRegionsMerging\n" + "LSMSVectorization"); AddDocTag(Tags::Segmentation); AddDocTag("LSMS"); diff --git a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx index 1d30963c546efd88ebc84ec613144f2463a6ade8..f0a67b1632868fd05dc3c798e07099388ea0e8e3 100644 --- a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx +++ b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx @@ -129,8 +129,6 @@ private: SetParameterDescription( "foutpos", " This output image contains the 2D displacement between the input pixel spatial position and the final position after convergence. Floating point encoding is mandatory. This output can be used as input image (in) of the LSMSSegmentation application [4,5]."); MandatoryOff("foutpos"); - AddRAMParameter(); - AddParameter(ParameterType_Int, "spatialr", "Spatial radius"); SetParameterDescription("spatialr", "Radius of the spatial neighborhood for averaging. Higher values will result in more smoothing and higher processing time."); SetDefaultParameterInt("spatialr", 5); @@ -159,9 +157,11 @@ private: SetMinimumParameterFloatValue("rangeramp", 0); MandatoryOff("rangeramp"); - AddParameter(ParameterType_Bool, "modesearch", "Mode search."); + AddParameter(ParameterType_Bool, "modesearch", "Mode search"); SetParameterDescription("modesearch", "If activated pixel iterative convergence is stopped if the path crosses an already converged pixel. Be careful, with this option, the result will slightly depend on thread number and the results will not be stable (see [4] for more details)."); + AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "maur_rgb.png"); SetDocExampleParameterValue("fout", "smooth.tif"); diff --git a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx index b3594c3b38014b89e018b923e0ec17c3a61cf50c..b49467c19ba962aa1c5d97730bd75600084cbf91 100644 --- a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx @@ -209,7 +209,7 @@ private: SetParameterDescription("filter.cc", "Simple pixel-based connected-components algorithm with a user-defined connection condition."); AddParameter(ParameterType_String, "filter.cc.expr", "Condition"); - SetParameterDescription("filter.cc.expr", "User defined connection condition, written as a mathematical expression. Available variables are p(i)b(i), intensity_p(i) and distance (example of expression : distance < 10 )"); + SetParameterDescription("filter.cc.expr", "User defined connection condition, written as a mathematical expression. Available variables are p(i)b(i), intensity_p(i) and distance (example of expression: distance < 10 )"); // Watershed AddChoice("filter.watershed","Watershed"); @@ -247,7 +247,7 @@ private: SetParameterDescription("filter.mprofiles.start","Initial radius of the structuring element (in pixels)"); SetDefaultParameterInt("filter.mprofiles.start",1); SetMinimumParameterIntValue("filter.mprofiles.start",1); - AddParameter(ParameterType_Int,"filter.mprofiles.step","Radius step."); + AddParameter(ParameterType_Int,"filter.mprofiles.step","Radius step"); SetParameterDescription("filter.mprofiles.step","Radius step along the profile (in pixels)"); SetDefaultParameterInt("filter.mprofiles.step",1); SetMinimumParameterIntValue("filter.mprofiles.step",1); diff --git a/Modules/Applications/AppStereo/app/otbGeneratePlyFile.cxx b/Modules/Applications/AppStereo/app/otbGeneratePlyFile.cxx index d1fbc1895f247ec6072081e58e00ac59930651db..8fc318b9d18ee70249755aa443379e71dee2a573 100644 --- a/Modules/Applications/AppStereo/app/otbGeneratePlyFile.cxx +++ b/Modules/Applications/AppStereo/app/otbGeneratePlyFile.cxx @@ -64,13 +64,14 @@ private: " or CloudCompare [3]\n\n" "This application is part of the stereo reconstruction framework. The " "input data can be produced by the application DisparityMapToElevationMap.\n\n" - "There are two types of supported input images:\n" - " * A DEM image, with a ground projection, containing elevation values. " + "There are two types of supported input images:\n\n" + + "* A DEM image, with a ground projection, containing elevation values. " "Each elevation value can be considered as a 3D point.\n" - " * A 3D grid image, containing 5 bands (the first 3 are the 3D " + "* A 3D grid image, containing 5 bands (the first 3 are the 3D " "coordinates of each point, the 5th is a validity mask where valid values" - " are larger or equal to 1)\n" - "\n" + " are larger or equal to 1)\n\n" + "The user shall also give a support image that contains color values for" " each 3D point. The color values will be embedded in the PLY file."); SetDocLimitations("The input DEM image has to entirely fit into memory."); diff --git a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx index 840b158b55c394e65ce2901e351361d9d7018f9d..bfcf66c01d22a4971f2b5ba45145dbf62e081a17 100644 --- a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx @@ -327,14 +327,14 @@ private: "This application is chaining different processing steps. Some of them " "are also performed by other applications in the stereo-reconstruction " "framework:\n\n" - "* StereoRectificationGridGenerator [1] : for the generation of deformation grids\n" - "* GridBasedImageResampling [2] : resampling into epipolar geometry\n" - "* BlockMatching [3] : estimation of dense disparity maps\n\n" + "* StereoRectificationGridGenerator: for the generation of deformation grids\n" + "* GridBasedImageResampling: resampling into epipolar geometry\n" + "* BlockMatching: estimation of dense disparity maps\n\n" "The pipeline executes the following steps on each stereo pair:\n\n" "* compute the epipolar displacement grids from the stereo pair (direct and inverse)\n" "* resample the stereo pair into epipolar geometry using BCO interpolation\n" - "* create masks for each epipolar image : remove black borders and resample input masks\n" + "* create masks for each epipolar image: remove black borders and resample input masks\n" "* compute horizontal disparities with a block matching algorithm\n" "* refine disparities to sub-pixel precision with a dichotomy algorithm\n" "* apply an optional median filter\n" @@ -346,9 +346,9 @@ private: "DEM cell can be chosen between maximum, minimum and average."); SetDocLimitations(" "); SetDocAuthors("OTB-Team"); - SetDocSeeAlso("[1] StereoRectificationGridGenerator\n" - "[2] GridBasedImageResampling\n" - "[3] BlockMatching"); + SetDocSeeAlso("StereoRectificationGridGenerator\n" + "GridBasedImageResampling\n" + "BlockMatching"); AddDocTag(Tags::Stereo); @@ -362,7 +362,7 @@ private: AddParameter(ParameterType_String, "input.co", "Couples list"); SetParameterDescription("input.co","List of index of couples im image list." - " Couples must be separated by a comma (index start at 0). For example :" + " Couples must be separated by a comma (index start at 0). For example:" " 0 1,1 2 will process a first couple composed of the first and the" " second image in image list, then the second and the third image\n. " "Note that images are handled by pairs. If left empty, couples are " @@ -390,7 +390,7 @@ private: SetParameterString("map","wgs"); AddParameter(ParameterType_Float, "output.res","Output resolution"); - SetParameterDescription("output.res","Spatial sampling distance of the output elevation : the cell size (in m)"); + SetParameterDescription("output.res","Spatial sampling distance of the output elevation: the cell size (in m)"); SetDefaultParameterFloat("output.res",1.); AddParameter(ParameterType_Float, "output.nodata","NoData value"); diff --git a/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx b/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx index b2ac4174e3538e02724a5a6ceacfb292a7c882e3..b9b6fb008b41c6e05130f25c81176165402600ab 100644 --- a/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx @@ -189,7 +189,7 @@ private: " zoomed-in (scale < 1) or zoomed-out (scale > 1) epipolar images."); SetDefaultParameterFloat("epi.scale",1.); - AddParameter(ParameterType_Int,"epi.step","Step of the deformation grid (in nb. of pixels)"); + AddParameter(ParameterType_Int,"epi.step","Step of the deformation grid (in number of pixels)"); SetParameterDescription("epi.step","Stereo-rectification deformation grid " "only varies slowly. Therefore, it is recommended to use a coarser grid " "(higher step value) in case of large images"); diff --git a/Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx b/Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx index 0f0373fb21adeb4afd1d9cb743af604d23f13d8d..e7e1bb766876ba6a3542e1caa5471b5e16a1bb6e 100644 --- a/Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx +++ b/Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx @@ -120,8 +120,6 @@ SetDefaultParameterInt("step", 1); SetMinimumParameterIntValue("step", 1); MandatoryOff("step"); -AddRAMParameter(); - AddParameter(ParameterType_Group, "parameters", "Texture feature parameters"); SetParameterDescription("parameters","This group of parameters allows one to define " "texture parameters."); @@ -183,6 +181,7 @@ SetParameterDescription("out", "Output image containing the selected texture fea MandatoryOff("out"); EnableParameter("out"); +AddRAMParameter(); // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); diff --git a/Modules/Applications/AppTextures/app/otbSFSTextureExtraction.cxx b/Modules/Applications/AppTextures/app/otbSFSTextureExtraction.cxx index 13ade82049253a6e60d39e36e34b126b735ea904..90e62b115da63b84feb9c336ed0f710756a674fd 100644 --- a/Modules/Applications/AppTextures/app/otbSFSTextureExtraction.cxx +++ b/Modules/Applications/AppTextures/app/otbSFSTextureExtraction.cxx @@ -89,8 +89,6 @@ SetParameterDescription("channel", "The selected channel index"); SetDefaultParameterInt("channel", 1); SetMinimumParameterIntValue("channel", 1); -AddRAMParameter(); - AddParameter(ParameterType_Group, "parameters", "Texture feature parameters"); SetParameterDescription("parameters","This group of parameters allows one to define SFS texture " "parameters. The available texture features are SFS'Length, SFS'Width, SFS'PSI, SFS'W-Mean, " @@ -119,6 +117,8 @@ SetDefaultParameterInt("parameters.maxcons", 5); AddParameter(ParameterType_OutputImage, "out", "Feature Output Image"); SetParameterDescription("out", "Output image containing the SFS texture features."); +AddRAMParameter(); + // Doc example parameter settings SetDocExampleParameterValue("in", "qb_RoadExtract.tif"); SetDocExampleParameterValue("channel", "1"); diff --git a/Modules/Core/Common/include/otbMath.h b/Modules/Core/Common/include/otbMath.h index 966b5a12ddfb354a6844eabc0a7762e3935fe021..16339c734dcd34f7d7bb3cb60bed81f94b2f8331 100644 --- a/Modules/Core/Common/include/otbMath.h +++ b/Modules/Core/Common/include/otbMath.h @@ -40,54 +40,54 @@ namespace otb { /** Define constants if not define in the "cmath" */ /* Some useful constants. */ -const double CONST_E = 2.7182818284590452354; /* e */ -const double CONST_LOG2E = 1.4426950408889634074; /* log_2 e */ -const double CONST_LOG10E = 0.43429448190325182765; /* log_10 e */ -const double CONST_LN2 = 0.69314718055994530942; /* log_e 2 */ -const double CONST_LN10 = 2.30258509299404568402; /* log_e 10 */ -const double CONST_PI = 3.14159265358979323846; /* pi */ -const double CONST_PI_2 = 1.57079632679489661923; /* pi/2 */ -const double CONST_PI_4 = 0.78539816339744830962; /* pi/4 */ -const double CONST_PI_8 = 0.39269908169872415481; /* pi/8 */ -const double CONST_1_PI = 0.31830988618379067154; /* 1/pi */ -const double CONST_2_PI = 0.63661977236758134308; /* 2/pi */ -const double CONST_2PI = 6.28318530717958647693; /* 2*pi */ -const double CONST_PI_180 = 0.01745329251994329577; /* pi/180 */ -const double CONST_180_PI = 57.2957795130823208768; /* 180/pi */ -const double CONST_LNPI = std::log(CONST_PI); /* ln(pi)*/ -const double CONST_SQRTPI = std::sqrt(CONST_PI); /* sqrt(pi)*/ -const double CONST_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */ -const double CONST_SQRT2 = 1.41421356237309504880; /* sqrt(2) */ -const double CONST_SQRT1_2 = 0.70710678118654752440; /* 1/sqrt(2) */ -const double CONST_SQRT3 = 1.73205080756887729353; /* sqrt(3) */ -const double CONST_EULER = 0.57721566490153286060; /* euler constant*/ +constexpr double CONST_E = 2.7182818284590452354; /* e */ +constexpr double CONST_LOG2E = 1.4426950408889634074; /* log_2 e */ +constexpr double CONST_LOG10E = 0.43429448190325182765; /* log_10 e */ +constexpr double CONST_LN2 = 0.69314718055994530942; /* log_e 2 */ +constexpr double CONST_LN10 = 2.30258509299404568402; /* log_e 10 */ +constexpr double CONST_PI = 3.14159265358979323846; /* pi */ +constexpr double CONST_PI_2 = CONST_PI / 2.0; /* pi/2 */ +constexpr double CONST_PI_4 = CONST_PI / 4.0; /* pi/4 */ +constexpr double CONST_PI_8 = CONST_PI / 8.0; /* pi/8 */ +constexpr double CONST_1_PI = 1.0 / CONST_PI; /* 1/pi */ +constexpr double CONST_2_PI = 2.0 / CONST_PI; /* 2/pi */ +constexpr double CONST_2PI = 2.0 * CONST_PI; /* 2*pi */ +constexpr double CONST_PI_180 = CONST_PI / 180.0; /* pi/180 */ +constexpr double CONST_180_PI = 180.0 / CONST_PI; /* 180/pi */ +const double CONST_LNPI = std::log(CONST_PI); /* ln(pi)*/ +const double CONST_SQRTPI = std::sqrt(CONST_PI); /* sqrt(pi)*/ +constexpr double CONST_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */ +constexpr double CONST_SQRT2 = 1.41421356237309504880; /* sqrt(2) */ +constexpr double CONST_SQRT1_2 = 0.70710678118654752440; /* 1/sqrt(2) */ +constexpr double CONST_SQRT3 = 1.73205080756887729353; /* sqrt(3) */ +constexpr double CONST_EULER = 0.57721566490153286060; /* euler constant*/ /* The above constants are not adequate for computation using `long double's. Therefore we provide as an extension constants with similar names as a GNU extension. Provide enough digits for the 128-bit IEEE quad. */ #ifdef __USE_GNU -const long double CONST_El = 2.7182818284590452353602874713526625L; /* e */ -const long double CONST_LOG2El = 1.4426950408889634073599246810018921L; /* log_2 e */ -const long double CONST_LOG10El = 0.4342944819032518276511289189166051L; /* log_10 e */ -const long double CONST_LN2l = 0.6931471805599453094172321214581766L; /* log_e 2 */ -const long double CONST_LN10l = 2.3025850929940456840179914546843642L; /* log_e 10 */ -const long double CONST_PIl = 3.1415926535897932384626433832795029L; /* pi */ -const long double CONST_PI_2l = 1.5707963267948966192313216916397514L; /* pi/2 */ -const long double CONST_PI_4l = 0.7853981633974483096156608458198757L; /* pi/4 */ -const long double CONST_PI_8l = 0.3926990816987241548078304229099379L; /* pi/8 */ -const long double CONST_2_PIl = 0.6366197723675813430755350534900574L; /* 2/pi */ -const long double CONST_2_SQRTPIl = 1.1283791670955125738961589031215452L; /* 2/sqrt(pi) */ -const long double CONST_2PIl = 6.2831853071795864769252867665590058L; /* 2*pi */ -const long double CONST_PI_180l = 0.0174532925199432957692369076848861L; /* pi/180 */ -const long double CONST_180_PIl = 57.295779513082320876798154814105170L; /* 180/pi */ +constexpr long double CONST_El = 2.7182818284590452353602874713526625L; /* e */ +constexpr long double CONST_LOG2El = 1.4426950408889634073599246810018921L; /* log_2 e */ +constexpr long double CONST_LOG10El = 0.4342944819032518276511289189166051L; /* log_10 e */ +constexpr long double CONST_LN2l = 0.6931471805599453094172321214581766L; /* log_e 2 */ +constexpr long double CONST_LN10l = 2.3025850929940456840179914546843642L; /* log_e 10 */ +constexpr long double CONST_PIl = 3.1415926535897932384626433832795029L; /* pi */ +constexpr long double CONST_PI_2l = CONST_PI / 2.0L; /* pi/2 */ +constexpr long double CONST_PI_4l = CONST_PI / 4.0L; /* pi/4 */ +constexpr long double CONST_PI_8l = CONST_PI / 8.0L; /* pi/8 */ +constexpr long double CONST_2_PIl = 2.0L / CONST_PI; /* 2/pi */ +constexpr long double CONST_2_SQRTPIl = 1.1283791670955125738961589031215452L; /* 2/sqrt(pi) */ +constexpr long double CONST_2PIl = 2.0L * CONST_PI; /* 2*pi */ +constexpr long double CONST_PI_180l = CONST_PI / 180.0L; /* pi/180 */ +constexpr long double CONST_180_PIl = 180.0L / CONST_PI; /* 180/pi */ // Defined but not used? //const long double CONST_LNPIl = std::log(CONST_PIl); /* ln(pi)*/ //const long double CONST_SQRTPIl = std::sqrt(CONST_PIl); /* sqrt(pi)*/ -const long double CONST_SQRT2l = 1.4142135623730950488016887242096981L; /* sqrt(2) */ -const long double CONST_SQRT1_2l = 0.7071067811865475244008443621048490L; /* 1/sqrt(2) */ -const long double CONST_SQRT3l = 1.7320508075688772935274463415058724L; /* sqrt(3) */ -const long double CONST_EULERl = 0.5772156649015328606065120900824024L; /* euler constant*/ +constexpr long double CONST_SQRT2l = 1.4142135623730950488016887242096981L; /* sqrt(2) */ +constexpr long double CONST_SQRT1_2l = 0.7071067811865475244008443621048490L; /* 1/sqrt(2) */ +constexpr long double CONST_SQRT3l = 1.7320508075688772935274463415058724L; /* sqrt(3) */ +constexpr long double CONST_EULERl = 0.5772156649015328606065120900824024L; /* euler constant*/ #endif diff --git a/Modules/Core/ImageBase/test/otbExtractROITestMetaData.cxx b/Modules/Core/ImageBase/test/otbExtractROITestMetaData.cxx index 88c593971cf8ee30556a545453f7a42f36b6423b..fcb2afd892b89bb76e3efed19dc684cc4a6d3741 100644 --- a/Modules/Core/ImageBase/test/otbExtractROITestMetaData.cxx +++ b/Modules/Core/ImageBase/test/otbExtractROITestMetaData.cxx @@ -21,7 +21,6 @@ #include <iostream> #include <fstream> -#include "itkUnaryFunctorImageFilter.h" #include "itkExtractImageFilter.h" #include "itkVectorIndexSelectionCastImageFilter.h" #include "otbExtractROI.h" diff --git a/Modules/Core/LabelMap/include/otbBandsStatisticsAttributesLabelMapFilter.hxx b/Modules/Core/LabelMap/include/otbBandsStatisticsAttributesLabelMapFilter.hxx index 51b29436e2bd565d6922cd6c73302ddd9bd6c8de..128be4e9210397e99ca109e08e50cf30134a9389 100644 --- a/Modules/Core/LabelMap/include/otbBandsStatisticsAttributesLabelMapFilter.hxx +++ b/Modules/Core/LabelMap/include/otbBandsStatisticsAttributesLabelMapFilter.hxx @@ -22,7 +22,6 @@ #define otbBandsStatisticsAttributesLabelMapFilter_hxx #include "otbBandsStatisticsAttributesLabelMapFilter.h" -#include "itkUnaryFunctorImageFilter.h" #include "itkVectorIndexSelectionCastImageFilter.h" namespace otb diff --git a/Modules/Core/ObjectList/test/otbImageListToImageListApplyFilter.cxx b/Modules/Core/ObjectList/test/otbImageListToImageListApplyFilter.cxx index 40bdb6d2969dd56c28fd4b327d019bb40eb26872..e97133e2ec3562dc2ae8d4b20ab1fa882fb922d4 100644 --- a/Modules/Core/ObjectList/test/otbImageListToImageListApplyFilter.cxx +++ b/Modules/Core/ObjectList/test/otbImageListToImageListApplyFilter.cxx @@ -23,7 +23,6 @@ #include "otbImageListToImageListApplyFilter.h" #include "otbImageList.h" #include "otbImage.h" -#include "itkUnaryFunctorImageFilter.h" #include "itkMeanImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" diff --git a/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx b/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx index ffa2d34cbc0432b05f098bc0c8390a53802ac751..9f58cbf659af9595ddbc919e5f1522b41de22b94 100644 --- a/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx +++ b/Modules/Core/Transform/test/otbCreateProjectionWithOTB.cxx @@ -39,7 +39,6 @@ #include "otbImageFileWriter.h" #include "otbImageFileWriter.h" -#include "itkUnaryFunctorImageFilter.h" #include "itkExtractImageFilter.h" #include "itkRescaleIntensityImageFilter.h" #include "itkImageRegionIteratorWithIndex.h" 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/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.h b/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.h index ce195333fb1df17ff4be79f81e533d77563f5c0a..0d44c28ed2ee870707430b304da9e76c728ba0ac 100644 --- a/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.h +++ b/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.h @@ -26,7 +26,6 @@ // gets integrated into the main directories. #include "itkConfigure.h" -#include "itkUnaryFunctorImageFilter.h" #include "itkMorphologyImageFilter.h" #include "itkBinaryBallStructuringElement.h" 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/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx b/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx index d4488055ab2c662b03090c4abb660c692d18f05b..c67042795741e8f7f568fb27bbcc4700886c2098 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx @@ -22,10 +22,6 @@ #define otbWrapperComplexInputImageParameter_hxx #include "otbWrapperComplexInputImageParameter.h" - -#include "itkUnaryFunctorImageFilter.h" -// #include "itkCastImageFilter.h" -// #include "otbImageToVectorImageCastFilter.h" #include "otbClampImageFilter.h" namespace otb diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.hxx b/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.hxx index e79d17eaccf0815f940e117a67a5711965ff2962..1fcec55db02badd82b2b862206ee5d982a45f7ad 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.hxx +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.hxx @@ -23,7 +23,6 @@ #include "otbWrapperInputImageParameter.h" -#include "itkUnaryFunctorImageFilter.h" #include "otbClampImageFilter.h" namespace otb diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index dbeac1e3aa3f65f2dfa68c8af67691c7f8026624..f21fedb86ea20d43f4d9fdf49a57a2e770d34b47 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -2101,9 +2101,9 @@ void Application::AddRANDParameter(std::string paramKey) { // Get the RAND Parameter from the configuration file - GetParameterList()->AddParameter(ParameterType_Int, paramKey, "set user defined seed"); + GetParameterList()->AddParameter(ParameterType_Int, paramKey, "Random seed"); MandatoryOff(paramKey); - SetParameterDescription(paramKey, "Set specific seed. with integer value."); + SetParameterDescription(paramKey, "Set a specific random seed with integer value."); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx index 1b6f4657e9c9ac86126a8174bc2cabfd3f633761..5b6dfad1bd6dab1441588b96a067aa32b9b4b86c 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx @@ -19,7 +19,6 @@ */ #include "otbWrapperComplexOutputImageParameter.h" -#include "itkUnaryFunctorImageFilter.h" #include "otbClampImageFilter.h" #ifdef OTB_USE_MPI diff --git a/Modules/Wrappers/SWIG/test/python/Bug440.py b/Modules/Wrappers/SWIG/test/python/Bug440.py deleted file mode 100644 index 3631d406dcde410e606a570b7f8bfdd9ada9c9e4..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/test/python/Bug440.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -# -# 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. -# - -# Import the otb applications package - -import sys -def test(otbApplication, argv): - # The following line creates an instance of the Convert application - Convert = otbApplication.Registry.CreateApplication("Convert") - - # The following lines set all the application parameters: - Convert.SetParameterString("in", argv[1]) - - Convert.SetParameterString("out", argv[2]) - - Convert.SetParameterString("type","linear") - - # The following line execute the application - sys.exit(Convert.ExecuteAndWriteOutput()) diff --git a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt index edbef92fe8ac7a2267ec0c395a84809b3151c16f..b53d14e63fa8de65baad4efd15219dd4ddf3ed21 100644 --- a/Modules/Wrappers/SWIG/test/python/CMakeLists.txt +++ b/Modules/Wrappers/SWIG/test/python/CMakeLists.txt @@ -53,14 +53,6 @@ add_test( NAME pyTvHyperspectralUnmixingUCLS ucls ) -add_test( NAME pyTvBug440 - COMMAND ${TEST_DRIVER} Execute - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py - Bug440 - ${OTB_DATA_ROOT}/Input/scene.png - ${TEMP}/pyTvBug440Output.tif - ) - add_test( NAME pyTvBug804 COMMAND ${TEST_DRIVER} Execute ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py diff --git a/Modules/Wrappers/SWIG/test/python/PythonNumpyTest.py b/Modules/Wrappers/SWIG/test/python/PythonNumpyTest.py index fd0e1ad4b361bb314ef02e71757a9a4f6ca21a87..85814eef2a468d648352af4e89a452551f46586e 100644 --- a/Modules/Wrappers/SWIG/test/python/PythonNumpyTest.py +++ b/Modules/Wrappers/SWIG/test/python/PythonNumpyTest.py @@ -65,16 +65,16 @@ def test(otbApplication, argv): RescaleOut = Rescale.GetVectorImageAsNumpyArray("out", 'float') # misc.imsave('RescaleOut.jpg', RescaleOut) - Convert = otbApplication.Registry.CreateApplication("Convert") - # take numpy output from Rescale application and feed into Convert - Convert.SetVectorImageFromNumpyArray("in", RescaleOut) - Convert.SetParameterString("out", "ConvertOut.png") - Convert.ExecuteAndWriteOutput() - ConvertOut = Convert.GetVectorImageAsNumpyArray("out", 'float') + DynamicConvert = otbApplication.Registry.CreateApplication("DynamicConvert") + # take numpy output from Rescale application and feed into DynamicConvert + DynamicConvert.SetVectorImageFromNumpyArray("in", RescaleOut) + DynamicConvert.SetParameterString("out", "ConvertOut.png") + DynamicConvert.ExecuteAndWriteOutput() + DynamicConvertOut = DynamicConvert.GetVectorImageAsNumpyArray("out", 'float') Smoothing = otbApplication.Registry.CreateApplication("Smoothing") # take numpy output from Convert application and feed into Smoothing - Smoothing.SetVectorImageFromNumpyArray("in", ConvertOut) + Smoothing.SetVectorImageFromNumpyArray("in", DynamicConvertOut) Smoothing.SetParameterString("type", 'anidif') Smoothing.SetParameterString("out", outFile) Smoothing.ExecuteAndWriteOutput() diff --git a/Modules/Wrappers/SWIG/test/python/PythonRescaleTest.py b/Modules/Wrappers/SWIG/test/python/PythonRescaleTest.py index 878d2e5113b329ab5749f7fed1b15a2330cd142e..812aec1fac05c6e9985a916dd4a5b457b4435288 100644 --- a/Modules/Wrappers/SWIG/test/python/PythonRescaleTest.py +++ b/Modules/Wrappers/SWIG/test/python/PythonRescaleTest.py @@ -23,6 +23,9 @@ # # Example on the use of the Rescale +# This test checks that the Python wrapping works correctly. For instance, it +# ensures that Init() is called on the Swig/Python interface (see bug #440, +# https://bugs.orfeo-toolbox.org//view.php?id=440) # def test(otb, argv): app = otb.Registry.CreateApplication("Rescale") 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)