Skip to content
Permalink
Browse files
Accept urls with and without ? for wfs layers. Removed warning string…
… for wfs and increased version string to '0.1'

git-svn-id: http://svn.osgeo.org/qgis/trunk@7747 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Dec 9, 2007
1 parent 2e7dd3f commit b0347e9d39972ed56d566c25b564a17b69c62826
Showing with 17 additions and 7 deletions.
  1. +1 −1 src/plugins/wfs/qgswfsplugin.cpp
  2. +14 −4 src/plugins/wfs/qgswfssourceselect.cpp
  3. +1 −1 src/plugins/wfs/qgswfssourceselect.h
  4. +1 −1 src/plugins/wfs/qgswfssourceselectbase.ui
@@ -27,7 +27,7 @@

static const QString name_ = QObject::tr("WFS plugin");
static const QString description_ = QObject::tr("Adds WFS layers to the QGIS canvas");
static const QString version_ = QObject::tr("Version 0.0001");
static const QString version_ = QObject::tr("Version 0.1");

QgsWFSPlugin::QgsWFSPlugin(QgisInterface* iface)
: QgisPlugin(name_, description_, version_, QgisPlugin::MAPLAYER),
@@ -133,9 +133,14 @@ int QgsWFSSourceSelect::getCapabilities(const QString& uri, QgsWFSSourceSelect::
return 1;
}

int QgsWFSSourceSelect::getCapabilitiesGET(const QString& uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts)
int QgsWFSSourceSelect::getCapabilitiesGET(QString uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts)
{
if(!(uri.contains("?")))
{
uri.append("?");
}
QString request = uri + "SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.1.1";

QByteArray result;
QgsHttpTransaction http(request);
http.getSynchronously(result);
@@ -330,7 +335,13 @@ void QgsWFSSourceSelect::addLayer()
return;
}
QString typeName = tItem->text(1);
qWarning(mUri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName);

QString uri = mUri;
if(!(uri.contains("?")))
{
uri.append("?");
}
qWarning(uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName);

//get CRS
QString crsString;
@@ -345,8 +356,7 @@ void QgsWFSSourceSelect::addLayer()
//add a wfs layer to the map
if(mIface)
{
qWarning(mUri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString);
mIface->addVectorLayer(mUri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString, typeName, "WFS");
mIface->addVectorLayer(uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString, typeName, "WFS");
}
accept();
}
@@ -67,7 +67,7 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
@return 0 in case of success*/
int getCapabilities(const QString& uri, QgsWFSSourceSelect::REQUEST_ENCODING e, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts);
//encoding specific methods of getCapabilities
int getCapabilitiesGET(const QString& uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts);
int getCapabilitiesGET(QString uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts);
int getCapabilitiesPOST(const QString& uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts);
int getCapabilitiesSOAP(const QString& uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts);

@@ -10,7 +10,7 @@
</rect>
</property>
<property name="windowTitle" >
<string>Note: this plugin not considered stable yet. Use it on your own risk</string>
<string>Add WFS Layer from a Server</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >

0 comments on commit b0347e9

Please sign in to comment.