⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qgswmsprovider.cpp

📁 一个非常好的GIS开源新版本
💻 CPP
📖 第 1 页 / 共 5 页
字号:
  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseCapability(QDomElement const & e, QgsWmsCapabilityProperty& capabilityProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          //QgsDebugMsg("  "  + e1.tagName() ); // the node really is an element.                if (e1.tagName() == "Request")          {            parseRequest(e1, capabilityProperty.request);          }          else if (e1.tagName() == "Layer")          {            parseLayer(e1, capabilityProperty.layer);          }            }      n1 = n1.nextSibling();  }      QgsDebugMsg("exiting.");}void QgsWmsProvider::parseContactPersonPrimary(QDomElement const & e, QgsWmsContactPersonPrimaryProperty& contactPersonPrimaryProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "ContactPerson")          {            contactPersonPrimaryProperty.contactPerson = e1.text();          }          else if (e1.tagName() == "ContactOrganization")          {            contactPersonPrimaryProperty.contactOrganization = e1.text();          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseContactAddress(QDomElement const & e, QgsWmsContactAddressProperty& contactAddressProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "AddressType")          {            contactAddressProperty.addressType = e1.text();          }          else if (e1.tagName() == "Address")          {            contactAddressProperty.address = e1.text();          }          else if (e1.tagName() == "City")          {            contactAddressProperty.city = e1.text();          }          else if (e1.tagName() == "StateOrProvince")          {            contactAddressProperty.stateOrProvince = e1.text();          }          else if (e1.tagName() == "PostCode")          {            contactAddressProperty.postCode = e1.text();          }          else if (e1.tagName() == "Country")          {            contactAddressProperty.country = e1.text();          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseContactInformation(QDomElement const & e, QgsWmsContactInformationProperty& contactInformationProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "ContactPersonPrimary")          {            parseContactPersonPrimary(e1, contactInformationProperty.contactPersonPrimary);          }          else if (e1.tagName() == "ContactPosition")          {            contactInformationProperty.contactPosition = e1.text();          }          else if (e1.tagName() == "ContactAddress")          {            parseContactAddress(e1, contactInformationProperty.contactAddress);          }          else if (e1.tagName() == "ContactVoiceTelephone")          {            contactInformationProperty.contactVoiceTelephone = e1.text();          }          else if (e1.tagName() == "ContactFacsimileTelephone")          {            contactInformationProperty.contactFacsimileTelephone = e1.text();          }          else if (e1.tagName() == "ContactElectronicMailAddress")          {            contactInformationProperty.contactElectronicMailAddress = e1.text();          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseOnlineResource(QDomElement const & e, QgsWmsOnlineResourceAttribute& onlineResourceAttribute){  QgsDebugMsg("entering.");  onlineResourceAttribute.xlinkHref = e.attribute("xlink:href");  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseKeywordList(QDomElement  const & e, QStringList& keywordListProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if (e1.tagName() == "Keyword")          {            QgsDebugMsg("      Keyword.");             keywordListProperty += e1.text();          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseGet(QDomElement const & e, QgsWmsGetProperty& getProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "OnlineResource")          {            QgsDebugMsg("      OnlineResource.");            parseOnlineResource(e1, getProperty.onlineResource);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parsePost(QDomElement const & e, QgsWmsPostProperty& postProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if (e1.tagName() == "OnlineResource")          {            QgsDebugMsg("      OnlineResource.");            parseOnlineResource(e1, postProperty.onlineResource);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseHttp(QDomElement const & e, QgsWmsHttpProperty& httpProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "Get")          {            QgsDebugMsg("      Get.");            parseGet(e1, httpProperty.get);          }          else if (e1.tagName() == "Post")          {            QgsDebugMsg("      Post.");            parsePost(e1, httpProperty.post);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseDcpType(QDomElement const & e, QgsWmsDcpTypeProperty& dcpType){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if (e1.tagName() == "HTTP")          {            QgsDebugMsg("      HTTP.");             parseHttp(e1, dcpType.http);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseOperationType(QDomElement const & e, QgsWmsOperationType& operationType){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "Format")          {            QgsDebugMsg("      Format.");             operationType.format += e1.text();          }          else if (e1.tagName() == "DCPType")          {            QgsDebugMsg("      DCPType.");            QgsWmsDcpTypeProperty dcp;            parseDcpType(e1, dcp);            operationType.dcpType.push_back(dcp);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseRequest(QDomElement const & e, QgsWmsRequestProperty& requestProperty){  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if (e1.tagName() == "GetMap")          {            QgsDebugMsg("      GetMap.");             parseOperationType(e1, requestProperty.getMap);          }          else if (e1.tagName() == "GetFeatureInfo")          {            QgsDebugMsg("      GetFeatureInfo.");            parseOperationType(e1, requestProperty.getFeatureInfo);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseLegendUrl(QDomElement const & e, QgsWmsLegendUrlProperty& legendUrlProperty){  QgsDebugMsg("entering.");  legendUrlProperty.width  = e.attribute("width").toUInt();  legendUrlProperty.height = e.attribute("height").toUInt();  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if      (e1.tagName() == "Format")          {            legendUrlProperty.format = e1.text();          }          else if (e1.tagName() == "OnlineResource")          {            parseOnlineResource(e1, legendUrlProperty.onlineResource);          }      }      n1 = n1.nextSibling();  }  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseStyle(QDomElement const & e, QgsWmsStyleProperty& styleProperty){//  QgsDebugMsg("entering.");  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          if (e1.tagName() == "Name")          {            styleProperty.name = e1.text();          }          else if (e1.tagName() == "Title")          {            styleProperty.title = e1.text();          }          else if (e1.tagName() == "Abstract")          {            styleProperty.abstract = e1.text();          }          else if (e1.tagName() == "LegendURL")          {            // TODO          }          else if (e1.tagName() == "StyleSheetURL")          {            // TODO          }          else if (e1.tagName() == "StyleURL")          {            // TODO          }      }      n1 = n1.nextSibling();  }//  QgsDebugMsg("exiting.");}void QgsWmsProvider::parseLayer(QDomElement const & e, QgsWmsLayerProperty& layerProperty,                                QgsWmsLayerProperty *parentProperty){//  QgsDebugMsg("entering.");// TODO: Delete this stanza completely, depending on success of "Inherit things into the sublayer" below.//  // enforce WMS non-inheritance rules//  layerProperty.name =        QString::null;//  layerProperty.title =       QString::null;//  layerProperty.abstract =    QString::null;//  layerProperty.keywordList.clear();  // assume true until we find a child layer  bool atleaf = TRUE;  layerProperty.queryable   = e.attribute("queryable").toUInt();  layerProperty.cascaded    = e.attribute("cascaded").toUInt();  layerProperty.opaque      = e.attribute("opaque").toUInt();  layerProperty.noSubsets   = e.attribute("noSubsets").toUInt();  layerProperty.fixedWidth  = e.attribute("fixedWidth").toUInt();  layerProperty.fixedHeight = e.attribute("fixedHeight").toUInt();  QDomNode n1 = e.firstChild();  while( !n1.isNull() ) {      QDomElement e1 = n1.toElement(); // try to convert the node to an element.      if( !e1.isNull() ) {          //QgsDebugMsg("    "  + e1.tagName() ); // the node really is an element.          if      (e1.tagName() == "Layer")          {//            QgsDebugMsg("      Nested layer.");             QgsWmsLayerProperty subLayerProperty;            // Inherit things into the sublayer            //   Ref: 7.2.4.8 Inheritance of layer properties            subLayerProperty.style                    = layerProperty.style;            subLayerProperty.crs                      = layerProperty.crs;            subLayerProperty.boundingBox              = layerProperty.boundingBox;            subLayerProperty.ex_GeographicBoundingBox = layerProperty.ex_GeographicBoundingBox;            // TODO            parseLayer(e1, subLayerProperty, &layerProperty );            layerProperty.layer.push_back(subLayerProperty);            atleaf = FALSE;          }          else if (e1.tagName() == "Name")          {            layerProperty.name = e1.text();          }          else if (e1.tagName() == "Title")          {            layerProperty.title = e1.text();          }          else if (e1.tagName() == "Abstract")          {            layerProperty.abstract = e1.text();          }          else if (e1.tagName() == "KeywordList")          {            parseKeywordList(e1, layerProperty.keywordList);          }          else if (e1.tagName() == "CRS")          {            layerProperty.crs.push_back(e1.text());          }          else if (e1.tagName() == "SRS")        // legacy from earlier versions of WMS          {            // SRS can contain several definitions separated by whitespace

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -