28 static ossimTrace traceDebug(
"ossimFgdcXmlDoc:debug");
34 m_boundInDegree(false)
50 if (xmlFileName.
size())
77 if (!projName.
empty())
140 if ( units.
contains(
"international") )
160 ossimString xpath =
"/metadata/spref/horizsys/cordsysn/geogcsn";
166 ossimString xpath =
"/metadata/spref/horizsys/cordsysn/projcsn";
172 ossimString xpath =
"/metadata/spref/vertdef/altsys/altunits";
178 ossimString xpath =
"/metadata/spref/horizsys/planar/gridsys/gridsysn";
184 static const char M[] =
"ossimFgdcXmlDoc::getGridCoordSysProjection";
201 if ( gridsysn ==
"universal transverse mercator" )
221 if ( tmpResult && ( s !=
"0.0" ) )
238 ossimDpt gsd(std::fabs(xRes), std::fabs(yRes));
274 std::string errMsg = M;
275 errMsg +=
" ERROR: Could not determine utm zone!";
297 ossimString xpath =
"/metadata/spref/horizsys/geodetic/horizdn";
303 ossimString xpath =
"/metadata/spref/horizsys/planar/planci/plandu";
309 ossimString xpath =
"/metadata/spref/horizsys/planar/gridsys/utm/transmer/fnorth";
315 ossimString xpath =
"/metadata/spref/horizsys/planar/gridsys/utm/utmzone";
321 ossimString xpath =
"/metadata/spdoinfo/rastinfo/rastxsz";
322 if (
getPath(xpath, v) ==
false)
324 xpath =
"/metadata/spref/horizsys/planar/planci/coordrep/absres";
331 ossimString xpath =
"/metadata/spdoinfo/rastinfo/rastysz";
332 if (
getPath(xpath, v) ==
false)
334 xpath =
"/metadata/spref/horizsys/planar/planci/coordrep/ordres";
344 ossimString xpath =
"/metadata/spatRepInfo/GridSpatRep/axDimProps/Dimen/dimSize";
345 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
347 if (xml_nodes.size() > 1)
349 size.x = xml_nodes[0]->getText().toInt32();
350 size.y = xml_nodes[1]->getText().toInt32();
356 xpath =
"/metadata/spdoinfo/rastinfo/colcount";
363 xpath =
"/metadata/spdoinfo/rastinfo/rowcount";
390 ossimString xpath =
"/metadata/idinfo/spdom/lboundng/leftbc";
391 bool result =
getPath(xpath, ul_lon);
394 xpath =
"/metadata/idinfo/spdom/bounding/westbc";
395 result =
getPath(xpath, ul_lon);
403 xpath =
"/metadata/idinfo/spdom/lboundng/rightbc";
404 result =
getPath(xpath, ur_lon);
407 xpath =
"/metadata/idinfo/spdom/bounding/eastbc";
408 result =
getPath(xpath, ur_lon);
416 xpath =
"/metadata/idinfo/spdom/lboundng/bottombc";
417 result =
getPath(xpath, ll_lat);
420 xpath =
"/metadata/idinfo/spdom/bounding/southbc";
421 result =
getPath(xpath, ll_lat);
429 xpath =
"/metadata/idinfo/spdom/lboundng/topbc";
430 result =
getPath(xpath, ul_lat);
433 xpath =
"/metadata/idinfo/spdom/bounding/northbc";
434 result =
getPath(xpath, ul_lat);
453 ossimString xpath =
"/metadata/spdoinfo/rastinfo/vrtcount";
456 numOfBands = s.
toInt();
463 static const char M[] =
"ossimFgdcXmlDoc::getPath";
468 std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
470 if ( xnodes.size() == 1 )
472 if ( xnodes[0].valid() )
474 s = xnodes[0]->getText();
484 <<
"Node not found: " << path
489 else if ( xnodes.size() == 0 )
503 << M <<
" ERROR:\nMultiple nodes found: " << path << std::endl;
517 bool result =
getPath(path, s);
529 if ( horizdn ==
"north american datum of 1983" )
533 else if ( horizdn ==
"north american datum of 1927" )
537 else if ( horizdn ==
"wgs84")
543 std::string errMsg =
"ossimFgdcXmlDoc::createOssimDatum ERROR: Unhandled datum: ";
544 errMsg += horizdn.
string();
~ossimFgdcXmlDoc()
destructor
void clear()
Erases the entire container.
ossimRefPtr< ossimProjection > m_projection
bool getAltitudeDistantUnits(ossimString &s) const
Get the Altitude Distance Units.
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
const ossimDatum * createOssimDatum(const ossimString &s) const
Gets the ossimDatum from string.
static ossimDatumFactoryRegistry * instance()
instance method
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
ossim_uint32 getNumberOfBands()
Get Bands.
const ossimDpt & ul() const
bool getYRes(ossim_float64 &v) const
bool contains(char aChar) const
ossimRefPtr< ossimProjection > getGridCoordSysProjection()
Gets projection from Grid Coordinate system node.
bool getPath(const ossimString &path, ossimString &s) const
Gets path from doc and initializes string.
virtual bool isGeographic() const
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
bool getGeoCsn(ossimString &s) const
ossimRefPtr< ossimXmlDocument > m_xmlDocument
bool getProjCsn(ossimString &s) const
virtual void setMetersPerPixel(const ossimDpt &gsd)
ossim_int32 toInt32() const
bool getUtmFalseNorthing(ossimString &s) const
Get UTM false Northing.
virtual void setPcsCode(ossim_uint32 pcsCode)
std::string::size_type size() const
unsigned int ossim_uint32
virtual const ossimDatum * create(const ossimString &code) const
create method
virtual const ossimEllipsoid * ellipsoid() const
ossim_float64 toFloat64() const
bool getXRes(ossim_float64 &v) const
bool getImageSize(ossimIpt &size) const
static ossimString downcase(const ossimString &aString)
bool getPlanarDistantUnits(ossimString &s) const
Get the Planar Distant Units.
void getBoundingBox(ossimDrect &rect) const
ossimFilename m_xmlFilename
void setZone(const ossimGpt &ground)
ossimRefPtr< ossimProjection > getProjection()
Gets projection from document.
bool getHorizontalDatum(ossimString &s) const
Get the Grid Coordinate system.
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
ossimFgdcXmlDoc()
default constructor
bool getUtmZone(ossimString &s) const
Get UTM zone.
virtual void setUlTiePoints(const ossimGpt &gpt)
bool open(const ossimFilename &xmlFileName)
Open method.
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
virtual void setDatum(const ossimDatum *datum)
Sets theDatum to datum.
ossimUnitType getUnitType() const
bool getGridCoordinateSystem(ossimString &s) const
Get the Grid Coordinate system.
void setHemisphere(const ossimGpt &ground)
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
void close()
close method.