OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNgaProjectionFactory.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2014 RadiantBlue, Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 //*******************************************************************
9 // $Id$
10 
16 
17 // Define Trace flags for use within this file:
18 #include <ossim/base/ossimTrace.h>
19 static ossimTrace traceDebug = ossimTrace("ossimNgaProjectionFactory:debug");
20 
21 RTTI_DEF1(ossimNgaProjectionFactory, "ossimNgaProjectionFactory",
23 
24 //*************************************************************************************************
26 //*************************************************************************************************
28 {
29  static ossimNgaProjectionFactory inst;
30 
31  return &inst;
32 }
33 
35  ossim_uint32 entryIdx) const
36  {
37  // Check for external geometry file.
38  return createProjectionFromGeometryFile(filename, entryIdx);
39 }
40 
41 //**************************************************************************************************
42 // This is the principal factory method. It accepts a string in format:
43 //
44 // <group>:<code>, for example "NGA:235" (Currently only code supported, used in GeoPackage)
45 //
46 // IMPORTANT NOTE: Image tie-points cannot be conveyed by a projection code. The projection
47 // created here will not be fully initialized for use in rendering imagery.
48 //**************************************************************************************************
50 
51 {
52  ossimProjection* proj = 0;
53  if ((!ossimString(spec).downcase().contains("nga")) && (spec.after(":").toInt() == 235))
54  {
56  proj = new ossimMercatorProjection(*e, ossimGpt(0,0), 0, 0, 0.857385503731176);
57  }
58 
59  return proj;
60 }
61 
66  const ossimKeywordlist& /* kwl */, const char* /* prefix */) const
67 {
68  return 0;
69 }
70 
72  const ossimString& typeName) const
73 {
74  return createProjection(typeName);
75 }
76 
78  const char* prefix) const
79 {
80  return createProjection(kwl, prefix);
81 }
82 
83 void ossimNgaProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList) const
84 {
85  typeList.push_back(ossimString("NGA:235 \"Scaled World Mercator\""));
86 }
RTTI_DEF1(ossimNgaProjectionFactory, "ossimNgaProjectionFactory", ossimProjectionFactoryBase)
static ossimEllipsoidFactory * instance()
ossimProjection * createProjectionFromGeometryFile(const ossimFilename &imageFile, ossim_uint32 entryIdx) const
This method takes the filename and tries to find an external ".geom" file.
Represents serializable keyword/value map.
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
takes a filename.
static ossimNgaProjectionFactory * instance()
Implements singleton pattern.
unsigned int ossim_uint32
const ossimEllipsoid * create(const ossimString &code) const
virtual ossimObject * createObject(const ossimString &typeName) const
ossimString after(const ossimString &str, std::string::size_type pos=0) const
METHOD: after(str, pos) Returns string immediately after the token str.
int toInt() const