OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimGeoPdfReader.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Mingjie Su
8 //
9 // Description: Class definition for GeoPdf reader.
10 //
11 //----------------------------------------------------------------------------
12 // $Id: ossimGeoPdfReader.cpp 22844 2014-07-26 19:41:01Z dburken $
13 
14 #include <fstream>
15 #include <iostream>
16 #include <string>
17 
18 //PoDoFo includes
19 #include <podofo/doc/PdfMemDocument.h>
20 #include <podofo/base/PdfName.h>
21 #include <podofo/base/PdfObject.h>
22 
23 //ossim includes
24 #include <ossim/base/ossimCommon.h>
25 #include <ossim/base/ossimDpt.h>
26 #include <ossim/base/ossimGrect.h>
27 #include <ossim/base/ossimEndian.h>
31 #include <ossim/base/ossimNotify.h>
33 #include <ossim/base/ossimTrace.h>
65 
66 #include "ossimGeoPdfReader.h"
67 
68 #ifdef OSSIM_ID_ENABLED
69 static const char OSSIM_ID[] = "$Id";
70 #endif
71 
72 static ossimTrace traceDebug("ossimGeoPdfReader:debug");
73 static ossimTrace traceDump("ossimGeoPdfReader:dump");
74 //static ossimOgcWktTranslator wktTranslator;
75 
77  "ossimGeoPdfReader",
79 
80 static ossimString originLatKey = "OriginLatitude";
81 static ossimString centralMeridianKey = "CentralMeridian";
82 static ossimString standardParallelOneKey = "StandardParallelOne";
83 static ossimString standardParallelTwoKey = "StandardParallelTwo";
84 static ossimString falseEastingKey = "FalseEasting";
85 static ossimString falseNorthingKey = "FalseNorthing";
86 static ossimString scaleFactorKey = "ScaleFactor";
87 static ossimString latitudeOneKey = "LatitudeOne";
88 static ossimString longitudeOneKey = "LongitudeOne";
89 static ossimString latitudeTwoKey = "LatitudeTwo";
90 static ossimString longitudeTwoKey = "LongitudeTwo";
91 static ossimString zoneKey = "Zone";
92 static ossimString hemisphereKey = "Hemisphere";
93 
95 {
96 public:
98  : m_boundingRect(),
99  m_geoImage(0)
100  {};
101 
103  {
104  if (m_geoImage.valid())
105  {
106  m_geoImage = 0;
107  }
108  }
109 
111  {
112  m_geoImage = image;
113  }
114 
115  void setBoundingBox(const ossimDrect& bounds)
116  {
117  m_boundingRect = bounds;
118  }
119 
122 };
123 
124 ossimString getValueFromMap(std::map<ossimString, ossimString, ossimStringLtstr> info,
125  ossimString key)
126 {
127  ossimString valueStr;
128  std::map<ossimString, ossimString, ossimStringLtstr>::iterator it = info.find(key);
129  if (it != info.end())
130  {
131  valueStr = it->second;
132  }
133  return valueStr;
134 }
135 
137  : ossimImageHandler(),
139  m_numberOfBands(0),
140  m_numberOfLines(0),
141  m_numberOfSamples(0),
142  m_numOfFramesVertical(0),
143  m_numOfFramesHorizontal(0),
144  m_currentRow(-1),
145  m_currentCol(-1),
146  m_frameWidthVector(),
147  m_frameHeightVector(),
148  m_scalarType(OSSIM_UINT8),
149  m_tile(0),
150  m_pdfMemDocument(NULL),
151  m_isLGIDict(false),
152  m_isJpeg(true),
153  m_pageVector(0),
154  m_cacheTile(0),
155  m_cacheSize(0),
156  m_cacheId(-1),
157  m_frameEntryArray(0)
158 {
159 }
160 
162 {
163  closeEntry();
164 }
165 
167 {
168  ossim_int32 row = entry.theRow;
169  ossim_int32 col = entry.theCol;
170  ossim_int32 width = m_frameWidthVector[col];
171  ossim_int32 height = m_frameHeightVector[row];
172  ossim_int32 pixelRow = entry.thePixelRow;
173  ossim_int32 pixelCol = entry.thePixelCol;
174 
175  ossimIrect imageRect(pixelCol, pixelRow, pixelCol+width-1, pixelRow+height-1);
176 
177  ossimIrect cacheRect(pixelCol, pixelRow, pixelCol+m_cacheSize.x-1, pixelRow+m_cacheSize.y-1);
178 
179  ossimIrect clipRect = cacheRect.clipToRect(imageRect);
180 
181  m_cacheTile->setImageRectangle(clipRect);
182 
183  if (!cacheRect.completely_within(imageRect))
184  {
186  }
187 
189 
190  void* lineBuffer = 0;
191  std::vector<PoDoFo::PdfObject*> imageObjects = entry.theFrameEntry;
192  if (imageObjects.size() == 1)
193  {
194  PoDoFo::PdfMemStream* pStream = dynamic_cast<PoDoFo::PdfMemStream*>(imageObjects[0]->GetStream());
195  pStream->Uncompress();
196  PoDoFo::pdf_long length = pStream->GetLength();
197  pStream->GetCopy((char**)&lineBuffer, &length);
198  if (lineBuffer)
199  {
200  m_cacheTile->loadTile(lineBuffer, imageRect, clipRect, OSSIM_BIP);
201  delete [] (char*)lineBuffer;
202  lineBuffer = 0;
203  }
204  }
205  else
206  {
207  for (ossim_uint32 band = 0; band < m_numberOfBands; ++band)
208  {
209  PoDoFo::PdfMemStream* pStream = dynamic_cast<PoDoFo::PdfMemStream*>(imageObjects[band]->GetStream());
210  pStream->Uncompress();
211  PoDoFo::pdf_long length = pStream->GetLength();
212  pStream->GetCopy((char**)&lineBuffer, &length);
213 
214  if (lineBuffer)
215  {
216  m_cacheTile->loadBand(lineBuffer, imageRect,clipRect, band);
217  delete [] (char*)lineBuffer;
218  lineBuffer = 0;
219  }
220  }
221  }
222  if (lineBuffer != NULL)
223  {
224  delete [] (char*)lineBuffer;
225  lineBuffer = 0;
226  }
227 }
228 
230 {
231  return ossimString("ossim_geopdf_reader");
232 }
233 
235 {
236  return ossimString("ossim geopdf reader");
237 }
238 
240 {
241  return ossimString("ossimGeoPdfReader");
242 }
243 
245  ossim_uint32 resLevel) const
246 {
247  if (resLevel == 0)
248  {
249  return m_numberOfLines;
250  }
251  else if ( theOverview.valid() )
252  {
253  return theOverview->getNumberOfLines(resLevel);
254  }
255 
256  return 0;
257 }
258 
260  ossim_uint32 resLevel) const
261 {
262  if (resLevel == 0)
263  {
264  return m_numberOfSamples;
265  }
266  else if ( theOverview.valid() )
267  {
268  return theOverview->getNumberOfSamples(resLevel);
269  }
270 
271  return 0;
272 }
273 
275 {
276  static const char MODULE[] = "ossimGeoPdfReader::open";
277 
278  if (traceDebug())
279  {
281  << MODULE << " entered...\n"
282  << "image: " << theImageFile << "\n";
283  }
284 
285  bool result = false;
286  closeEntry();
287 
288  if ( theImageFile.size() )
289  {
290  PoDoFo::PdfError::EnableDebug(false);//do not print out debug info
291 
292  try
293  {
294  m_pdfMemDocument = new PoDoFo::PdfMemDocument(theImageFile.c_str());
295  }
296  catch (...)
297  {
298  return false;
299  }
300 
301  if (m_pdfMemDocument != NULL)
302  {
303  int count = m_pdfMemDocument->GetPageCount();
304  for(int i = 0; i < count; ++i)
305  {
306  PoDoFo::PdfPage* pdfPage = m_pdfMemDocument->GetPage(i);
307  if( pdfPage )
308  {
309  PoDoFo::PdfObject* pdfObject = pdfPage->GetObject();
310  PoDoFo::PdfObject* geoPdfObject = NULL;
311  if( pdfObject->GetDictionary().HasKey(PoDoFo::PdfName("LGIDict") ) )
312  {
313  geoPdfObject = pdfObject->GetDictionary().GetKey(PoDoFo::PdfName("LGIDict"));
314  m_isLGIDict = true;
315  }
316  else if (pdfObject->GetDictionary().HasKey(PoDoFo::PdfName("VP") ))
317  {
318  geoPdfObject = pdfObject->GetDictionary().GetKey(PoDoFo::PdfName("VP"));
319  }
320 
321  if (geoPdfObject)
322  {
323  std::string imagInfo; //try to get tile structure information
324  geoPdfObject->ToString(imagInfo);
325  ossimString imagInfoStr = imagInfo;
326 
327  if (imagInfoStr.downcase().contains("tile") == false)//if not, try to get tile structure info from source object
328  {
329  PoDoFo::PdfObject* pSource = pdfPage->GetResources();
330  pSource->ToString(imagInfo);
331  imagInfoStr = imagInfo;
332  }
333  std::vector<ossimString> imageInfoVector;
334  imageInfoVector.push_back(imagInfoStr);
335  parseTileStructure(imageInfoVector);
338  setPodofoInfo(geoPdfObject);
339  }
340  else
341  {
342  continue;
343  }
344 
345  // Create the geometry.
347  geoImage->setProjection(getGeoProjection());
349 
350  // Create the node.
352  node->setGeoImage(geoImage);
353  node->setBoundingBox(computeBoundingRect(geoImage));
354 
355  // Add to array.
356  m_pageVector.push_back(node);
357 
358  m_pdfMemDocument->FreeObjectMemory(pdfObject);
359  }
360 
361  } // Matches: for(int i = 0; i < count; ++i)
362 
363  if ( m_pageVector.size() )
364  {
365  result = true;
366  }
367  }
368 
370  m_tile->initialize();
373 
376 
379 
380  completeOpen();
381 
382  if (result == false)
383  {
384  closeEntry();
385  }
386 
387  } // Matches: if ( theImageFile.size() )
388 
389  return result;
390 }
391 
392 void ossimGeoPdfReader::parseTileStructure(std::vector<ossimString> tileInfo)
393 {
394  m_podofoTileInfo.clear();
395  std::vector<ossimString> tileInfoVector;
396  for (ossim_uint32 index = 0; index < tileInfo.size(); ++index)
397  {
398  std::vector<ossimString> tmpVector = tileInfo[index].split("\n");
399  for (ossim_uint32 i = 0; i < tmpVector.size(); i++)
400  {
401  ossimString tmpStr = tmpVector[i];
402  if (tmpStr.downcase().contains("layer_"))
403  {
404  buildTileInfo(tmpStr);
405  }
406  else if (tmpStr.downcase().contains("tile"))
407  {
408  tileInfoVector.push_back(tmpStr);
409  }
410  }
411  }
412 
413  if (m_podofoTileInfo.size() == 0)//does not layer information, try tile information
414  {
415  for (ossim_uint32 index = 0; index < tileInfoVector.size(); ++index)
416  {
417  buildTileInfo(tileInfoVector[index]);
418  }
419  }
420 
421  tileInfoVector.clear();
422 }
423 
425 {
426  std::vector<ossimString> tmpKeyValue = tileInfo.split(" ");
427 
428  if (tmpKeyValue.size() > 1)
429  {
430  std::vector<ossimString> layerNameVector = tmpKeyValue[0].split("_");
431  ossim_int32 col = layerNameVector[layerNameVector.size()-2].toInt();
432  ossim_int32 row = layerNameVector[layerNameVector.size()-1].toInt();
433  std::pair<ossim_int32, ossim_int32> tileRowCol;
434  tileRowCol = make_pair(row, col);
435  ossim_int32 tileIndex = tmpKeyValue[1].toInt();
436 
437  m_podofoTileInfo[tileIndex] = tileRowCol;
438  }
439 }
440 
442 {
443  // ossim_uint32 entry = 0;
444  ossimKeywordlist kwl;
445  ossimString pfx = "image";
446  pfx += ossimString::toString(0);
447  pfx += ".";
448 
449  double ll_lat = 0.0;
450  double ll_lon = 0.0;
451  double lr_lat = 0.0;
452  double lr_lon = 0.0;
453  double ul_lat = 0.0;
454  double ul_lon = 0.0;
455  double ur_lat = 0.0;
456  double ur_lon = 0.0;
457  ossimDrect rect2(ossimDpt(0,0), ossimDpt(0,0),ossimDpt(0,0),ossimDpt(0,0));
458 
459  ossimProjection* proj = geoImage->getProjection();
460  if (m_isLGIDict)
461  {
462  ossimString bBoxStr = getValueFromMap(m_podofoProjInfo, "Registration");
463  std::vector<ossimString> tmpVector = bBoxStr.split(")");
464  std::vector<ossimString> tmpVector1;
465  for (ossim_uint32 i = 0; i < tmpVector.size(); i++)
466  {
467  ossimString tmpStr = tmpVector[i];
468  if (tmpStr.contains("(") || tmpStr.contains(")"))
469  {
470  tmpStr = tmpStr.substitute("[", "", true).trim();
471  tmpStr = tmpStr.substitute("]", "", true).trim();
472  tmpStr = tmpStr.substitute("(", "", true).trim();
473  tmpStr = tmpStr.substitute(")", "", true).trim();
474  tmpVector1.push_back(tmpStr);
475  }
476  }
477 
478  if (tmpVector1.size() == 8)
479  {
480  ll_lon = tmpVector1[2].toDouble();
481  ll_lat = tmpVector1[3].toDouble();
482  ur_lon = tmpVector1[6].toDouble();
483  ur_lat = tmpVector1[7].toDouble();
484 
485  lr_lon = tmpVector1[6].toDouble();
486  lr_lat = tmpVector1[3].toDouble();
487  ul_lon = tmpVector1[2].toDouble();
488  ul_lat = tmpVector1[7].toDouble();
489  }
490  else if (tmpVector1.size() == 16)
491  {
492  ll_lon = tmpVector1[2].toDouble();
493  ll_lat = tmpVector1[3].toDouble();
494  lr_lon = tmpVector1[6].toDouble();
495  lr_lat = tmpVector1[7].toDouble();
496 
497  ur_lon = tmpVector1[10].toDouble();
498  ur_lat = tmpVector1[11].toDouble();
499  ul_lon = tmpVector1[14].toDouble();
500  ul_lat = tmpVector1[15].toDouble();
501  }
502  }
503  else
504  {
505  std::vector<ossimString> tmpVector;
506  ossimString coodStr = getValueFromMap(m_podofoProjInfo, "GPTS");
507  if (!coodStr.empty())
508  {
509  std::vector<ossimString> coodVector = coodStr.split(" ");
510 
511  for (ossim_uint32 i = 0; i < coodVector.size(); i++)
512  {
513  ossimString tmp = coodVector[i].trim();
514  if (!tmp.empty() && tmp.contains("[") == false && tmp.contains("]") == false)
515  {
516  tmpVector.push_back(tmp);
517  }
518  }
519 
520  ll_lat = tmpVector[0].toDouble();
521  ll_lon = tmpVector[1].toDouble();
522  lr_lat = tmpVector[2].toDouble();
523  lr_lon = tmpVector[3].toDouble();
524  ur_lat = tmpVector[4].toDouble();
525  ur_lon = tmpVector[5].toDouble();
526  ul_lat = tmpVector[6].toDouble();
527  ul_lon = tmpVector[7].toDouble();
528  }
529  }
530 
531  if(proj)
532  {
533  ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(proj);
534 
535  ossimDrect rect(ossimDpt(ul_lon, ul_lat),
536  ossimDpt(ur_lon, ur_lat),
537  ossimDpt(lr_lon, lr_lat),
538  ossimDpt(ll_lon, ll_lat), OSSIM_RIGHT_HANDED);
539 
540  std::vector<ossimGpt> points;
541  if (mapProj->isGeographic())
542  {
543  ossimGpt g1(ul_lat, ul_lon);
544  ossimGpt g2(ur_lat, ur_lon);
545  ossimGpt g3(lr_lat, lr_lon);
546  ossimGpt g4(ll_lat, ll_lon);
547 
548  points.push_back(g1);
549  points.push_back(g2);
550  points.push_back(g3);
551  points.push_back(g4);
552  ossimGpt tie(ul_lat, ul_lon);
553  mapProj->setUlTiePoints(tie);
554  if (m_numberOfLines != 0 && m_numberOfSamples != 0)
555  {
556  ossim_float64 scaleLat = (ul_lat - lr_lat)/m_numberOfLines;
557  ossim_float64 scaleLon = (lr_lon - ul_lon)/m_numberOfSamples;
558 
559  ossimDpt gsd(fabs(scaleLon), fabs(scaleLat));
560  mapProj->setDecimalDegreesPerPixel(gsd);
561  }
562  }
563  else if (!mapProj->isGeographic() && m_isLGIDict == false)
564  {
565  ossimGpt g1(ul_lat, ul_lon);
566  ossimGpt g2(ur_lat, ur_lon);
567  ossimGpt g3(lr_lat, lr_lon);
568  ossimGpt g4(ll_lat, ll_lon);
569 
570  points.push_back(g1);
571  points.push_back(g2);
572  points.push_back(g3);
573  points.push_back(g4);
574 
575  if (m_numberOfLines != 0 && m_numberOfSamples != 0)
576  {
577  ossimDpt ulEn = mapProj->forward(g1);
578  ossimDpt lrEn = mapProj->forward(g3);
579 
580  mapProj->setUlEastingNorthing(ulEn);
581 
582  ossim_float64 scaleLat = (ulEn.y - lrEn.y)/m_numberOfLines;
583  ossim_float64 scaleLon = (lrEn.x - ulEn.x)/m_numberOfSamples;
584 
585  ossimDpt gsd(fabs(scaleLon), fabs(scaleLat));
586  mapProj->setMetersPerPixel(gsd);
587  }
588  }
589  else
590  {
591  ossimGpt g1 = proj->inverse(rect.ul());
592  ossimGpt g2 = proj->inverse(rect.ur());
593  ossimGpt g3 = proj->inverse(rect.lr());
594  ossimGpt g4 = proj->inverse(rect.ll());
595 
596  points.push_back(g1);
597  points.push_back(g2);
598  points.push_back(g3);
599  points.push_back(g4);
600 
601  ossimDpt tie(ul_lon, ul_lat);
602  if (mapProj)
603  {
604  mapProj->setUlTiePoints(tie);
605  if (m_numberOfLines != 0 && m_numberOfSamples != 0)
606  {
607  ossim_float64 scaleLat = (ul_lat - lr_lat)/m_numberOfLines;
608  ossim_float64 scaleLon = (ur_lon - ll_lon)/m_numberOfSamples;
609  ossimDpt gsd(fabs(scaleLon), fabs(scaleLat));
610  mapProj->setMetersPerPixel(gsd);
611  }
612  }
613  }
614 
615  std::vector<ossimDpt> rectTmp;
616  rectTmp.resize(4);
617 
618  for(std::vector<ossimGpt>::size_type index=0; index < 4; ++index)
619  {
620  geoImage->worldToLocal(points[(int)index], rectTmp[(int)index]);
621  }
622 
623  rect2 = ossimDrect(rectTmp);
624 
625  }
626  return rect2;
627 }
628 
630 {
631  if (m_pageVector.size() > entryIdx)
632  {
633  theGeometry = 0;
635  theGeometry = m_pageVector[entryIdx]->m_geoImage;
636  m_imageRect = m_pageVector[entryIdx]->m_boundingRect;
637  if (theGeometry.valid())
638  {
639  return true;
640  }
641  }
642  return false;
643 }
644 
646  const char* prefix) const
647 {
648  for (ossim_uint32 i = 0; i < m_pageVector.size(); i++)
649  {
650  ossimRefPtr<ossimImageGeometry> imageGeometry = m_pageVector[i]->m_geoImage;
651  if(imageGeometry.valid())
652  {
653  imageGeometry->saveState(kwl, prefix);
654  }
655  }
656 
657  return ossimImageHandler::saveState(kwl, prefix);
658 }
659 
661 {
663 
664  if(ext == "pdf")
665  {
666  return true;
667  }
668  else
669  {
670  return false;
671  }
672 }
673 
675 {
676  m_tile = 0;
677  m_cacheTile = 0;
678  m_podofoProjInfo.clear();
679  m_podofoTileInfo.clear();
680  m_frameWidthVector.clear();
681  m_frameHeightVector.clear();
682 
683  if (m_pdfMemDocument)
684  {
685  std::map<int, PoDoFo::PdfObject*>::iterator it = m_podofoImageObjs.begin();
686  while (it != m_podofoImageObjs.end())
687  {
688  m_pdfMemDocument->FreeObjectMemory(it->second);
689  it++;
690  }
691  }
692  m_podofoImageObjs.clear();
693 
694  if (m_frameEntryArray.size() > 0)
695  {
696  for (ossim_uint32 i = 0; i < m_frameEntryArray.size(); i++)
697  {
698  std::vector< std::vector<PoDoFo::PdfObject*> > tmpVector = m_frameEntryArray[i];
699  for (ossim_uint32 j = 0; j < tmpVector.size(); j++)
700  {
701  std::vector<PoDoFo::PdfObject*> tmpVector1 = tmpVector[j];
702  for (ossim_uint32 k = 0; k < tmpVector1.size(); k++)
703  {
704  m_pdfMemDocument->FreeObjectMemory(tmpVector1[k]);
705  }
706  }
707  }
708  }
709  m_frameEntryArray.clear();
710 
711  if (m_pdfMemDocument != NULL)
712  {
713  delete m_pdfMemDocument;
714  m_pdfMemDocument = 0;
715  }
716 
717  for(ossim_uint32 i = 0; i < m_pageVector.size(); ++i)
718  {
719  if(m_pageVector[i])
720  {
721  delete m_pageVector[i];
722  }
723  }
724  m_pageVector.clear();
725 
727 }
728 
730 {
731  return (ossim_uint32)m_pageVector.size();
732 }
733 
734 void ossimGeoPdfReader::getEntryList(std::vector<ossim_uint32>& entryList) const
735 {
736  if (m_pageVector.size() > 0)
737  {
738  for (ossim_uint32 i = 0; i < getNumberOfEntries(); i++)
739  {
740  entryList.push_back(i);
741  }
742  }
743  else
744  {
746  }
747 }
748 
750  const ossimIrect& rect, ossim_uint32 resLevel)
751 {
752  if (m_tile.valid())
753  {
754  // Image rectangle must be set prior to calling getTile.
755  m_tile->setImageRectangle(rect);
756 
757  if ( getTile( m_tile.get(), resLevel ) == false )
758  {
760  {
761  m_tile->makeBlank();
762  }
763  }
764  }
765 
766  return m_tile;
767 }
768 
770  ossim_uint32 resLevel)
771 {
772  bool status = false;
773 
774  //---
775  // Not open, this tile source bypassed, or invalid res level,
776  // return a blank tile.
777  //---
778  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
779  result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
780  {
781  result->ref(); // Increment ref count.
782 
783  //---
784  // Check for overview tile. Some overviews can contain r0 so always
785  // call even if resLevel is 0. Method returns true on success, false
786  // on error.
787  //---
788  status = getOverviewTile(resLevel, result);
789 
790  if (!status) // Did not get an overview tile.
791  {
792  status = true;
793 
794  ossimIrect tile_rect = result->getImageRectangle();
795 
796  if (getImageRectangle().intersects(tile_rect))
797  {
798  // Make a clip rect.
799  ossimIrect clip_rect = tile_rect.clipToRect(getImageRectangle());
800 
801  std::vector<ossimFrameEntryData> frames = getIntersectingEntries(clip_rect);
802 
803  if (!tile_rect.completely_within(getImageRectangle()) )
804  {
805  result->makeBlank();
806  }
807 
808  for(ossim_uint32 idx = 0; idx < frames.size(); ++idx)
809  {
810  resetCacheBuffer(frames[idx]);
811  m_currentRow = frames[idx].theRow;
812 
813  fillTile(ossim_uint8(0), clip_rect, result);
814  }
815  }
816  else // No intersection...
817  {
818  result->makeBlank();
819  }
820  }
821 
822  result->unref(); // Decrement ref count.
823  }
824 
825  return status;
826 }
827 
828 template <class T>
829 void ossimGeoPdfReader::fillTile(T, // dummy template variable
830  const ossimIrect& clip_rect,
831  ossimImageData* tile)
832 {
833  if (m_isJpeg == true)
834  {
835  tile->loadTile(m_cacheTile.get());
836  }
837  else
838  {
839  const ossimIrect img_rect = tile->getImageRectangle();
841  if (!img_rect.intersects(src_rect) )
842  {
843  return; // Nothing to do here.
844  }
845 
846  // Check the clip rect.
847  if (!clip_rect.completely_within(img_rect))
848  {
849  return;
850  }
851 
852  ossimIrect clipRect = clip_rect.clipToRect(src_rect);
853  void* src = (void*)m_cacheTile->getBuf();
854  if (!src)
855  {
856  // Set the error...
859  "%s File %s line %d\nNULL pointer passed to method!");
860  return;
861  }
862 
863  // Check the status and allocate memory if needed.
864  if (tile->getDataObjectStatus() == OSSIM_NULL)
865  {
866  tile->initialize();
867  }
868 
869  // Get the width of the buffers.
870  ossim_uint32 num_bands = tile->getNumberOfBands();
871  ossim_uint32 s_width = src_rect.width();
872  ossim_uint32 d_width = tile->getWidth();
873  ossim_uint32 s_band_offset = s_width * src_rect.height();
874 
875  const T* s = static_cast<const T*>(src);
876 
877  ossim_uint32 destinationOffset = (clipRect.ul().y - img_rect.ul().y) * d_width +
878  (clipRect.ul().x - img_rect.ul().x);
879 
880  ossim_uint32 destinationIndex = destinationOffset;
881 
882  ossim_uint32 clipHeight = clipRect.height();
883  ossim_uint32 clipWidth = clipRect.width();
884 
885  ossim_uint32 sourceOffset = (src_rect.ll().y - clipRect.ul().y) * s_width +
886  (clipRect.ul().x - src_rect.ul().x);
887  ossim_uint32 sourceIndex = sourceOffset;
888 
889  // Copy the data.
890  for (ossim_uint32 band=0; band<num_bands; band++)
891  {
892  T* destinationBand = static_cast<T*>(tile->getBuf(band));
893  destinationIndex = destinationOffset;
894  sourceIndex = sourceOffset + s_band_offset*band;
895 
896  for (ossim_uint32 line = 0; line < clipHeight; ++line)
897  {
898  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
899  {
900  destinationBand[destinationIndex + sample]
901  = s[sourceIndex+sample];
902  }
903  sourceIndex -= s_width;
904  destinationIndex += d_width;
905  }
906  }
907  }
908  tile->validate();
909 }
910 
912 {
913  return m_numberOfBands;
914 }
915 
917 {
918  return m_numberOfBands;
919 }
920 
922 {
923  return 0;
924 }
925 
927 {
928  return 0;
929 }
930 
932 {
933  return m_scalarType;
934 }
935 
937 {
938  if ( !theGeometry )
939  {
940  // Check for external geom:
942 
943  if ( !theGeometry.valid() )
944  {
945  // Internnal geom:
947 
948  if ( !theGeometry.valid() )
949  {
951  }
952 
953  // Check for set projection.
954  if ( !theGeometry->getProjection() )
955  {
956  // Try factories for projection.
958  }
959  }
960 
961  // Set image things the geometry object should know about.
963  }
964  return theGeometry;
965 }
966 
968 {
970  if (m_pageVector.size() > 0)
971  {
972  geom = m_pageVector[0]->m_geoImage;
973  }
974  return geom;
975 }
976 
977 bool ossimGeoPdfReader::loadState(const ossimKeywordlist& kwl, const char* prefix)
978 {
979  bool result = false;
980  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
981  if( (type == "ossimGeoPdfReader") || (type == "ossimImageHandler") )
982  {
983  if ( ossimImageHandler::loadState(kwl, prefix) )
984  {
985  result = open();
986  }
987  }
988  return result;
989 }
990 
992 {
993  if (m_isLGIDict)
994  {
995  return getLGIDictGeoProjection();
996  }
997  else
998  {
999  return getVPGeoProjection();
1000  }
1001  return NULL;
1002 }
1003 
1005 {
1006  ossimKeywordlist kwl;
1007  ossimString pfx = "image";
1008  pfx += ossimString::toString(0);
1009  pfx += ".";
1010 
1011  ossimProjection* proj = NULL;
1012 
1013  ossimString projCode = getValueFromMap(m_podofoProjInfo, "EPSG");
1014  if (!projCode.empty())
1015  {
1016  kwl.add(pfx.c_str(), ossimKeywordNames::PCS_CODE_KW, projCode, true);
1017  projCode = ossimString("EPSG:") + projCode;
1019  }
1020  return proj;
1021 }
1022 
1024 {
1025  ossimProjection* proj = NULL;
1026  ossimString projContents = getValueFromMap(m_podofoProjInfo, "Projection");
1027  if (!projContents.empty())
1028  {
1029  proj = getProjectionFromStr(projContents);
1030  }
1031  return proj;
1032 }
1033 
1034 void ossimGeoPdfReader::setPodofoInfo(PoDoFo::PdfObject* object)
1035 {
1036  m_podofoProjInfo.clear();
1037  if (object->IsReference())
1038  {
1039  setPodofoRefInfo(object);
1040  }
1041  else if (object->IsDictionary())
1042  {
1043  setPodofoDictInfo(object);
1044  }
1045  else if (object->IsArray())
1046  {
1047  setPodofoArrayInfo(object);
1048  }
1049 }
1050 
1051 void ossimGeoPdfReader::setPodofoArrayInfo(PoDoFo::PdfObject* object)
1052 {
1053  PoDoFo::PdfArray arrayObj = object->GetArray();
1054  for (ossim_uint32 i = 0; i < arrayObj.size(); i++)
1055  {
1056  PoDoFo::PdfObject objTmp = arrayObj[i];
1057  if (objTmp.IsDictionary())
1058  {
1059  setPodofoDictInfo(&objTmp);
1060  }
1061  else if (objTmp.IsReference())
1062  {
1063  setPodofoRefInfo(&objTmp);
1064  }
1065  }
1066 }
1067 
1068 void ossimGeoPdfReader::setPodofoRefInfo(PoDoFo::PdfObject* object)
1069 {
1070  PoDoFo::PdfReference pdfReference = object->GetReference();
1071  PoDoFo::PdfVecObjects objVector = m_pdfMemDocument->GetObjects();
1072  if (pdfReference.IsIndirect())
1073  {
1074  PoDoFo::PdfObject* refObj = objVector.GetObject(pdfReference);
1075  if (refObj->IsDictionary())
1076  {
1077  setPodofoDictInfo(refObj);
1078  }
1079  }
1080 }
1081 
1082 void ossimGeoPdfReader::setPodofoDictInfo(PoDoFo::PdfObject* object)
1083 {
1084  std::string valueStr;
1085  PoDoFo::PdfDictionary pdfDictionary = object->GetDictionary();
1086  PoDoFo::TKeyMap keyMap = pdfDictionary.GetKeys();
1087  PoDoFo::TKeyMap::iterator it = keyMap.begin();
1088  while (it != keyMap.end())
1089  {
1090  ossimString refName = ossimString(it->first.GetName());
1091  PoDoFo::PdfObject* refObj = it->second;
1092  if (refObj->IsReference())
1093  {
1094  setPodofoRefInfo(refObj);
1095  }
1096  else
1097  {
1098  refObj->ToString(valueStr);
1099  if (valueStr != "")
1100  {
1101  m_podofoProjInfo[refName] = valueStr;
1102  }
1103  }
1104  it++;
1105  }
1106 }
1107 
1109 {
1110  PoDoFo::PdfObject* pObj = NULL;
1111  m_podofoImageObjs.clear();
1112  std::vector<ossimString> tmpForm;
1113  int count = 1;
1114  int rowCount = 0;
1115  bool isDctDecode = false;
1116  PoDoFo::TCIVecObjects it = m_pdfMemDocument->GetObjects().begin();
1117  while( it != m_pdfMemDocument->GetObjects().end() )
1118  {
1119  if ((*it)->IsDictionary())
1120  {
1121  pObj = (*it)->GetDictionary().GetKey( PoDoFo::PdfName::KeyType );
1122  if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "XObject" ))
1123  {
1124  pObj = (*it)->GetDictionary().GetKey( PoDoFo::PdfName::KeySubtype );
1125  if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "Form" ))
1126  {
1127  std::string imageTileInfo;
1128  (*it)->ToString(imageTileInfo);
1129  ossimString imageTileInfoStr = imageTileInfo;
1130  if (imageTileInfoStr.downcase().contains("tile"))
1131  {
1132  tmpForm.push_back(imageTileInfoStr);
1133  }
1134  }
1135  else if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "Image" ))
1136  {
1137  pObj = (*it)->GetDictionary().GetKey( PoDoFo::PdfName::KeyFilter );
1138  if( pObj->IsName() && ( pObj->GetName().GetName() == "DCTDecode" ))
1139  {
1140  m_podofoImageObjs[count] = (*it);
1141  isDctDecode = true;
1142  }
1143  else if( pObj->IsArray() && pObj->GetArray().GetSize() == 1 &&
1144  pObj->GetArray()[0].IsName() && (pObj->GetArray()[0].GetName().GetName() == "DCTDecode"))
1145  {
1146  m_podofoImageObjs[count] = (*it);
1147  isDctDecode = true;
1148  }
1149  else if (pObj->IsName() && (pObj->GetName().GetName() == "FlateDecode") )
1150  {
1151  if (isDctDecode == false)
1152  {
1153  std::pair<ossim_int32, ossim_int32> tileRowCol;
1154  tileRowCol = make_pair(rowCount, 0);
1155  m_podofoTileInfo[count] = tileRowCol;
1156  m_podofoImageObjs[count] = (*it);
1157  m_isJpeg = false;
1158  }
1159  rowCount++;
1160  }
1161  }
1162  }
1163  }
1164  ++it;
1165  ++count;
1166  }
1167 
1168  if (m_isJpeg == false)
1169  {
1170  std::map<ossim_int32, ossim_int32> widthMap;
1171  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator it = m_podofoImageObjs.begin();
1172  while (it != m_podofoImageObjs.end())
1173  {
1174  PoDoFo::PdfObject* tmpObj = it->second;
1175  PoDoFo::PdfImage image(tmpObj);
1176  int width = image.GetWidth();
1177  widthMap[it->first] = width;
1178  it++;
1179  }
1180 
1181  std::map<ossim_int32, ossim_int32>::iterator itWidth = widthMap.begin();
1182  ossim_int32 firstId = itWidth->first;
1183  ossim_int32 firstWidth = itWidth->second;
1184  widthMap.erase(itWidth);
1185 
1186  itWidth = widthMap.end();
1187  itWidth--;
1188  ossim_int32 lastId = itWidth->first;
1189  ossim_int32 lastWidth = itWidth->second;
1190 
1191  itWidth = widthMap.begin();
1192  ossim_int32 invalidId = 0;
1193  while (itWidth != widthMap.end())
1194  {
1195  ossim_int32 tmpWidth = itWidth->second;
1196  ossim_int32 tmpId = itWidth->first;
1197  if (firstWidth == tmpWidth)
1198  {
1199  invalidId = lastId;
1200  }
1201  else if ( lastWidth == tmpWidth )
1202  {
1203  invalidId = firstId;
1204  }
1205  else
1206  {
1207  invalidId = tmpId;
1208  }
1209  break;
1210  itWidth++;
1211  }
1212 
1213  it = m_podofoImageObjs.find(invalidId);
1214  if (it != m_podofoImageObjs.end())
1215  {
1216  m_podofoImageObjs.erase(it);
1217  }
1218 
1219  std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> >::iterator itTile = m_podofoTileInfo.find(invalidId);
1220  if (itTile != m_podofoTileInfo.end())
1221  {
1222  m_podofoTileInfo.erase(itTile);
1223  }
1224 
1225  if (invalidId == firstId)
1226  {
1227  itTile = m_podofoTileInfo.begin();
1228  while (itTile != m_podofoTileInfo.end())
1229  {
1230  ossim_int32 index = itTile->first;
1231  ossim_int32 tileRow = itTile->second.first;
1232  if (tileRow > 0)
1233  {
1234  std::pair<ossim_int32, ossim_int32> tileRowCol;
1235  tileRowCol = make_pair(tileRow-1, 0);
1236  m_podofoTileInfo[index] = tileRowCol;
1237  }
1238  else
1239  {
1240  break;
1241  }
1242  itTile++;
1243  }
1244  }
1245  widthMap.clear();
1246  }
1247 
1248  if (tmpForm.size() > 0 && m_podofoTileInfo.size() == 0)
1249  {
1250  parseTileStructure(tmpForm);
1251  }
1252  tmpForm.clear();
1253 }
1254 
1256 {
1257  m_frameWidthVector.clear();
1258  m_frameHeightVector.clear();
1259  ossim_int32 row = 0;
1260  ossim_int32 col = 0;
1261  if (m_podofoImageObjs.size() > 0 && m_podofoTileInfo.size() > 0)
1262  {
1263  //Podofo libary may skip some objects when reading file which cause the count of objects
1264  //different between tile info and image info. need offset to correct it.
1265  std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> >::iterator itTileEnd;
1266  itTileEnd = m_podofoTileInfo.end();
1267  itTileEnd--;
1268 
1269  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator itObjeEnd;
1270  itObjeEnd = m_podofoImageObjs.end();
1271  itObjeEnd--;
1272 
1273  ossim_int32 indexOffset = itTileEnd->first - itObjeEnd->first;
1274 
1275  std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> >::iterator it = m_podofoTileInfo.begin();
1276  //get number of vertical frames and number of horizontal frames
1277  while (it != m_podofoTileInfo.end())
1278  {
1279  ossim_int32 index = it->first;
1280  if (indexOffset > 0)
1281  {
1282  index = index - indexOffset;
1283  }
1284  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator itObj = m_podofoImageObjs.find(index);
1285  if (itObj != m_podofoImageObjs.end())
1286  {
1287  row = it->second.first;
1288  col = it->second.second;
1289  if (m_numOfFramesHorizontal <= col)
1290  {
1292  }
1293  if (m_numOfFramesVertical <= row)
1294  {
1295  m_numOfFramesVertical = row;
1296  }
1297  }
1298  it++;
1299  }
1300 
1301  //set up array size
1304 
1306  for(ossim_uint32 index = 0; index < m_frameEntryArray.size(); index++)
1307  {
1309  }
1310 
1311  //build array
1312  it = m_podofoTileInfo.begin();
1313  std::vector<PoDoFo::PdfObject*> tmpObjVector;
1314  while (it != m_podofoTileInfo.end())
1315  {
1316  ossim_int32 index = it->first;
1317  if (indexOffset > 0)
1318  {
1319  index = index - indexOffset;
1320  }
1321  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator itObj = m_podofoImageObjs.find(index);
1322  if (itObj != m_podofoImageObjs.end())
1323  {
1324  ossim_int32 rowCount = it->second.first;
1325  ossim_int32 colCount = it->second.second;
1326  m_frameEntryArray[rowCount][colCount].push_back(itObj->second);
1327  }
1328  it++;
1329  }
1330 
1331  //calculate lines and samples
1332  for (row = 0; row < m_numOfFramesVertical; ++row)
1333  {
1334  PoDoFo::PdfObject* tmpObj = m_frameEntryArray[row][0][0];
1335  PoDoFo::PdfImage image(tmpObj);
1336  int height = image.GetHeight();
1337  m_frameHeightVector[row] = height;
1338  }
1339 
1340  for (col = 0; col < m_numOfFramesHorizontal; ++col)
1341  {
1342  PoDoFo::PdfObject* tmpObj = m_frameEntryArray[0][col][0];
1343  PoDoFo::PdfImage image(tmpObj);
1344  int width = image.GetWidth();
1345  m_frameWidthVector[col] = width;
1346  }
1347 
1348  std::map<ossim_int32, ossim_int32>::iterator itWidth = m_frameWidthVector.begin();
1349  while (itWidth != m_frameWidthVector.end())
1350  {
1351  m_numberOfSamples = m_numberOfSamples + itWidth->second;
1352  itWidth++;
1353  }
1354 
1355  std::map<ossim_int32, ossim_int32>::iterator itHeight = m_frameHeightVector.begin();
1356  while (itHeight != m_frameHeightVector.end())
1357  {
1358  m_numberOfLines = m_numberOfLines + itHeight->second;
1359  itHeight++;
1360  }
1362 
1363  //get the number of bands
1364  if (m_frameEntryArray[0][0].size() > 2)
1365  {
1367  }
1368  else
1369  {
1370  PoDoFo::PdfObject* tmpObject = m_frameEntryArray[0][0][0];
1371  PoDoFo::PdfMemStream* pStream = dynamic_cast<PoDoFo::PdfMemStream*>(tmpObject->GetStream());
1372  pStream->Uncompress();
1373  ossim_int32 length = pStream->GetLength();
1375  }
1376  }
1377 }
1378 
1379 std::vector<ossimGeoPdfReader::ossimFrameEntryData> ossimGeoPdfReader::getIntersectingEntries(const ossimIrect& rect)
1380 {
1381  std::vector<ossimFrameEntryData> result;
1382 
1383  // make sure we have the Toc entry to render
1384  if(!isOpen()) return result;
1385 
1386  ossimIrect imageRect = getImageRectangle();
1387  if(rect.intersects(imageRect))
1388  {
1389  ossimIrect clipRect = rect.clipToRect(imageRect);
1390  ossimIrect frameRect(clipRect.ul().x/m_frameWidthVector[0],
1391  clipRect.ul().y/m_frameHeightVector[0],
1392  clipRect.lr().x/m_frameWidthVector[0],
1393  clipRect.lr().y/m_frameHeightVector[0]);
1394 
1395  for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
1396  {
1397  for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
1398  {
1399  ossim_int32 pixelRow = 0;
1400  ossim_int32 pixelCol = 0;
1401  for (ossim_int32 iRow = 0; iRow < row; ++iRow)
1402  {
1403  pixelRow = pixelRow + m_frameHeightVector[iRow];
1404  }
1405  for (ossim_int32 iCol = 0; iCol < col; ++iCol)
1406  {
1407  pixelCol = pixelCol + m_frameWidthVector[iCol];
1408  }
1409  std::vector<PoDoFo::PdfObject*> tempEntry = m_frameEntryArray[row][col];
1410  if(tempEntry.size() > 0)
1411  {
1412  result.push_back(ossimFrameEntryData(row,
1413  col,
1414  pixelRow,
1415  pixelCol,
1416  tempEntry));
1417  }
1418  }
1419  }
1420  }
1421 
1422  return result;
1423 }
1424 
1426 {
1427  std::vector<ossimString> tmpVector = projContents.split("\n");
1428  std::map<ossimString, ossimString, ossimStringLtstr> projectionMap;
1429 
1430  for (ossim_uint32 i = 0; i < tmpVector.size(); i++)
1431  {
1432  ossimString tmpStr = tmpVector[i];
1433  if (tmpStr.contains("/"))
1434  {
1435  std::vector<ossimString> tmpKeyValue = tmpStr.split(" ");
1436  ossimString key;
1437  ossimString valueStr;
1438  for (ossim_uint32 j = 0; j < tmpKeyValue.size(); j++)
1439  {
1440  if (tmpKeyValue[j].contains("/"))
1441  {
1442  key = tmpKeyValue[j].substitute("/", "", true).trim();
1443  }
1444  else
1445  {
1446  valueStr = tmpKeyValue[j].substitute(")", "", true).trim();
1447  valueStr = valueStr.substitute("(", "", true).trim();
1448  }
1449  }
1450  if (!key.empty() && !valueStr.empty())
1451  {
1452  projectionMap[key] = valueStr;
1453  }
1454  }
1455  }
1456 
1457  ossimString projCode = getValueFromMap(projectionMap, "ProjectionType");
1458  ossimString datumCode = getValueFromMap(projectionMap, "Datum");
1459 
1460  ossimString originLatitudeStr = getValueFromMap(projectionMap, originLatKey);
1461  ossimString centralMeridianStr = getValueFromMap(projectionMap, centralMeridianKey);
1462  ossimString standardParallelOneStr = getValueFromMap(projectionMap, standardParallelOneKey);
1463  ossimString standardParallelTwoStr = getValueFromMap(projectionMap, standardParallelTwoKey);
1464  ossimString falseEastingStr = getValueFromMap(projectionMap, falseEastingKey);
1465  ossimString falseNorthingStr = getValueFromMap(projectionMap, falseNorthingKey);
1466  ossimString scaleFactorStr = getValueFromMap(projectionMap, scaleFactorKey);
1467 
1468  if (projCode == "GEODETIC" || projCode == "GEOGRAPHIC")
1469  {
1470  ossimString codeName = "EPSG:4326";
1471  if (datumCode == "WD")
1472  {
1473  codeName = "EPSG:4322";
1474  }
1476  return proj;
1477  }
1478  else if (projCode == "UT")
1479  {
1480  ossimString zoneStr = getValueFromMap(projectionMap, zoneKey);
1481  ossimString hemisphereStr = getValueFromMap(projectionMap, hemisphereKey);
1482  ossimUtmProjection* utm = new ossimUtmProjection(zoneStr.toInt32());
1483  if (!datumCode.empty())
1484  {
1485  utm->setDatum(ossimDatumFactory::instance()->create(datumCode));
1486  }
1487 
1488  if (!zoneStr.empty())
1489  {
1490  utm->setZone(zoneStr.toInt32());
1491  }
1492 
1493  if (!hemisphereStr.empty())
1494  {
1495  utm->setHemisphere(*hemisphereStr.c_str());
1496  }
1497 
1498  return utm;
1499  }
1500  else if (projCode == "UP")
1501  {
1502  ossimString hemiStr = getValueFromMap(projectionMap, hemisphereKey);
1504 
1505  if (!datumCode.empty())
1506  {
1507  ups->setDatum(ossimDatumFactory::instance()->create(datumCode));
1508  }
1509 
1510  if (!hemiStr.empty())
1511  {
1512  ups->setHemisphere(*hemiStr.c_str());
1513  }
1514 
1515  return ups;
1516  }
1517  else if (projCode == "SPCS")
1518  {
1519  ossimString zoneStr = getValueFromMap(projectionMap, zoneKey);
1520 
1521  ossimString spcsCode;
1522  if (datumCode.upcase().contains("NAR"))
1523  {
1524  spcsCode = ossimString("NAD83_" + projCode + "_" + zoneStr);
1525  }
1526  else if (datumCode.upcase().contains("NAS"))
1527  {
1528  spcsCode = ossimString("NAD83_SPAF_" + zoneStr);
1529  }
1530 
1531  // State plane projections are represented in the EPSG database. Search for corresponding proj
1532  // by name. Name needs to be exact match as found in the EPSG database files:
1534  if (stateProj)
1535  {
1536  return stateProj;
1537  }
1538  }
1539  else if (projCode == "AC")
1540  {
1541  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1542 
1544 
1545  if (!datumCode.empty())
1546  {
1547  albers->setDatum(ossimDatumFactory::instance()->create(datumCode));
1548  }
1549 
1550  if (!origin.isNan())
1551  {
1552  albers->setOrigin(origin);
1553  }
1554 
1555  if (!standardParallelOneStr.empty())
1556  {
1557  albers->setStandardParallel1(standardParallelOneStr.toDouble());
1558  }
1559 
1560  if (!standardParallelTwoStr.empty())
1561  {
1562  albers->setStandardParallel2(standardParallelTwoStr.toDouble());
1563  }
1564 
1565  if (!falseEastingStr.empty())
1566  {
1567  albers->setFalseEasting(falseEastingStr.toDouble());
1568  }
1569 
1570  if (!falseNorthingStr.empty())
1571  {
1572  albers->setFalseNorthing(falseNorthingStr.toDouble());
1573  }
1574 
1575  return albers;
1576  }
1577  else if (projCode == "AL")
1578  {
1580 
1581  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1582 
1583  if (!datumCode.empty())
1584  {
1585  azimEqud->setDatum(ossimDatumFactory::instance()->create(datumCode));
1586  }
1587 
1588  if (!origin.isNan())
1589  {
1590  azimEqud->setOrigin(origin);
1591  }
1592 
1593  if (!falseEastingStr.empty())
1594  {
1595  azimEqud->setFalseEasting(falseEastingStr.toDouble());
1596  }
1597 
1598  if (!falseNorthingStr.empty())
1599  {
1600  azimEqud->setFalseNorthing(falseNorthingStr.toDouble());
1601  }
1602 
1603  return azimEqud;
1604  }
1605  else if (projCode == "BF")
1606  {
1608 
1609  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1610 
1611  if (!datumCode.empty())
1612  {
1613  bonne->setDatum(ossimDatumFactory::instance()->create(datumCode));
1614  }
1615 
1616  if (!origin.isNan())
1617  {
1618  bonne->setOrigin(origin);
1619  }
1620 
1621  if (!falseEastingStr.empty())
1622  {
1623  bonne->setFalseEasting(falseEastingStr.toDouble());
1624  }
1625 
1626  if (!falseNorthingStr.empty())
1627  {
1628  bonne->setFalseNorthing(falseNorthingStr.toDouble());
1629  }
1630 
1631  return bonne;
1632  }
1633  else if (projCode == "CS")
1634  {
1636 
1637  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1638 
1639  if (!datumCode.empty())
1640  {
1641  cassin->setDatum(ossimDatumFactory::instance()->create(datumCode));
1642  }
1643 
1644  if (!origin.isNan())
1645  {
1646  cassin->setOrigin(origin);
1647  }
1648 
1649  if (!falseEastingStr.empty())
1650  {
1651  cassin->setFalseEasting(falseEastingStr.toDouble());
1652  }
1653 
1654  if (!falseNorthingStr.empty())
1655  {
1656  cassin->setFalseNorthing(falseNorthingStr.toDouble());
1657  }
1658 
1659  return cassin;
1660  }
1661  else if (projCode == "LI")
1662  {
1664 
1665  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1666 
1667  if (!datumCode.empty())
1668  {
1669  cyeq->setDatum(ossimDatumFactory::instance()->create(datumCode));
1670  }
1671 
1672  if (!origin.isNan())
1673  {
1674  cyeq->setOrigin(origin);
1675  }
1676 
1677  if (!falseEastingStr.empty())
1678  {
1679  cyeq->setFalseEasting(falseEastingStr.toDouble());
1680  }
1681 
1682  if (!falseNorthingStr.empty())
1683  {
1684  cyeq->setFalseNorthing(falseNorthingStr.toDouble());
1685  }
1686 
1687  return cyeq;
1688  }
1689  else if (projCode == "EF")
1690  {
1692 
1693  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1694 
1695  if (!datumCode.empty())
1696  {
1697  ecker4->setDatum(ossimDatumFactory::instance()->create(datumCode));
1698  }
1699 
1700  if (!origin.isNan())
1701  {
1702  ecker4->setOrigin(origin);
1703  }
1704 
1705  if (!falseEastingStr.empty())
1706  {
1707  ecker4->setFalseEasting(falseEastingStr.toDouble());
1708  }
1709 
1710  if (!falseNorthingStr.empty())
1711  {
1712  ecker4->setFalseNorthing(falseNorthingStr.toDouble());
1713  }
1714 
1715  return ecker4;
1716  }
1717  else if (projCode == "ED")
1718  {
1720 
1721  if (!datumCode.empty())
1722  {
1723  ecker6->setDatum(ossimDatumFactory::instance()->create(datumCode));
1724  }
1725 
1726  if (!centralMeridianStr.empty())
1727  {
1728  ecker6->setCentralMeridian(centralMeridianStr.toDouble());
1729  }
1730 
1731  if (!falseEastingStr.empty())
1732  {
1733  ecker6->setFalseEasting(falseEastingStr.toDouble());
1734  }
1735 
1736  if (!falseNorthingStr.empty())
1737  {
1738  ecker6->setFalseNorthing(falseNorthingStr.toDouble());
1739  }
1740 
1741  return ecker6;
1742  }
1743  else if (projCode == "GN")
1744  {
1746 
1747  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1748 
1749  if (!datumCode.empty())
1750  {
1751  gnomon->setDatum(ossimDatumFactory::instance()->create(datumCode));
1752  }
1753 
1754  if (!origin.isNan())
1755  {
1756  gnomon->setOrigin(origin);
1757  }
1758 
1759  if (!falseEastingStr.empty())
1760  {
1761  gnomon->setFalseEasting(falseEastingStr.toDouble());
1762  }
1763 
1764  if (!falseNorthingStr.empty())
1765  {
1766  gnomon->setFalseNorthing(falseNorthingStr.toDouble());
1767  }
1768 
1769  return gnomon;
1770  }
1771  else if (projCode == "LE")
1772  {
1773  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1774 
1776 
1777  if (!datumCode.empty())
1778  {
1779  lamber->setDatum(ossimDatumFactory::instance()->create(datumCode));
1780  }
1781 
1782  if (!origin.isNan())
1783  {
1784  lamber->setOrigin(origin);
1785  }
1786 
1787  if (!standardParallelOneStr.empty())
1788  {
1789  lamber->setStandardParallel1(standardParallelOneStr.toDouble());
1790  }
1791 
1792  if (!standardParallelTwoStr.empty())
1793  {
1794  lamber->setStandardParallel2(standardParallelTwoStr.toDouble());
1795  }
1796 
1797  if (!falseEastingStr.empty())
1798  {
1799  lamber->setFalseEasting(falseEastingStr.toDouble());
1800  }
1801 
1802  if (!falseNorthingStr.empty())
1803  {
1804  lamber->setFalseNorthing(falseNorthingStr.toDouble());
1805  }
1806 
1807  return lamber;
1808  }
1809  else if (projCode == "MC")
1810  {
1812 
1813  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1814 
1815  if (!datumCode.empty())
1816  {
1817  mercator->setDatum(ossimDatumFactory::instance()->create(datumCode));
1818  }
1819 
1820  if (!origin.isNan())
1821  {
1822  mercator->setOrigin(origin);
1823  }
1824 
1825  if (!scaleFactorStr.empty())
1826  {
1827  mercator->setScaleFactor(scaleFactorStr.toDouble());
1828  }
1829 
1830  if (!falseEastingStr.empty())
1831  {
1832  mercator->setFalseEasting(falseEastingStr.toDouble());
1833  }
1834 
1835  if (!falseNorthingStr.empty())
1836  {
1837  mercator->setFalseNorthing(falseNorthingStr.toDouble());
1838  }
1839 
1840  return mercator;
1841  }
1842  else if (projCode == "MH")
1843  {
1845 
1846  if (!datumCode.empty())
1847  {
1848  miller->setDatum(ossimDatumFactory::instance()->create(datumCode));
1849  }
1850 
1851  if (!centralMeridianStr.empty())
1852  {
1853  miller->setCentralMeridian(centralMeridianStr.toDouble());
1854  }
1855 
1856  if (!falseEastingStr.empty())
1857  {
1858  miller->setFalseEasting(falseEastingStr.toDouble());
1859  }
1860 
1861  if (!falseNorthingStr.empty())
1862  {
1863  miller->setFalseNorthing(falseNorthingStr.toDouble());
1864  }
1865 
1866  return miller;
1867  }
1868  else if (projCode == "MP")
1869  {
1871 
1872  if (!datumCode.empty())
1873  {
1874  mollweid->setDatum(ossimDatumFactory::instance()->create(datumCode));
1875  }
1876 
1877  if (!centralMeridianStr.empty())
1878  {
1879  mollweid->setCentralMeridian(centralMeridianStr.toDouble());
1880  }
1881 
1882  if (!falseEastingStr.empty())
1883  {
1884  mollweid->setFalseEasting(falseEastingStr.toDouble());
1885  }
1886 
1887  if (!falseNorthingStr.empty())
1888  {
1889  mollweid->setFalseNorthing(falseNorthingStr.toDouble());
1890  }
1891 
1892  return mollweid;
1893  }
1894  else if (projCode == "NT")
1895  {
1897  if (!datumCode.empty())
1898  {
1899  newzealand->setDatum(ossimDatumFactory::instance()->create(datumCode));
1900  }
1901  return newzealand;
1902  }
1903  else if (projCode == "OC")
1904  {
1905  ossimString latOne = getValueFromMap(projectionMap, latitudeOneKey);
1906  ossimString lonOne = getValueFromMap(projectionMap, longitudeOneKey);
1907  ossimString latTwo = getValueFromMap(projectionMap, latitudeTwoKey);
1908  ossimString lonTwo = getValueFromMap(projectionMap, longitudeTwoKey);
1909 
1911 
1912  ossimGpt origin1(latOne.toDouble(), lonOne.toDouble());
1913  ossimGpt origin2(latTwo.toDouble(), lonTwo.toDouble());
1914 
1915  if (!datumCode.empty())
1916  {
1917  oblique->setDatum(ossimDatumFactory::instance()->create(datumCode));
1918  }
1919 
1920  if (!origin1.isNan())
1921  {
1922  oblique->setCentralPoint1(origin1);
1923  }
1924 
1925  if (!origin2.isNan())
1926  {
1927  oblique->setCentralPoint2(origin2);
1928  }
1929 
1930  if (!scaleFactorStr.empty())
1931  {
1932  oblique->setScaleFactor(scaleFactorStr.toDouble());
1933  }
1934 
1935  if (!falseEastingStr.empty())
1936  {
1937  oblique->setFalseEasting(falseEastingStr.toDouble());
1938  }
1939 
1940  if (!falseNorthingStr.empty())
1941  {
1942  oblique->setFalseNorthing(falseNorthingStr.toDouble());
1943  }
1944 
1945  return oblique;
1946  }
1947  else if (projCode == "PG")
1948  {
1949  ossimString originLat = getValueFromMap(projectionMap, "LatitudeTrueScale");
1950  ossimString originLon = getValueFromMap(projectionMap, "LongitudeDownFromPole");
1951  ossimGpt origin(originLat.toDouble(), originLon.toDouble());
1952 
1954 
1955  if (!datumCode.empty())
1956  {
1957  polar->setDatum(ossimDatumFactory::instance()->create(datumCode));
1958  }
1959 
1960  if (!origin.isNan())
1961  {
1962  polar->setOrigin(origin);
1963  }
1964 
1965  if (!falseEastingStr.empty())
1966  {
1967  polar->setFalseEasting(falseEastingStr.toDouble());
1968  }
1969 
1970  if (!falseNorthingStr.empty())
1971  {
1972  polar->setFalseNorthing(falseNorthingStr.toDouble());
1973  }
1974 
1975  return polar;
1976  }
1977  else if (projCode == "PH")
1978  {
1980 
1981  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1982 
1983  if (!datumCode.empty())
1984  {
1985  polyconic->setDatum(ossimDatumFactory::instance()->create(datumCode));
1986  }
1987 
1988  if (!origin.isNan())
1989  {
1990  polyconic->setOrigin(origin);
1991  }
1992 
1993  if (!falseEastingStr.empty())
1994  {
1995  polyconic->setFalseEasting(falseEastingStr.toDouble());
1996  }
1997 
1998  if (!falseNorthingStr.empty())
1999  {
2000  polyconic->setFalseNorthing(falseNorthingStr.toDouble());
2001  }
2002 
2003  return polyconic;
2004  }
2005  else if (projCode == "SA")
2006  {
2008 
2009  if (!datumCode.empty())
2010  {
2011  sinusoidal->setDatum(ossimDatumFactory::instance()->create(datumCode));
2012  }
2013 
2014  if (!centralMeridianStr.empty())
2015  {
2016  sinusoidal->setCentralMeridian(centralMeridianStr.toDouble());
2017  }
2018 
2019  if (!falseEastingStr.empty())
2020  {
2021  sinusoidal->setFalseEasting(falseEastingStr.toDouble());
2022  }
2023 
2024  if (!falseNorthingStr.empty())
2025  {
2026  sinusoidal->setFalseNorthing(falseNorthingStr.toDouble());
2027  }
2028 
2029  return sinusoidal;
2030  }
2031  else if (projCode == "SD")
2032  {
2034 
2035  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
2036 
2037  if (!datumCode.empty())
2038  {
2039  stereo->setDatum(ossimDatumFactory::instance()->create(datumCode));
2040  }
2041 
2042  if (!origin.isNan())
2043  {
2044  stereo->setOrigin(origin);
2045  }
2046 
2047  if (!falseEastingStr.empty())
2048  {
2049  stereo->setFalseEasting(falseEastingStr.toDouble());
2050  }
2051 
2052  if (!falseNorthingStr.empty())
2053  {
2054  stereo->setFalseNorthing(falseNorthingStr.toDouble());
2055  }
2056 
2057  return stereo;
2058  }
2059  else if (projCode == "TC")
2060  {
2062 
2063  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
2064 
2065  if (!datumCode.empty())
2066  {
2067  trans->setDatum(ossimDatumFactory::instance()->create(datumCode));
2068  }
2069 
2070  if (!origin.isNan())
2071  {
2072  trans->setOrigin(origin);
2073  }
2074 
2075  if (!scaleFactorStr.empty())
2076  {
2077  trans->setScaleFactor(scaleFactorStr.toDouble());
2078  }
2079 
2080  if (!falseEastingStr.empty())
2081  {
2082  trans->setFalseEasting(falseEastingStr.toDouble());
2083  }
2084 
2085  if (!falseNorthingStr.empty())
2086  {
2087  trans->setFalseNorthing(falseNorthingStr.toDouble());
2088  }
2089 
2090  return trans;
2091  }
2092  else if (projCode == "TX")
2093  {
2095 
2096  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
2097 
2098  if (!datumCode.empty())
2099  {
2100  transCyl->setDatum(ossimDatumFactory::instance()->create(datumCode));
2101  }
2102 
2103  if (!origin.isNan())
2104  {
2105  transCyl->setOrigin(origin);
2106  }
2107 
2108  if (!scaleFactorStr.empty())
2109  {
2110  transCyl->setScaleFactor(scaleFactorStr.toDouble());
2111  }
2112 
2113  if (!falseEastingStr.empty())
2114  {
2115  transCyl->setFalseEasting(falseEastingStr.toDouble());
2116  }
2117 
2118  if (!falseNorthingStr.empty())
2119  {
2120  transCyl->setFalseNorthing(falseNorthingStr.toDouble());
2121  }
2122 
2123  return transCyl;
2124  }
2125  else if (projCode == "VA")
2126  {
2128 
2129  if (!datumCode.empty())
2130  {
2131  vander->setDatum(ossimDatumFactory::instance()->create(datumCode));
2132  }
2133 
2134  if (!centralMeridianStr.empty())
2135  {
2136  vander->setCentralMeridian(centralMeridianStr.toDouble());
2137  }
2138 
2139  if (!falseEastingStr.empty())
2140  {
2141  vander->setFalseEasting(falseEastingStr.toDouble());
2142  }
2143 
2144  if (!falseNorthingStr.empty())
2145  {
2146  vander->setFalseNorthing(falseNorthingStr.toDouble());
2147  }
2148 
2149  return vander;
2150  }
2151  else
2152  {
2153  if (traceDebug())
2154  {
2156  << "ossimGeoPdfReader: No projection information. \n"
2157  << std::endl;
2158  }
2159  }
2160 
2161  return NULL;
2162 }
virtual void deleteCache(ossimAppFixedCacheId cacheId)
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
void setFalseEasting(double falseEasting)
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
PoDoFo::PdfMemDocument * m_pdfMemDocument
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
void setFalseNorthing(double falseNorthing)
void setFalseEasting(double falseEasting)
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
void resetCacheBuffer(ossimFrameEntryData entry)
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
virtual ossim_uint32 getNumberOfBands() const
void setFalseNorthing(double falseNorthing)
ossimScalarType m_scalarType
ossimFilename theImageFile
virtual void setImageRectangle(const ossimIrect &rect)
virtual bool isOpen() const
Method to test for open file stream.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void setCentralMeridian(double centralMeridian)
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
void setPodofoArrayInfo(PoDoFo::PdfObject *object)
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
void setPodofoDictInfo(PoDoFo::PdfObject *object)
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_int32 m_currentRow
std::vector< std::vector< std::vector< PoDoFo::PdfObject * > > > m_frameEntryArray
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
ossim_uint32 height() const
Definition: ossimIrect.h:487
bool contains(char aChar) const
Definition: ossimString.h:58
virtual ossimGpt inverse(const ossimDpt &pp) const
void setFalseEasting(double falseEasting)
static ossimString toString(bool aValue)
Numeric to string methods.
void setFalseNorthing(double falseNorthing)
virtual ossim_uint32 getNumberOfEntries() const
ossimDrect computeBoundingRect(ossimRefPtr< ossimImageGeometry > geoImage)
virtual bool isGeographic() const
ossim_uint32 m_numberOfSamples
#define OSSIM_INT_NAN
const ossimIpt & ul() const
Definition: ossimIrect.h:274
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
void setFalseEasting(double falseEasting)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
void setFalseEasting(double falseEasting)
ossim_uint32 m_numberOfBands
Has sub image offset.
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
void setImageSize(const ossimIpt &size)
const ossimIpt & ll() const
Definition: ossimIrect.h:277
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Method to grab a tile(rectangle) from image.
ossimProjection * getLGIDictGeoProjection()
void setFalseEasting(double falseEasting)
static const char * TYPE_KW
std::map< ossim_int32, PoDoFo::PdfObject * > m_podofoImageObjs
virtual bool extendGeometry(ossimImageHandler *handler) const
void ref() const
increment the reference count by one, indicating that this object has another pointer which is refere...
virtual void initialize()
Initialize the data buffer.
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
void setCentralMeridian(double centralMeridian)
virtual void setMetersPerPixel(const ossimDpt &gsd)
virtual ossimObject * dup() const
void setFalseEasting(double falseEasting)
void setFalseNorthing(double falseNorthing)
virtual bool open()
Open method.
virtual void closeEntry()
Method to close current entry.
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
ossim_int32 toInt32() const
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
static ossimImageDataFactory * instance()
void setBoundingBox(const ossimDrect &bounds)
void setFalseNorthing(double falseNorthing)
Albers Equal Area Conic Projection.
void setFalseNorthing(double falseNorthing)
ossimProjection * getVPGeoProjection()
std::vector< ossimFrameEntryData > getIntersectingEntries(const ossimIrect &rect)
It is important to note that each frame is organized into an easting northing type orientation...
std::vector< PoDoFo::PdfObject * > theFrameEntry
yy_size_t size
virtual ossimDataObjectStatus validate() const
virtual void setUlEastingNorthing(const ossimDpt &ulEastingNorthing)
void setCentralMeridian(double centralMeridian)
std::string::size_type size() const
Definition: ossimString.h:405
void setScaleFactor(double scaleFactor)
void setFalseNorthing(double falseNorthing)
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
double toDouble() const
static ossimDatumFactory * instance()
virtual ossimIrect getImageRectangle() const
ossimString getValueFromMap(std::map< ossimString, ossimString, ossimStringLtstr > info, ossimString key)
void setFalseNorthing(double falseNorthing)
void setFalseNorthing(double falseNorthing)
RTTI_DEF1_INST(ossimGeoPdfReader, "ossimGeoPdfReader", ossimImageHandler)
const ossimIpt & lr() const
Definition: ossimIrect.h:276
void setFalseEasting(double falseEasting)
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual ossimString getClassName() const
Returns class name.
void parseTileStructure(std::vector< ossimString > tileInfo)
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossimProjection * getProjectionFromStr(ossimString projContents)
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void setFalseEasting(double falseEasting)
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
virtual ~ossimGeoPdfReader()
virtural destructor
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossimScalarType
void unref() const
decrement the reference count by one, indicating that a pointer to this object is referencing it...
void buildTileInfo(ossimString tileInfo)
void setZone(const ossimGpt &ground)
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).
void setFalseEasting(double falseEasting)
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
return status
ossimRefPtr< ossimImageData > m_cacheTile
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.
static const char * PCS_CODE_KW
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
virtual void completeOpen()
Will complete the opening process.
virtual ossimString getShortName() const
Returns short name.
ossimRefPtr< ossimImageGeometry > m_geoImage
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
ossimRefPtr< ossimImageHandler > theOverview
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
void setPodofoRefInfo(PoDoFo::PdfObject *object)
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const
Gets number of lines for res level.
void setFalseNorthing(double falseNorthing)
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
ossim_int32 y
Definition: ossimIpt.h:142
void makeNan()
Definition: ossimIrect.h:329
virtual const void * getBuf() const
const ossimDpt & ur() const
Definition: ossimDrect.h:340
void setPodofoInfo(PoDoFo::PdfObject *object)
double x
Definition: ossimDpt.h:164
void setFalseNorthing(double falseNorthing)
void setFalseNorthing(double falseNorthing)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool empty() const
Definition: ossimString.h:411
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const
Gets the number of samples for res level.
void setHemisphere(char hemisphere)
void setGeoImage(ossimRefPtr< ossimImageGeometry > image)
virtual void setUlTiePoints(const ossimGpt &gpt)
ossimString ext() const
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.
void setFalseEasting(double falseEasting)
ossim_int32 x
Definition: ossimIpt.h:141
void setFalseNorthing(double falseNorthing)
const ossimDpt & ll() const
Definition: ossimDrect.h:342
8 bit unsigned integer
virtual void setDatum(const ossimDatum *datum)
Sets theDatum to datum.
ossim_int32 m_numOfFramesVertical
ossim_uint32 m_numberOfLines
void setCentralMeridian(double centralMeridian)
ossimAppFixedCacheId newTileCache(const ossimIrect &tileBoundaryRect, const ossimIpt &tileSize=ossimIpt(0, 0))
const ossimDpt & lr() const
Definition: ossimDrect.h:341
ossim_int32 m_numOfFramesHorizontal
void setFalseEasting(double falseEasting)
void setHemisphere(const ossimGpt &ground)
void setCentralMeridian(double centralMeridian)
void setFalseNorthing(double falseNorthing)
unsigned char ossim_uint8
std::string::size_type find(const std::string &s, std::string::size_type pos=0) const
Searches for s as a substring of *this, beginning at character pos of *this.
Definition: ossimString.h:753
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
ossimGeoPdfReader()
default construtor
ossimRefPtr< ossimImageData > m_tile
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimProjection * getGeoProjection()
virtual ossimString getLongName() const
Returns long name.
int ossim_int32
void fillTile(T, const ossimIrect &clip_rect, ossimImageData *tile)
void setFalseNorthing(double falseNorthing)