Commit bb2b1abb authored by Victor Poughon's avatar Victor Poughon

REFAC: remove VectorDataRendering and Mapnik dependency

parent 9269526e
#
# 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()
......@@ -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}
......
......@@ -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 & \\
......
......@@ -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})
......
......@@ -214,30 +214,27 @@ 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-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.
)
/*
* 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;
}
#
# 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()
/*
* 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
/*
* 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
/*
* 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>,