[FEATURE]: Possibility to set a WFS filter

This commit is contained in:
Marco Hugentobler 2011-05-12 09:29:30 +02:00
parent 76751f614d
commit 07da493572
2 changed files with 24 additions and 4 deletions

View File

@ -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();
}

View File

@ -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>