Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
otbVectorDataToImageFilter.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 
19 #ifndef __otbVectorDataToImageFilter_txx
20 #define __otbVectorDataToImageFilter_txx
21 
22 #include <sstream>
24 #include "itkImageRegionIterator.h"
26 #include "otbVectorDataStyle.h"
27 #include "itkRGBAPixel.h"
28 
29 #include <mapnik/datasource_cache.hpp>
30 #include <mapnik/font_engine_freetype.hpp>
31 #include <mapnik/agg_renderer.hpp>
32 #include <mapnik/filter_factory.hpp>
33 #include <mapnik/color_factory.hpp>
34 #include <mapnik/image_util.hpp>
35 #include <mapnik/config_error.hpp>
36 #include <mapnik/memory_datasource.hpp>
37 #include <mapnik/layer.hpp>
38 #include <mapnik/map.hpp>
39 #include <mapnik/value.hpp>
40 
41 #include "ogr_spatialref.h"
42 
43 #ifdef OTB_MAPNIK_COMPATIBILITY_API07
44 namespace mapnik {
45 typedef Layer layer;
46 typedef Image32 image_32;
47 }
48 #endif
49 
50 namespace otb
51 {
52 namespace mapnik_otb
53 {
54 // this should be removed once mapnik support for version < 2.0 is dropped.
55 // should be around 01/2013.
56 #ifdef OTB_MAPNIK_COMPATIBILITY_API07
57 static size_t get_num_layer(const mapnik::Map& map) { return map.layerCount(); }
58 static unsigned get_height(const mapnik::Map& map) { return map.getHeight(); }
59 static unsigned get_width(const mapnik::Map& map) { return map.getWidth(); }
60 typedef mapnik::Envelope<double> box2d;
61 static void zoom_to_box(mapnik::Map* map, const mapnik::Envelope<double>& envelope)
62 {
63  map->zoomToBox(envelope);
64 }
65 typedef mapnik::geometry2d geom;
66 static geom* create_geom(int geom_type)
67 {
68  geom* g = 0;
69  switch (geom_type)
70  {
71  case mapnik::Point:
72  g = new mapnik::point<mapnik::vertex<double, 2> >;
73  case mapnik::LineString:
74  g = new mapnik::line_string<mapnik::vertex<double, 2> , mapnik::vertex_vector2>;
75  case mapnik::Polygon:
76  g = new mapnik::polygon<mapnik::vertex<double, 2>, mapnik::vertex_vector2>;
77  default:
78  std::cerr
79  << "Please fix otb::mapnik_otb::create_geom for mapnik 0.7" << std::endl;
80  }
81  return g;
82 }
83 #else
84 static size_t get_num_layer(const mapnik::Map& map) { return map.layer_count(); }
85 static unsigned get_height(const mapnik::Map& map) { return map.height(); }
86 static unsigned get_width(const mapnik::Map& map) { return map.width(); }
87 typedef mapnik::box2d<double> box2d;
88 static void zoom_to_box(mapnik::Map* map, const mapnik::box2d<double>& envelope)
89 {
90  map->zoom_to_box(envelope);
91 }
92 typedef mapnik::vertex<double, 2> vertex2d;
93 typedef mapnik::geometry<vertex2d> geom;
94 static geom* create_geom(mapnik::eGeomType geom_type) { return new geom(geom_type); }
95 #endif
96 }
97 
101 template <class TVectorData, class TImage>
104  m_StyleList(),
105  m_UseAsOverlay(true),
106  m_RenderingStyleType(OSM)
107 {
108  this->SetNumberOfRequiredInputs(1);
109  m_Spacing.Fill(1.0);
110  m_Origin.Fill(0.0);
111  m_Direction.SetIdentity();
112  m_Size.Fill(0);
113  m_StartIndex.Fill(0);
114  m_SensorModelFlip = 1;
115  m_ScaleFactor = 1.0;
116  m_VectorDataProjectionProj4 = "";
117  m_VectorDataProjectionWKT = "";
118 }
119 
120 template <class TVectorData, class TImage>
121 void
124 {
125  // Process object is not const-correct so the const_cast is required here
126  this->itk::ProcessObject::SetNthInput(0,
127  const_cast<VectorDataType *>(input));
128 }
129 
130 template <class TVectorData, class TImage>
131 void
133 ::SetInput(unsigned int idx, const VectorDataType *input)
134 {
135  // Process object is not const-correct so the const_cast is required here
136  this->itk::ProcessObject::SetNthInput(idx,
137  const_cast<VectorDataType *>(input));
138 }
139 
140 template <class TVectorData, class TImage>
144 {
145  if (this->GetNumberOfInputs() < 1)
146  {
147  return 0;
148  }
149 
150  return static_cast<const TVectorData *>
151  (this->itk::ProcessObject::GetInput(0));
152 }
153 
154 template <class TVectorData, class TImage>
157 ::GetInput(unsigned int idx)
158 {
159  return static_cast<const TVectorData *>
160  (this->itk::ProcessObject::GetInput(idx));
161 }
162 
163 //----------------------------------------------------------------------------
164 template <class TVectorData, class TImage>
165 void
167 ::SetSpacing(const SpacingType& spacing)
168 {
169  if (this->m_Spacing != spacing)
170  {
171  this->m_Spacing = spacing;
172  this->Modified();
173  }
174 }
175 
176 //----------------------------------------------------------------------------
177 template <class TVectorData, class TImage>
178 void
180 ::SetSpacing(const double spacing[2])
181 {
182  SpacingType s(spacing);
183  this->SetSpacing(s);
184 }
185 
186 //----------------------------------------------------------------------------
187 template <class TVectorData, class TImage>
188 void
190 ::SetSpacing(const float spacing[2])
191 {
192  itk::Vector<float, 2> sf(spacing);
193  SpacingType s;
194  s.CastFrom(sf);
195  this->SetSpacing(s);
196 }
197 
198 //----------------------------------------------------------------------------
199 template <class TVectorData, class TImage>
200 void
202 ::SetOrigin(const double origin[2])
203 {
204  OriginType p(origin);
205  this->SetOrigin(p);
206 }
207 
208 //----------------------------------------------------------------------------
209 template <class TVectorData, class TImage>
210 void
212 ::SetOrigin(const float origin[2])
213 {
214  itk::Point<float, 2> of(origin);
215  OriginType p;
216  p.CastFrom(of);
217  this->SetOrigin(p);
218 }
219 
223 template <class TVectorData, class TImage>
224 void
227 {
228  // we can't call the superclass method here.
229 
230  // get pointers to the input and output
231  ImagePointer outputPtr = this->GetOutput();
232  if (!outputPtr)
233  {
234  return;
235  }
236 
237  // Set the size of the output region
238  typename TImage::RegionType outputLargestPossibleRegion;
239  outputLargestPossibleRegion.SetSize(m_Size);
240  outputLargestPossibleRegion.SetIndex(m_StartIndex);
241  outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion);
242 
243  // Set spacing and origin
244  outputPtr->SetSpacing(m_Spacing);
245  outputPtr->SetOrigin(m_Origin);
246  outputPtr->SetDirection(m_Direction);
247 
248  itk::MetaDataDictionary& dict = outputPtr->GetMetaDataDictionary();
249  itk::EncapsulateMetaData<std::string> (dict, MetaDataKey::ProjectionRefKey,
250  static_cast<std::string>(m_VectorDataProjectionWKT));
251 
252  //TODO update or check the projection information
253 
254  return;
255 }
256 
260 template <class TVectorData, class TImage>
261 void
264 {
265 
266  Superclass::BeforeThreadedGenerateData();
267 
268  //Font Handling
269  if(!m_FontFileName.empty())
270  mapnik::freetype_engine::register_font(m_FontFileName);
271 
272  //Handle the style type using helper class
274  styleLoader->SetScaleFactor(m_ScaleFactor);
275 
276  //We assume that all the data are reprojected before using OTB.
277  VectorDataConstPointer input = this->GetInput();
278  //Converting the projection string to the proj.4 format
279  itk::ExposeMetaData<std::string>(
280  input->GetMetaDataDictionary(), MetaDataKey::ProjectionRefKey, m_VectorDataProjectionWKT);
281  otbMsgDebugMacro(<< "WKT -> " << m_VectorDataProjectionWKT);
282 
283  m_SensorModelFlip = 1;
284 
285  if (m_VectorDataProjectionWKT == "")
286  {
287  //We assume that it is an image in sensor model geometry
288  //and tell mapnik that this is utm
289  //(with a resolution of 1m per unit)
290  m_VectorDataProjectionProj4 = "+proj=utm +zone=31 +ellps=WGS84";
291  m_SensorModelFlip = -1;
292  otbMsgDevMacro(<< "The output map will be in sensor geometry");
293  }
294  else
295  {
296  OGRSpatialReferenceH oSRS = OSRNewSpatialReference(m_VectorDataProjectionWKT.c_str());
297  char * pszProj4;
298  OSRExportToProj4(oSRS, &pszProj4);
299  m_VectorDataProjectionProj4 = pszProj4;
300  CPLFree(pszProj4);
301  OSRRelease(oSRS);
302  m_SensorModelFlip = 1;
303  otbMsgDevMacro(<< "The output map will be carto/geo geometry");
304  }
305  otbMsgDebugMacro(<< "Proj.4 -> " << m_VectorDataProjectionProj4);
306 
307  //Internal Tiling Support
308  //Workaround to overcome mapnik maximum tile size limitation
309  ImagePointer output = this->GetOutput();
310  RegionType requestedRegion = output->GetRequestedRegion();
311  otbMsgDevMacro("requestedRegion: " << requestedRegion);
312 
313  m_NbTile = (vcl_pow(std::max(vcl_floor((double)requestedRegion.GetSize()[0] / 16000),
314  vcl_floor((double)requestedRegion.GetSize()[1] / 16000))+1, 2));
315 
316  //std::cout << "nbTile: " << m_NbTile << std::endl;
317  //std::cout << "requestedRegion: " << requestedRegion << std::endl;
318 
319  m_TilingRegions.resize(m_NbTile);
320  m_Maps.resize(m_NbTile);
321  m_VectorDataExtractors.resize(m_NbTile);
322 
323  unsigned int tilingRegionsIdx = 0;
324  unsigned int stdXOffset;
325  unsigned int stdYOffset;
326 
327  stdXOffset = vcl_floor((double)requestedRegion.GetSize()[0]/ (m_NbTile/2))+1;
328  stdYOffset = vcl_floor((double)requestedRegion.GetSize()[1]/ (m_NbTile/2))+1;
329 
330  for(unsigned int i=0; i < vcl_floor((double)(m_NbTile)/2 + 0.5); ++i)
331  {
332  for(unsigned int j=0; j < vcl_floor((double)(m_NbTile)/2 + 0.5); ++j)
333  {
334  //Set Regions
335  SizeType size;
336  IndexType index;
337  if(m_NbTile == 1)
338  {
339  index = requestedRegion.GetIndex();
340  size = requestedRegion.GetSize();
341  }
342  else
343  {
344  index[0] = requestedRegion.GetIndex()[0] + i * stdXOffset;
345  index[1] = requestedRegion.GetIndex()[1] + j * stdYOffset;
346 
347  size[0] = std::min((unsigned int)(requestedRegion.GetSize()[0] - index[0]), stdXOffset);
348  size[1] = std::min((unsigned int)(requestedRegion.GetSize()[1] - index[1]), stdYOffset);
349  }
350  m_TilingRegions[tilingRegionsIdx].SetIndex(index);
351  m_TilingRegions[tilingRegionsIdx].SetSize(size);
352 
353  //std::cout << "tileRegions[" << tilingRegionsIdx << "] : "
354  // << m_TilingRegions[tilingRegionsIdx] << std::endl;
355 
356  //Set Maps
357  m_Maps[tilingRegionsIdx] = mapnik::Map();
358 
360  switch (m_RenderingStyleType)
361  {
362  case OSM:
363  {
364  styleLoader->LoadOSMStyle(m_Maps[tilingRegionsIdx]);
365  if (m_UseAsOverlay)
366  {
367  //Set the default backgroup to transparent
368  m_Maps[tilingRegionsIdx].set_background(mapnik::color(255, 255, 255, 0));
369  }
370  else
371  {
372  m_Maps[tilingRegionsIdx].set_background(mapnik::color("#b5d0d0"));
373  }
374  break;
375  }
376  case Binary:
377  {
378  styleLoader->LoadBinaryRasterizationStyle(m_Maps[tilingRegionsIdx]);
379  //Set the backgroup to white
380  m_Maps[tilingRegionsIdx].set_background(mapnik::color("#ffffff"));
381  break;
382  }
383  default:
384  {
385  itkExceptionMacro(<< "Style Type Not Supported!");
386  break;
387  }
388  }
389 
391  m_Maps[tilingRegionsIdx].set_srs(m_VectorDataProjectionProj4);
392 
393  //Set VectorData extracts
394  m_VectorDataExtractors[tilingRegionsIdx].resize(this->GetNumberOfInputs());
395  for (unsigned int idx = 0; idx < this->GetNumberOfInputs(); ++idx)
396  {
397  if (this->GetInput(idx))
398  {
399  RemoteSensingRegionType rsRegion;
400  SizePhyType sizePhy;
401  sizePhy[0] = size[0] * m_Spacing[0];
402  sizePhy[1] = size[1] * m_Spacing[1];
403  rsRegion.SetSize(sizePhy);
404  OriginType origin;
405  origin[0] = m_Origin[0] + (static_cast<double>(index[0]) - 0.5) * m_Spacing[0];
406  origin[1] = m_Origin[1] + (static_cast<double>(index[1]) - 0.5) * m_Spacing[1];
407  rsRegion.SetOrigin(origin);
408  rsRegion.SetRegionProjection(m_VectorDataProjectionWKT);
409 
410  //std::cout << "m_SensorModelFlip: " << m_SensorModelFlip << std::endl;
411  //std::cout << "rsTileRegions[" << tilingRegionsIdx << "] : "
412  // << rsRegion << std::endl;
413 
414  m_VectorDataExtractors[tilingRegionsIdx][idx] = VectorDataExtractROIType::New();
415  m_VectorDataExtractors[tilingRegionsIdx][idx]->SetRegion(rsRegion);
416  m_VectorDataExtractors[tilingRegionsIdx][idx]->SetInput(this->GetInput(idx));
417  }
418  }
419 
420  tilingRegionsIdx ++;
421  }
422  }
423 }
424 
428 template <class TVectorData, class TImage>
429 void
432 {
433 
434  this->AllocateOutputs();
435 
436  this->BeforeThreadedGenerateData();
437 
438  if (m_StyleList.size() == 0)
439  {
440  switch (m_RenderingStyleType)
441  {
442  case OSM:
443  {
444  //Add default styles
445  itkExceptionMacro(<< "No style is provided for the vector data");
446  break;
447  }
448  case Binary:
449  {
450  //Add default styles
451  this->AddStyle("binary-rasterization");
452  break;
453  }
454  default:
455  {
456  itkExceptionMacro(<< "No style is provided for the vector data");
457  break;
458  }
459  }
460  }
461 
462  ImagePointer output = this->GetOutput();
463 
464  for (unsigned int tileIdx = 0; tileIdx < m_NbTile; ++tileIdx)
465  {
466  //Delete the previous layers from the map
467  int numberLayer = mapnik_otb::get_num_layer(m_Maps[tileIdx]);
468  for (int i = numberLayer - 1; i >= 0; i--) //yes, int.
469  {
470  m_Maps[tileIdx].removeLayer(i);
471  }
472  m_Maps[tileIdx].resize(m_TilingRegions[tileIdx].GetSize()[0], m_TilingRegions[tileIdx].GetSize()[1]);
473 
474  RemoteSensingRegionType rsRegion;
475 
476  for (unsigned int vdIdx = 0; vdIdx < this->GetNumberOfInputs(); ++vdIdx)
477  {
478  if (this->GetInput(vdIdx))
479  {
480  datasource_ptr mDatasource = datasource_ptr(new mapnik::memory_datasource);
481 
482  rsRegion = m_VectorDataExtractors[tileIdx][vdIdx]->GetRegion();
483 
484  m_VectorDataExtractors[tileIdx][vdIdx]->Update();
485  VectorDataConstPointer input = m_VectorDataExtractors[tileIdx][vdIdx]->GetOutput();
486  InternalTreeNodeType * inputRoot = const_cast<InternalTreeNodeType *>(input->GetDataTree()->GetRoot());
487 
488  ProcessNode(inputRoot, mDatasource);
489  otbMsgDevMacro("Datasource size: " << mDatasource->size());
490 
491  std::stringstream layerName;
492  layerName << "layer-" << tileIdx;
493  mapnik::layer lyr(layerName.str());
494  lyr.set_srs(m_VectorDataProjectionProj4);
495  lyr.set_datasource(mDatasource);
496 
497  for (unsigned int i = 0; i < m_StyleList.size(); ++i)
498  {
499  lyr.add_style(m_StyleList[i]);
500  }
501 
502  m_Maps[tileIdx].addLayer(lyr);
503  }
504  }
505  assert((m_SensorModelFlip == 1) || (m_SensorModelFlip == -1));
506 
507  mapnik_otb::box2d envelope(
508  rsRegion.GetOrigin(0),
509  m_SensorModelFlip*(rsRegion.GetOrigin(1) + rsRegion.GetSize(1)),
510  rsRegion.GetOrigin(0) + rsRegion.GetSize(0),
511  m_SensorModelFlip*(rsRegion.GetOrigin(1))
512  );
513 
514  mapnik_otb::zoom_to_box(&m_Maps[tileIdx], envelope);
515  otbMsgDebugMacro(<< "Envelope: " << envelope);
516 
517  otbMsgDebugMacro(<< "Map scale: " << m_Maps[tileIdx].scale_denominator());
518  mapnik::image_32 buf(mapnik_otb::get_width(m_Maps[tileIdx]),
519  mapnik_otb::get_height(m_Maps[tileIdx]));
520  mapnik::agg_renderer<mapnik::image_32> ren(m_Maps[tileIdx], buf);
521  ren.apply();
522 
523  const unsigned char * src = buf.raw_data();
524 
525  itk::ImageRegionIterator<ImageType> it(output, m_TilingRegions[tileIdx]);
526 
527  for (it.GoToBegin(); !it.IsAtEnd(); ++it)
528  {
530  pix[0] = *src;
531  pix[1] = *(src+1);
532  pix[2] = *(src+2);
533  pix[3] = *(src+3);
534  src += 4;
535 
536  it.Set(m_RGBAConverter->Convert(pix));
537  }
538  }
539 }
540 
541 template <class TVectorData, class TImage>
542 void
545 {
546  typedef typename VectorDataType::DataNodeType DataNodeType;
547  typedef typename DataNodeType::Pointer DataNodePointerType;
548 
549  // Get the children list from the input node
550  ChildrenListType children = source->GetChildrenList();
551 
552  // For each child
553  for (typename ChildrenListType::iterator it = children.begin(); it != children.end(); ++it)
554  {
555  // Copy input DataNode info
556  DataNodePointerType dataNode = (*it)->Get();
557 
558  switch (dataNode->GetNodeType())
559  {
560  case otb::ROOT:
561  {
562  ProcessNode((*it), mDatasource);
563  break;
564  }
565  case otb::DOCUMENT:
566  {
567  ProcessNode((*it), mDatasource);
568  break;
569  }
570  case otb::FOLDER:
571  {
572  ProcessNode((*it), mDatasource);
573  break;
574  }
575  case FEATURE_POINT:
576  {
577  mapnik_otb::geom* point = mapnik_otb::create_geom(mapnik::Point);
578 
579  point->move_to(dataNode->GetPoint()[0], m_SensorModelFlip * dataNode->GetPoint()[1]);
580 // std::cout << dataNode->GetPoint()[0] << ", " << dataNode->GetPoint()[1] << std::endl;
581 
582  typedef boost::shared_ptr<mapnik::raster> raster_ptr;
583  typedef mapnik::feature<mapnik_otb::geom, raster_ptr> Feature;
584  typedef boost::shared_ptr<Feature> feature_ptr;
585 
586  feature_ptr mfeature = feature_ptr(new Feature(1));
587  mfeature->add_geometry(point);
588 
589  mapnik::transcoder tr("ISO-8859-15");
590 
591  if (dataNode->HasField("place_name"))
592  boost::put(*mfeature, "name",
593  tr.transcode((dataNode->GetFieldAsString("place_name")).c_str()));
594 
595  boost::put(*mfeature, "place", tr.transcode("city"));
596  boost::put(*mfeature, "capital", tr.transcode("yes")); //FIXME more a question of style
597 
598  boost::put(*mfeature, "geometry", tr.transcode("point"));
599 
600  mDatasource->push(mfeature);
601 
602  break;
603  }
604  case otb::FEATURE_LINE:
605  {
606  mapnik_otb::geom* line = mapnik_otb::create_geom(mapnik::LineString);
607 
608  typedef typename DataNodeType::LineType::VertexListConstIteratorType VertexIterator;
609  VertexIterator itVertex = dataNode->GetLine()->GetVertexList()->Begin();
610  while (itVertex != dataNode->GetLine()->GetVertexList()->End())
611  {
612 // std::cout << itVertex.Value()[0] << ", " << itVertex.Value()[1] << std::endl;
613  line->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]);
614  ++itVertex;
615  }
616 
617 // std::cout << "Num points: " << line->num_points() << std::endl;
618 
619  typedef boost::shared_ptr<mapnik::raster> raster_ptr;
620  typedef mapnik::feature<mapnik_otb::geom, raster_ptr> Feature;
621  typedef boost::shared_ptr<Feature> feature_ptr;
622 
623  feature_ptr mfeature = feature_ptr(new Feature(1));
624  mfeature->add_geometry(line);
625 
626  mapnik::transcoder tr("ISO-8859-15");
627 
628  if (dataNode->HasField("name"))
629  boost::put(*mfeature, "name",
630  tr.transcode((dataNode->GetFieldAsString("name")).c_str()));
631  if (dataNode->HasField("NAME"))
632  boost::put(*mfeature, "name",
633  tr.transcode((dataNode->GetFieldAsString("NAME")).c_str()));
634 
635 // std::cout << mfeature->props().size() << std::endl;
636 // std::cout << " -> " << (*mfeature)["name"] << std::endl;
637 
638 // std::cout << "Name: " << dataNode->GetFieldAsString("NAME") << std::endl;
639 // std::cout << "Type: " << dataNode->GetFieldAsString("TYPE") << std::endl;
640 // std::cout << "OSM ID: " << dataNode->GetFieldAsString("osm_id") << std::endl;
641 
642  if (dataNode->HasField("type"))
643  boost::put(*mfeature, "highway",
644  tr.transcode((dataNode->GetFieldAsString("type")).c_str()));
645  if (dataNode->HasField("TYPE"))
646  boost::put(*mfeature, "highway",
647  tr.transcode((dataNode->GetFieldAsString("TYPE")).c_str()));
648 
649  boost::put(*mfeature, "geometry", tr.transcode("line"));
650 
651  mDatasource->push(mfeature);
652 
653  break;
654  }
655  case FEATURE_POLYGON:
656  {
657  mapnik_otb::geom* polygon = mapnik_otb::create_geom(mapnik::Polygon);
658 
659  typedef typename DataNodeType::PolygonType::VertexListConstIteratorType VertexIterator;
660  VertexIterator itVertex = dataNode->GetPolygonExteriorRing()->GetVertexList()->Begin();
661  while (itVertex != dataNode->GetPolygonExteriorRing()->GetVertexList()->End())
662  {
663  polygon->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]);
664  ++itVertex;
665  }
666 
667  typedef boost::shared_ptr<mapnik::raster> raster_ptr;
668  typedef mapnik::feature<mapnik_otb::geom, raster_ptr> Feature;
669  typedef boost::shared_ptr<Feature> feature_ptr;
670 
671  feature_ptr mfeature = feature_ptr(new Feature(1));
672  mfeature->add_geometry(polygon);
673 
674  mapnik::transcoder tr("ISO-8859-15");
675 
676  boost::put(*mfeature, "geometry", tr.transcode("polygon"));
677 
678  mDatasource->push(mfeature);
679 
680  break;
681  }
682  case FEATURE_MULTIPOINT:
683  {
684  itkExceptionMacro(
685  << "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToImageFilter(), please request for it");
686  break;
687  }
688  case FEATURE_MULTILINE:
689  {
690  itkExceptionMacro(
691  << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToImageFilter(), please request for it");
692  break;
693  }
695  {
696  itkExceptionMacro(
697  << "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToImageFilter(), please request for it");
698  break;
699  }
700  case FEATURE_COLLECTION:
701  {
702  itkExceptionMacro(
703  << "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToImageFilter(), please request for it");
704  break;
705  }
706  }
707  }
708 }
709 
713 template <class TVectorData, class TImage>
714 void
716 ::PrintSelf(std::ostream& os, itk::Indent indent) const
717 {
718  Superclass::PrintSelf(os, indent);
719 }
720 }
721 
722 #endif
InternalTreeNodeType::ChildrenListType ChildrenListType
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
char const * ProjectionRefKey
virtual void SetOrigin(OriginType _arg)
mapnik::vertex< double, 2 > vertex2d
void Set(const PixelType &value) const
virtual void SetSpacing(const SpacingType &spacing)
static void zoom_to_box(mapnik::Map *map, const mapnik::box2d< double > &envelope)
VectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType
VectorDataType::ConstPointer VectorDataConstPointer
void ProcessNode(InternalTreeNodeType *source, datasource_ptr mDatasource)
virtual void SetInput(const VectorDataType *input)
#define otbMsgDebugMacro(x)
Definition: otbMacro.h:54
const IndexType & GetOrigin() const
void SetOrigin(const IndexType &index)
static vcl_size_t get_num_layer(const mapnik::Map &map)
mapnik::geometry< vertex2d > geom
static Pointer New()
static unsigned get_height(const mapnik::Map &map)
const VectorDataType * GetInput(void)
boost::shared_ptr< mapnik::memory_datasource > datasource_ptr
static unsigned get_width(const mapnik::Map &map)
void SetRegionProjection(const std::string &projection)
void SetSize(const SizeType &size)
mapnik::box2d< double > box2d
bool IsAtEnd(void) const
static geom * create_geom(mapnik::eGeomType geom_type)
const SizeType & GetSize() const
const SizeValueType * GetSize() const
#define otbMsgDevMacro(x)
Definition: otbMacro.h:94