Skip to content
Permalink
Browse files

BBOX option for wfs

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12993 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Mar 3, 2010
1 parent 5c6ae04 commit 9d41d2049bf67f1704781e01aa1b6d37f0f39c55
Showing with 88 additions and 78 deletions.
  1. +10 −1 src/plugins/wfs/qgswfssourceselect.cpp
  2. +78 −77 src/plugins/wfs/qgswfssourceselectbase.ui
@@ -24,6 +24,7 @@
#include "qgsproject.h"
#include "qgscoordinatereferencesystem.h"
#include "qgslogger.h"
#include "qgsmapcanvas.h" //for current view extent
#include <QDomDocument>
#include <QListWidgetItem>
#include <QMessageBox>
@@ -366,7 +367,15 @@ void QgsWFSSourceSelect::addLayer()
//add a wfs layer to the map
if ( mIface )
{
mIface->addVectorLayer( uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString, typeName, "WFS" );
//get current extent
QgsMapCanvas* canvas = mIface->mapCanvas();
QString bBoxString;
if ( canvas && mBboxCheckBox->isChecked() )
{
QgsRectangle currentExtent = canvas->extent();
bBoxString = QString( "&BBOX=%1,%2,%3,%4" ).arg( currentExtent.xMinimum() ).arg( currentExtent.yMinimum() ).arg( currentExtent.xMaximum() ).arg( currentExtent.yMaximum() );
}
mIface->addVectorLayer( uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString + bBoxString, typeName, "WFS" );
}
accept();
}
@@ -7,19 +7,84 @@
<x>0</x>
<y>0</y>
<width>577</width>
<height>444</height>
<height>503</height>
</rect>
</property>
<property name="windowTitle">
<string>Add WFS Layer from a Server</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="GroupBox1">
<property name="title">
<string>Server connections</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1">
<widget class="QPushButton" name="btnNew">
<property name="text">
<string>&amp;New</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="btnDelete">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="btnEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item row="1" column="4">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>171</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="btnConnect">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>C&amp;onnect</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QComboBox" name="cmbConnections"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="columnCount">
@@ -90,78 +155,14 @@
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="GroupBox1">
<property name="title">
<string>Server connections</string>
<item row="3" column="0">
<widget class="QCheckBox" name="mBboxCheckBox">
<property name="text">
<string>Only request features overlapping the current view extent</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1">
<widget class="QPushButton" name="btnNew">
<property name="text">
<string>&amp;New</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="btnDelete">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="btnEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item row="1" column="4">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>171</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="btnConnect">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>C&amp;onnect</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QComboBox" name="cmbConnections"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>

0 comments on commit 9d41d20

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