50 createIstream(file, std::ios_base::in | std::ios_base::binary);
52 if ( is && is->good() )
56 if ( xdoc.
read( *is ) )
60 ossimString path =
"/PAMDataset/Metadata/GeodataXform/SpatialReference/WKT";
61 if (
getPath( path, xdoc, wkt ) )
72 if ( result.
valid() == false )
77 cout <<
"name1: " << name << endl;
79 name.
string() = std::string(
"NAD_1983_") + name.
string();
80 cout <<
"name2: " << name << endl;
82 createProjection( name );
105 const std::string& wkt,
111 if ( mapProj.
valid() )
115 std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
126 if ( xnodes[i].valid() )
134 if (attr->
getValue() ==
"IMAGE__XY_ORIGIN" )
136 value = xnodes[i]->getText();
140 std::vector<ossimString> list;
142 if ( list.size() == 2 )
144 if ( list[0].
size() )
146 tie.
x = list[0].toFloat64();
148 if ( list[1].
size() )
150 tie.
y = list[1].toFloat64();
155 else if (attr->
getValue() ==
"IMAGE__X_RESOLUTION" )
157 value = xnodes[i]->getText();
163 else if (attr->
getValue() ==
"IMAGE__Y_RESOLUTION" )
165 value = xnodes[i]->getText();
213 <<
"ossimAuxXmlSupportData::initializeProjection WARNING: " 214 <<
"Unhandled unit type: " << units << std::endl;
239 std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
241 if ( xnodes.size() == 1 )
243 if ( xnodes[0].valid() )
245 s = xnodes[0]->getText();
248 else if(traceDebug())
251 <<
"ossimAuxXmlSupportData::getPath ERROR:\n" 252 <<
"Node not found: " << path
256 else if ( xnodes.size() == 0 )
261 <<
"ossimAuxXmlSupportData::getPath ERROR:\n" 262 <<
"Node not found: " << path
271 <<
"ossimAuxXmlSupportData::getPath ERROR:\n" 272 <<
"Multiple nodes found: " << path
288 std::string& name )
const 295 std::string::size_type startPos = wkt.find( std::string(
"PROJCS[") );
296 if ( startPos != std::string::npos )
301 std::string::size_type endPos = wkt.find(
',', startPos+1 );
302 if ( endPos != std::string::npos )
304 if ( startPos < endPos )
306 name = wkt.substr( startPos, endPos-startPos );
void clear()
Erases the entire container.
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
bool contains(char aChar) const
virtual bool isGeographic() const
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 void setDecimalDegreesPerPixel(const ossimDpt &gsd)
static StreamFactoryRegistry * instance()
const ossimString & getValue() const
bool getPath(const ossimString &path, const ossimXmlDocument &xdoc, ossimString &s) const
Gets path from doc and initializes string.
virtual void setMetersPerPixel(const ossimDpt &gsd)
ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
virtual ~ossimAuxXmlSupportData()
virtual destructor
std::string::size_type size() const
unsigned int ossim_uint32
ossim_float64 toFloat64() const
static ossimString downcase(const ossimString &aString)
bool initializeProjection(const ossimXmlDocument xdoc, const std::string &wkt, ossimProjection *proj) const
Sets tie and scale.
static ossimProjectionFactoryRegistry * instance()
bool read(std::istream &in)
virtual void setUlTiePoints(const ossimGpt &gpt)
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
ossimString & gsub(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false)
Substitutes searchKey string with replacementValue and returns a reference to *this.
ossimUnitType getUnits(const std::string &wkt) const
Gets units of Projected Coordinate System.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimProjection > getProjection(const ossimFilename &file) const
Method to get a projection if possible.
ossimAuxXmlSupportData()
default constructor
const std::string & string() const
bool getProjcsName(const std::string &wkt, std::string &name) const
Get first parameter from PROJCS[ ...