Skip to content
Permalink
Browse files

[FEATURE]: Possibility to set a WFS filter

  • Loading branch information
mhugent committed May 12, 2011
1 parent 76751f6 commit 07da493572712e8c5aea6d64d05ea5d8a8edac69
Showing with 24 additions and 4 deletions.
  1. +7 −1 src/plugins/wfs/qgswfssourceselect.cpp
  2. +17 −3 src/plugins/wfs/qgswfssourceselectbase.ui
@@ -387,6 +387,12 @@ void QgsWFSSourceSelect::addLayer()
crsString.prepend( "&SRSNAME=" );
}

QString filterString;
if ( !mFilterLineEdit->text().isEmpty() )
{
filterString = ( "&FILTER=" + mFilterLineEdit->text() );
}

//add a wfs layer to the map
if ( mIface )
{
@@ -402,7 +408,7 @@ void QgsWFSSourceSelect::addLayer()
.arg( currentExtent.xMaximum(), 0, 'f' )
.arg( currentExtent.yMaximum(), 0, 'f' );
}
mIface->addVectorLayer( uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString + bBoxString, typeName, "WFS" );
mIface->addVectorLayer( uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString + bBoxString + filterString, typeName, "WFS" );
}
accept();
}
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>590</width>
<height>503</height>
<width>552</width>
<height>439</height>
</rect>
</property>
<property name="windowTitle">
@@ -174,13 +174,27 @@
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="mFilterStringLabel">
<property name="text">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mFilterLineEdit"/>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="mBboxCheckBox">
<property name="text">
<string>Only request features overlapping the current view extent</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>

0 comments on commit 07da493

Please sign in to comment.
You can’t perform that action at this time.