OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVpfFeatureClass.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 using namespace std;
3 
9 
10 #include <string.h>
11 
12 #ifndef NULL
13 #include <stddef.h>
14 #endif
15 
17 {
18 }
19 
20 
22  const ossimFilename& featureClassFullPath,
23  const ossimFilename& table1,
24  const ossimString& columnNameIdTable1,
25  const ossimFilename& table2,
26  const ossimString& columnNameIdTable2)
27 {
28  theFeatureClassFullPath = featureClassFullPath;
29  theFeatureClassName = featureClassName;
30  theTableName1 = table1;
31  theColumnNameId1 = columnNameIdTable1;
32  theTableName2 = table2;
33  theColumnNameId2 = columnNameIdTable2;
34 
35  ossimVpfTable t1;
36  ossimVpfTable t2;
37 
38  ossimFilename t1Name = getTable1();
39  ossimFilename t2Name = getTable2();
40 
41  if((!t1.openTable(t1Name))||
42  (!t2.openTable(t2Name)))
43  {
44 
45  return false;
46  }
47 
48  return true;
49 }
50 
52 {
53  return theFeatureClassName;
54 
55 }
56 
58 {
59  // make sure we have forward slashes
60  ossimFilename filename(featureName.trim());
61  // filename.convertBackToForwardSlashes();
62 
63  ossimString copyOfFeature = filename;
64 
65  // find
66  const char* temp = strrchr(copyOfFeature.c_str(), '/');
67 
68  ossimString value;
69  if(temp)
70  {
71  ++temp;
72  value = temp;
73  }
74  else
75  {
76 
77  value = copyOfFeature;
78  }
79 
80  value = value.downcase();
81  return( (value == "end") ||
82  (value == "cnd") ||
83  (value == "edg") ||
84  (value == "fac") ||
85  (value == "txt") );
86 }
87 
89 {
90  // find the suffix
91  ossimString value = strrchr(featureName.trim().c_str(), '.');
92 
93  // the suffix will be null or empty string if not found.
94  if(value == "")
95  {
96  return false;
97  }
98  // make case insensitive
99  value = value.downcase();
100 
101  return ( (value == ".pft")||
102  (value == ".lft")||
103  (value == ".aft")||
104  (value == ".tft"));
105 }
106 
108 {
109  const char* suffix = strrchr(featureName.trim(), '.');
110 
111  if (!suffix)
112  {
113  return false;
114  }
115 
116  ossimString value = ossimString(suffix).downcase();
117 
118  return (value == ".cft");
119 }
120 
122 {
123  return (isSimpleFeature(featureName) || isComplexFeature(featureName));
124 }
125 
127 {
128  ossimString value = strrchr(featureName.c_str(), '.');
129  if(value == "")
130  {
131  return false;
132  }
133 
134  value = value.downcase();
135 
136  return ( (value == ".cjt")||
137  (value == ".pjt")||
138  (value == ".ljt")||
139  (value == ".ajt")||
140  (value == ".tjt"));
141 }
142 
144 {
145  return theFeatureClassFullPath.dirCat(theTableName1);
146 }
147 
149 {
150  return theFeatureClassFullPath.dirCat(theTableName2);
151 }
static bool isFeature(const ossimString &featureName)
static bool isPrimitive(const ossimString &featureName)
static bool isComplexFeature(const ossimString &featureName)
virtual bool openTable(const ossimFilename &tableName)
bool openFeatureClass(const ossimString &featureClassName, const ossimFilename &featureClassFullPath, const ossimFilename &table1, const ossimString &columnNameIdTable1, const ossimFilename &table2, const ossimString &columnNameIdTable2)
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
static bool isSimpleFeature(const ossimString &featureName)
static bool isJoin(const ossimString &featureName)
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimFilename dirCat(const ossimFilename &file) const
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
ossimFilename getTable2() const
const ossimString & getName() const
ossimFilename getTable1() const