void ossimBandSelector::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; if(property->getName() == "bandSelection") { ossimString str = property->valueToString(); std::vector<ossimString> str_vec; std::vector<ossim_uint32> int_vec; str.split( str_vec, " " ); for ( ossim_uint32 i = 0; i < str_vec.size(); ++i ) { if(!str_vec[i].empty()) { int_vec.push_back( str_vec[i].toUInt32() ); } } setOutputBandList( int_vec ); } else if(property->getName() == "bands") { std::vector<ossim_uint32> selection; if(ossim::toSimpleVector(selection, property->valueToString())) { theOutputBandList = selection; } } else { ossimImageSourceFilter::setProperty(property); } }
void ossimLasReader::setProperty(ossimRefPtr<ossimProperty> property) { if ( property.valid() ) { if ( property->getName() == SCALE_KW ) { ossimString s; property->valueToString(s); ossim_float64 d = s.toFloat64(); if ( ossim::isnan(d) == false ) { setScale( d ); } } else if ( property->getName() == SCAN_KW ) { ossimString s; property->valueToString(s); m_scan = s.toBool(); } else { ossimImageHandler::setProperty(property); } } }
void ossimImageToPlaneNormalFilter::setProperty(ossimRefPtr<ossimProperty> property) { ossimString name = property->getName(); if(name == "smoothnessFactor") { theSmoothnessFactor = property->valueToString().toDouble(); initialize(); } else if(name == "xscale") { theXScale = property->valueToString().toDouble(); initialize(); } else if(name == "yscale") { theYScale = property->valueToString().toDouble(); initialize(); } else if(name == "autoTrackScaleFlag") { theTrackScaleFlag = property->valueToString().toDouble(); initialize(); } else { ossimImageSourceFilter::setProperty(property); } }
void ossimCFARFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; ossimString name = property->getName(); if(name == "aperture_size") { } else { ossimImageSourceFilter::setProperty(property); } }
bool ossimOpjCompressor::setProperty(ossimRefPtr<ossimProperty> property) { bool consumed = false; if ( property.valid() ) { ossimString key = property->getName(); if ( traceDebug() ) { ossimNotify(ossimNotifyLevel_DEBUG) << "ossimOpjCompressor::setProperty DEBUG:" << "\nkey: " << key << " values: " << property->valueToString() << std::endl; } if (key == ossimKeywordNames::COMPRESSION_QUALITY_KW) { setQualityTypeString(property->valueToString()); consumed = true; } else if ( (key == LEVELS_KW) || (key == "Clevels") ) { m_levels = property->valueToString().toInt32(); consumed = true; } else if( (key == REVERSIBLE_KW) || (key == "Creversible") ) { setReversibleFlag(property->valueToString().toBool()); consumed = true; } else if (key == ADD_ALPHA_CHANNEL_KW) { m_alpha = property->valueToString().toBool(); consumed = true; } else if ( key == THREADS_KW) { m_threads = property->valueToString().toInt32(); consumed = true; } else if ( (key == "Clayers") || (key == "Cprecincts") ) { // Generic options passed through kdu_params::parse_string. // Make in the form of "key=value" for kdu_params::parse_string. ossimString option = key; option += "="; option += property->valueToString(); // Add to list. m_options.push_back(option); consumed = true; } } return consumed; }
void ossimNitfFileHeaderV2_0::setProperty(ossimRefPtr<ossimProperty> property) { const ossimString& name = property->getName(); if(name == CLEVEL_KW) { setComplianceLevel(property->valueToString()); } else if(name == FSDWNG_KW) { setSecurityDowngrade(property->valueToString()); } else if(name == FSDEVT_KW) { setDowngradingEvent(property->valueToString()); } else if(name == ONAME_KW) { setOriginatorsName(property->valueToString()); } else if(name == OPHONE_KW) { setOriginatorsPhone(property->valueToString()); } else { ossimNitfFileHeaderV2_X::setProperty(property); } }
void ossimEdgeFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; if(property->getName() == PROP_EDGE_FILTER) { theFilterType = property->valueToString(); } }
void ossimNBandToIndexFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(property->getName() == ossimKeywordNames::FILENAME_KW) { ossimKeywordlist kwl; if(kwl.addFile(ossimFilename(property->valueToString()))) { theLut = new ossimNBandLutDataObject; theLut->loadState(kwl); } } else if(property->getName() == KEEP_QUANTIZED_VALUE_FLAG_KW) { theKeepQuantizedValueFlag = property->valueToString().toBool(); } else { ossimImageSourceFilter::setProperty(property); } }
void ossimImageGaussianFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; if (property->getName() == PROPERTYNAME_GAUSSSTD) { ossimNumericProperty* sProperty = PTR_CAST(ossimNumericProperty, property.get()); if(sProperty) { setGaussStd(sProperty->asFloat64()); } } else if (property->getName() == PROPERTYNAME_STRICTNODATA) { ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty, property.get()); if(booleanProperty) { setStrictNoData(booleanProperty->getBoolean()); } } else { ossimImageSourceFilter::setProperty(property); } }
void ossimMaskFilter::setProperty(ossimRefPtr<ossimProperty> property) { if( property.valid() ) { if(property->getName() == MASK_FILTER_MASK_TYPE_KW) { setMaskType(property->valueToString()); } else { ossimImageCombiner::setProperty(property); } } }
void ossimBumpShadeTileSource::setProperty(ossimRefPtr<ossimProperty> property) { ossimString name = property->getName(); if(name == "lightSourceElevationAngle") { m_lightSourceElevationAngle = property->valueToString().toDouble(); } else if(name == "lightSourceAzimuthAngle") { m_lightSourceAzimuthAngle = property->valueToString().toDouble(); } else { ossimImageCombiner::setProperty(property); } }
void ossimPngReader::setProperty(ossimRefPtr<ossimProperty> property) { if ( property.valid() ) { if ( property->getName().string() == USE_ALPHA_KW ) { ossimString s; property->valueToString(s); m_useAlphaChannelFlag = s.toBool(); } else { ossimImageHandler::setProperty(property); } } }
void ossimFftFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; if(property->getName() == "FFT Direction") { if(theTile.valid()) { theTile = NULL; } setDirectionType(property->valueToString()); } else { ossimImageSourceFilter::setProperty(property); } }
void ossimIndexToRgbLutFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(property.valid()) { ossimString value = property->valueToString(); value = value.trim(); if(property->getName() == "LUT file") { setLut(ossimFilename(property->valueToString())); } else { ossimImageSourceFilter::setProperty(property); } } }
void ossimCFARFilter::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; ossimString name = property->getName(); if(name == "threshold") { theThreshold = property->valueToString().toDouble(); } else if(name == "Kernel") { ossimMatrixProperty* matrixProperty = PTR_CAST(ossimMatrixProperty, property.get()); if(matrixProperty) { for(ossim_int32 r = 0; r < 5; r++) { for(ossim_int32 c = 0; c < 5; c++) { theKernel[r][c] = (*matrixProperty)(r,c); } } /* theKernel[0][0] = (*matrixProperty)(0,0); theKernel[1][0] = (*matrixProperty)(1,0); theKernel[2][0] = (*matrixProperty)(2,0); theKernel[0][1] = (*matrixProperty)(0,1); theKernel[1][1] = (*matrixProperty)(1,1); theKernel[2][1] = (*matrixProperty)(2,1); theKernel[0][2] = (*matrixProperty)(0,2); theKernel[1][2] = (*matrixProperty)(1,2); theKernel[2][2] = (*matrixProperty)(2,2); */ } else { ossimImageSourceFilter::setProperty(property); } } else { ossimImageSourceFilter::setProperty(property); } }
void ossimRangeDomeTileSource::setProperty(ossimRefPtr<ossimProperty> property) { if (!property.valid()) return; ossimString s; property->valueToString(s); if (s.empty()) return; // The user should select either explicit GSD or relative GSD factor, never both: if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW ) { ossim_float64 gsd = s.toFloat64(); if (!ossim::isnan(gsd)) setGSD(gsd); } else { ossimImageHandler::setProperty(property); } }
void ossimOutlierRejection::setProperty(ossimRefPtr<ossimProperty> property) { if(!property.valid()) return; ossimString name = property->getName(); if(name == "inlier_output_filename") { theInlierOutputFilename = ossimFilename(property->valueToString()); } else if(name =="inlier_ratio") { setInlierRatio(property->valueToString().toDouble()); } else if(name == "inlier_image_accuracy") { setInlierImageAccuracy(property->valueToString().toDouble()); } else { ossimModelOptimizer::setProperty(property); } }
void ossimH5Reader::setProperty(ossimRefPtr<ossimProperty> property) { if ( property.valid() ) { if ( property->getName().string() == LAYER_KW ) { ossimString s; property->valueToString(s); ossim_uint32 SIZE = (ossim_uint32)m_entries.size(); for ( ossim_uint32 i = 0; i < SIZE; ++i ) { if ( m_entries[i].getName() == s.string() ) { setCurrentEntry( i ); } } } else { ossimImageHandler::setProperty(property); } } }
void ossimWatermarkFilter::setProperty(ossimRefPtr<ossimProperty> property) { if (!property) return; ossimString os = property->valueToString(); ossimString name = property->getName(); if (name == ossimKeywordNames::FILENAME_KW) { setFilename(os); } else if (name == WATERMARK_MODE_KW) { setMode(os); } else if (name == WEIGHT_KW) { setWeight(os.toDouble()); } else { ossimImageSourceFilter::setProperty(property); } }
void ossimNitfFileHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property) { if(!property.valid()) return; ossimString name = property->getName(); if(name == FSCLASY_KW) { setSecurityClassificationSys(property->valueToString()); } else if(name == FSDCTP_KW) { setDeclassificationType(property->valueToString()); } else if(name == FSDCDT_KW) { setDeclassificationDate(property->valueToString()); } else if(name == FSDCXM_KW) { setDeclassificationExemption(property->valueToString()); } else if(name == FSDG_KW) { setDowngrade(property->valueToString()); } else if(name == FSDGDT_KW) { setDowngradingDate(property->valueToString()); } else if(name == FSCLTX_KW) { setClassificationText(property->valueToString()); } else if(name == FSCATP_KW) { setClassificationAuthorityType(property->valueToString()); } else if(name == FSCRSN_KW) { setClassificationReason(property->valueToString()); } else if(name == FSSRDT_KW) { setSecuritySourceDate(property->valueToString()); } else if(name == FBKGC_KW) { ossimString value = property->valueToString(); std::vector<ossimString> splitString; value = value.trim(); value.split(splitString, " "); if(splitString.size() == 3) { setFileBackgroundColor((ossim_uint8)splitString[0].toUInt32(), (ossim_uint8)splitString[1].toUInt32(), (ossim_uint8)splitString[2].toUInt32()); } } else { ossimNitfFileHeaderV2_X::setProperty(property); } }
void ossimImageFileWriter::setProperty(ossimRefPtr<ossimProperty> property) { if(!property) return; if(property->getName() == ossimKeywordNames::FILENAME_KW) { theFilename = property->valueToString(); } else if (property->getName() == "create_envi_hdr") { theWriteEnviHeaderFlag = property->valueToString().toBool(); } else if (property->getName() == "create_ers_hdr") { theWriteErsHeaderFlag = property->valueToString().toBool(); } else if (property->getName() == ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW) { theWriteExternalGeometryFlag = property->valueToString().toBool(); } else if (property->getName() == "create_fgdc") { theWriteFgdcFlag = property->valueToString().toBool(); } else if (property->getName() == "create_jpeg_world_file") { theWriteJpegWorldFileFlag = property->valueToString().toBool(); } else if (property->getName() == "create_readme") { theWriteReadmeFlag = property->valueToString().toBool(); } else if (property->getName() == "create_tiff_world_file") { theWriteTiffWorldFileFlag = property->valueToString().toBool(); } else if (property->getName() == "create_world_file") { theWriteWorldFileFlag = property->valueToString().toBool(); } else if (property->getName() == ossimKeywordNames::CREATE_IMAGE_KW) { theWriteImageFlag = property->valueToString().toBool(); } else if (property->getName() == ossimKeywordNames::CREATE_OVERVIEW_KW) { theWriteOverviewFlag = property->valueToString().toBool(); } else if (property->getName() == ossimKeywordNames::CREATE_HISTOGRAM_KW) { theWriteHistogramFlag = property->valueToString().toBool(); } else if (property->getName() == SCALE_TO_EIGHT_BIT_KW) { theScaleToEightBitFlag = property->valueToString().toBool(); } else if(property->getName() == AUTO_CREATE_DIRECTORY_KW) { theAutoCreateDirectoryFlag = property->valueToString().toBool(); } else if (property->getName() == "linear_units") { theLinearUnits = (ossimUnitType) (ossimUnitTypeLut::instance()-> getEntryNumber(property->valueToString())); } else if(property->getName() == ossimKeywordNames::IMAGE_TYPE_KW) { setOutputImageType(property->valueToString()); } else if(property->getName() == ossimKeywordNames::PIXEL_TYPE_KW) { ossimStringProperty* stringProperty = PTR_CAST(ossimStringProperty, property.get()); if (stringProperty) { ossimString s; stringProperty->valueToString(s); setPixelType(s); } } else { ossimImageWriter::setProperty(property); } }
void ossimNitfImageHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property) { ossimString name = property->getName(); std::ostringstream out; if(!property) return; if(name.contains(ISCLSY_KW)) { setSecurityClassificationSystem(property->valueToString()); } else if(name.contains(ISCODE_KW)) { setCodewords(property->valueToString()); } else if(name.contains(ISCTLH_KW)) { setControlAndHandling(property->valueToString()); } else if(name.contains(ISREL_KW)) { setReleasingInstructions(property->valueToString()); } else if(name.contains(ISDCTP_KW)) { setDeclassificationType(property->valueToString()); } else if(name.contains(ISDCDT_KW)) { setDeclassificationDate(property->valueToString()); } else if(name.contains(ISDCXM_KW)) { setDeclassificationExempt(property->valueToString()); } else if(name.contains(ISDG_KW)) { setDowngrade(property->valueToString()); } else if(name.contains(ISDGDT_KW)) { setDowngradeDate(property->valueToString()); } else if(name.contains(ISCLTX_KW)) { setClassificationText(property->valueToString()); } else if(name.contains(ISCATP_KW)) { setClassificationAuthorityType(property->valueToString()); } else if(name.contains(ISCAUT_KW)) { setClassificationAuthority(property->valueToString()); } else if(name.contains(ISCRSN_KW)) { setClassificationReason(property->valueToString()); } else if(name.contains(ISSRDT_KW)) { setSecuritySourceDate(property->valueToString()); } else if(name.contains(ISCTLN_KW)) { setSecurityControlNumber(property->valueToString()); } else { ossimNitfImageHeaderV2_X::setProperty(property); } }
bool ossimGmlSupportData::getImageGeometry( ossimKeywordlist& geomKwl ) const { bool success = true; if ( m_xmlDocument.valid() ) { vector< ossimRefPtr<ossimXmlNode> > xml_nodes; bool gotSensorImage = false; bool gotRectifiedImage = false; ossim_uint32 pcsCodeGrid = 32767; // only applies to rectified // Check the GMLJP2CoverageCollection attributes for the default namespace. ossimString defaultNamespaceStr( "" ); ossimString xpath_root = "/gmljp2:GMLJP2CoverageCollection"; xml_nodes.clear(); m_xmlDocument->findNodes( xpath_root, xml_nodes ); if ( xml_nodes.size() == 0 ) { // check if the default namespace is gmljp2 xpath_root = "/GMLJP2CoverageCollection"; m_xmlDocument->findNodes( xpath_root, xml_nodes ); } if ( xml_nodes.size() >= 1 ) { const ossimString defaultNamespaceIdentifierStr( "xmlns" ); ossimString defaultNamespacePrependStr = defaultNamespaceIdentifierStr + ":"; const ossimRefPtr<ossimXmlAttribute> defaultNamespaceAttribute = xml_nodes[0]->findAttribute( defaultNamespaceIdentifierStr ); ossimString defaultNamespaceSettingStr = defaultNamespaceAttribute->getValue(); // search for the attribute value in the other attributes const ossimXmlNode::AttributeListType& attributeList = xml_nodes[0]->getAttributes(); size_t nAttributes = attributeList.size(); for ( size_t i=0; i<nAttributes; ++i ) { const ossimRefPtr<ossimXmlAttribute> attribute = attributeList[i]; const ossimString& attribute_name = attribute->getName(); const ossimString& attribute_value = attribute->getValue(); if ( attribute_name != defaultNamespaceIdentifierStr && attribute_value == defaultNamespaceSettingStr ) { defaultNamespaceStr = attribute_name.after( defaultNamespacePrependStr ); defaultNamespaceStr += ":"; } } } // Check for a sensor image ossimString xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2ReferenceableGridCoverage/gml:domainSet/gmlcov:ReferenceableGridBySensorModel"; xpath0 = xpath0.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xml_nodes.clear(); m_xmlDocument->findNodes( xpath0, xml_nodes ); if ( xml_nodes.size() >= 1 ) { // we've got a sensor model image gotSensorImage = true; } else { const ossimString srsNameStr( "srsName" ); ossimString pcsCodeDefinitionStr( "http://www.opengis.net/def/crs/EPSG/0/" ); xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2RectifiedGridCoverage/gml:domainSet/gml:RectifiedGrid"; xpath0 = xpath0.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xml_nodes.clear(); m_xmlDocument->findNodes( xpath0, xml_nodes ); if ( xml_nodes.size() >= 1 ) { // we've got a rectified image gotRectifiedImage = true; const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr ); const ossimString& originSrsName = hrefAttribute->getValue(); ossimString pcsCodeGridStr = originSrsName.after( pcsCodeDefinitionStr.string() ); pcsCodeGrid = pcsCodeGridStr.toUInt32(); if ( pcsCodeGrid != 32767 ) { //--- // The ossimEpsgProjectionFactory will not pick up the origin latitude if code is // 4326 (geographic) so we use the projection name; else, the origin_latitude will // always be 0. This is so the gsd comes out correct for scale. //--- if ( pcsCodeGrid != 4326 ) // map projection { // Add the pcs code. geomKwl.add( ossimKeywordNames::PCS_CODE_KW, pcsCodeGridStr.c_str() ); } else // geographic { geomKwl.add( ossimKeywordNames::TYPE_KW, ossimString( "ossimEquDistCylProjection" ) ); } } } } /* Number of lines & samples, for either sensor or rectified imagery */ ossimString xpath_limits_low = "/gml:limits/gml:GridEnvelope/gml:low"; ossimString xpath_limits_high = "/gml:limits/gml:GridEnvelope/gml:high"; xpath_limits_low = xpath_limits_low.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath_limits_high = xpath_limits_high.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); bool gotLow = false; ossim_int32 lowX, lowY; ossimString xpath = xpath0 + xpath_limits_low; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); if ( xml_nodes.size() == 1 ) { const ossimString& lowerCorner = xml_nodes[0]->getText(); size_t spacePos = lowerCorner.find( ' ' ); ossimString lowerXString = lowerCorner.beforePos( spacePos ); ossimString lowerYString = lowerCorner.afterPos ( spacePos ); lowX = lowerXString.toInt32(); lowY = lowerYString.toInt32(); gotLow = true; } bool gotHigh = false; ossim_int32 highX = 0; ossim_int32 highY = 0; xpath = xpath0 + xpath_limits_high; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); if ( xml_nodes.size() == 1 ) { const ossimString& higherCorner = xml_nodes[0]->getText(); size_t spacePos = higherCorner.find( ' ' ); ossimString higherXString = higherCorner.beforePos( spacePos ); ossimString higherYString = higherCorner.afterPos ( spacePos ); highX = higherXString.toInt32(); highY = higherYString.toInt32(); gotHigh = true; } if ( gotHigh && gotLow ) { geomKwl.add( ossimKeywordNames::NUMBER_LINES_KW, highY - lowY + 1 ); geomKwl.add( ossimKeywordNames::NUMBER_SAMPLES_KW, highX - lowX + 1 ); } if ( gotSensorImage ) { const ossimString hrefStr( "xlink:href" ); const ossimString codeSpaceStr( "codeSpace" ); ossimString sensorModelHref( "" ); ossimString xpath_sensor_model = "/gmlcov:sensorModel"; xpath_sensor_model = xpath_sensor_model.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_sensor_model; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); if ( xml_nodes.size() == 1 ) { const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( hrefStr ); sensorModelHref = hrefAttribute->getValue(); } ossimString sensorInstanceHref( "" ); ossimString xpath_sensor_typeOf = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:typeOf"; xpath_sensor_typeOf = xpath_sensor_typeOf.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_sensor_typeOf; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); if ( xml_nodes.size() == 1 ) { const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( hrefStr ); sensorInstanceHref = hrefAttribute->getValue(); } ossimSensorModel* sensor_model = 0; ossimString xpath_sensor_name = "/gmlcov:sensorInstance/sml:SimpleProcess/gml:name"; xpath_sensor_name = xpath_sensor_name.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_sensor_name; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); int nSensorNames = (int)xml_nodes.size(); for ( int i=0; i<nSensorNames; ++i ) { const ossimString& sensorName = xml_nodes[i]->getText(); ossimProjectionFactoryRegistry* registry = ossimProjectionFactoryRegistry::instance(); ossimProjection* proj = registry->createProjection( sensorName ); // Is it a sensor model ? sensor_model = dynamic_cast<ossimSensorModel*>( proj ); if ( sensor_model != 0 ) { geomKwl.add( ossimKeywordNames::TYPE_KW, sensorName.c_str() ); break; } } if ( sensor_model == 0 ) { // Add debug message return false; } // Check if the sensor instance is typeOf the sensor model if ( sensorModelHref == sensorInstanceHref ) { const ossimString refStr( "ref" ); /* sml:setValue */ ossimString xpath_setValue = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:configuration/sml:Settings/sml:setValue"; xpath_setValue = xpath_setValue.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_setValue; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); size_t nXmlNodes = xml_nodes.size(); for( size_t i=0; i<nXmlNodes; ++i ) { const ossimString& elementValue = xml_nodes[i]->getText(); const ossimRefPtr<ossimXmlAttribute> refAttribute = xml_nodes[i]->findAttribute( refStr ); const ossimString& settingsRef = refAttribute->getValue(); bool successSetValue = sensor_model->getImageGeometry( settingsRef, elementValue, geomKwl ); success &= successSetValue; if ( !successSetValue ) { // Add debug message } } /* sml:setArrayValues */ ossimString xpath_setArrayValues = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:configuration/sml:Settings/sml:setArrayValues"; xpath_setArrayValues = xpath_setArrayValues.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_setArrayValues; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); nXmlNodes = xml_nodes.size(); for( size_t i=0; i<nXmlNodes; ++i ) { ossimString elementValue( "" ); const ossimRefPtr<ossimXmlAttribute> refAttribute = xml_nodes[i]->findAttribute( refStr ); const ossimString& settingsRef = refAttribute->getValue(); const ossimXmlNode::ChildListType& children = xml_nodes[i]->getChildNodes(); if ( children.size() > 0 ) { const ossimXmlNode::ChildListType& grandchildren = children[0]->getChildNodes(); if ( (grandchildren.size() > 1) && (grandchildren[1]->getTag() == ossimString( "sml:value")) ) { elementValue = grandchildren[1]->getText(); } } bool successSetArrayValues = sensor_model->getImageGeometry( settingsRef, elementValue, geomKwl ); success &= successSetArrayValues; if ( !successSetArrayValues ) { // Add debug message } } } } else if ( gotRectifiedImage ) { const ossimString srsNameStr( "srsName" ); ossimString pcsCodeDefinitionStr( "http://www.opengis.net/def/crs/EPSG/0/" ); /* axis labels for rectified imagery */ ossimString xpath_axisLabels = "/gml:axisLabels"; xpath_axisLabels = xpath_axisLabels.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); ossimString firstAxisLabelString( "" ); ossimString secondAxisLabelString( "" ); ossimString xpath = xpath0 + xpath_axisLabels; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); if ( xml_nodes.size() == 1 ) { const ossimString& axisLabelsString = xml_nodes[0]->getText(); size_t spacePos = axisLabelsString.find( ' ' ); firstAxisLabelString = axisLabelsString.beforePos( spacePos ); secondAxisLabelString = axisLabelsString.afterPos ( spacePos ); } /* origin */ ossim_uint32 pcsCodeOrigin = 32767; ossimString xpath_originPoint = "/gml:origin/gml:Point"; xpath_originPoint = xpath_originPoint.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_originPoint; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); if ( xml_nodes.size() == 1 ) { const ossimString& originString = xml_nodes[0]->getChildTextValue( ossimString( "pos" ) ); size_t spacePos = originString.find( ' ' ); ossimString firstOriginString = originString.beforePos( spacePos ); ossimString secondOriginString = originString.afterPos ( spacePos ); const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr ); const ossimString& originSrsName = hrefAttribute->getValue(); ossimString pcsCodeOriginStr = originSrsName.after( pcsCodeDefinitionStr.string() ); pcsCodeOrigin = pcsCodeOriginStr.toUInt32(); if ( pcsCodeOrigin != 32767 ) { if ( pcsCodeOrigin != 4326 ) // map projection { /* Convert to geographic */ } if ( firstAxisLabelString == ossimString( "Lat" ) ) { geomKwl.add( ossimKeywordNames::ORIGIN_LATITUDE_KW, firstOriginString.c_str() ); geomKwl.add( ossimKeywordNames::CENTRAL_MERIDIAN_KW, secondOriginString.c_str() ); } else { geomKwl.add( ossimKeywordNames::ORIGIN_LATITUDE_KW, secondOriginString.c_str() ); geomKwl.add( ossimKeywordNames::CENTRAL_MERIDIAN_KW, firstOriginString.c_str() ); } } } /* offset vector */ ossimString xpath_offsetVector = "/gml:offsetVector"; xpath_offsetVector = xpath_offsetVector.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" ); xpath = xpath0 + xpath_offsetVector; xml_nodes.clear(); m_xmlDocument->findNodes( xpath, xml_nodes ); size_t nNodes = xml_nodes.size(); for ( size_t i=0; i<nNodes; ++i ) { const ossimString& offsetVectorString = xml_nodes[i]->getText(); size_t spacePos = offsetVectorString.find( ' ' ); ossimString firstOffsetVectorString = offsetVectorString.beforePos( spacePos ); ossimString secondOffsetVectorString = offsetVectorString.afterPos ( spacePos ); const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[i]->findAttribute( srsNameStr ); const ossimString& offsetVectorSrsName = hrefAttribute->getValue(); ossimString pcsCodeOffsetVectorStr = offsetVectorSrsName.after( pcsCodeDefinitionStr.string() ); ossim_uint32 pcsCodeOffsetVector = pcsCodeOffsetVectorStr.toUInt32(); if ( pcsCodeOffsetVector == 4326 ) { if ( firstAxisLabelString == ossimString( "Lat" ) ) { if ( firstOffsetVectorString.toDouble() != 0.0 ) { geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, firstOffsetVectorString.c_str() ); } else { geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, secondOffsetVectorString.c_str() ); } } else { if ( firstOffsetVectorString.toDouble() != 0.0 ) { geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, firstOffsetVectorString.c_str() ); } else { geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, secondOffsetVectorString.c_str() ); } } } else // map projection if ( pcsCodeOffsetVector == pcsCodeGrid ) { if ( firstAxisLabelString == ossimString( "X" ) ) { if ( firstOffsetVectorString.toDouble() != 0.0 ) { geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_X_KW, firstOffsetVectorString.c_str() ); } else { geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_Y_KW, secondOffsetVectorString.c_str() ); } } else { if ( firstOffsetVectorString.toDouble() != 0.0 ) { geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_Y_KW, firstOffsetVectorString.c_str() ); } else { geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_X_KW, secondOffsetVectorString.c_str() ); } } } else { /* Need to perform a coordinate conversion on the offset vector to the pcs code of the grid */ } } } } return success; } // End: ossimGmlSupportData::getImageGeometry( geoKwl )