Skip to content
Permalink
Browse files
Support for WMS1.3 EX_GeographicBoundingBox. In 1.3, there are the su…
…belements 'westBoundLongitude', 'eastBoundLongitude', 'southBoundLatitude' and 'northBoundLatitude' instead of the attributes minx, miny, maxx, maxy

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5481 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed May 22, 2006
1 parent aec20f7 commit 35f26f013d54ae7a978c05c76db48702657b2f18
Showing with 24 additions and 11 deletions.
  1. +4 −6 src/providers/wms/qgshttptransaction.cpp
  2. +20 −5 src/providers/wms/qgswmsprovider.cpp
@@ -117,24 +117,23 @@ bool QgsHttpTransaction::getSynchronously(QByteArray &respondedContent, int redi
QString pathAndQuery = httpurl.remove(0,
httpurl.indexOf(qurl.path()));
httpid = http->get( pathAndQuery );

connect(http, SIGNAL( requestStarted ( int ) ),
this, SLOT( dataStarted ( int ) ) );

connect(http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader& ) ),
this, SLOT( dataHeaderReceived( const QHttpResponseHeader& ) ) );

connect(http, SIGNAL( readyRead( const QHttpResponseHeader& ) ),
this, SLOT( dataReceived( const QHttpResponseHeader& ) ) );
this, SLOT( dataReceived( const QHttpResponseHeader& ) ) );

connect(http, SIGNAL( dataReadProgress ( int, int ) ),
this, SLOT( dataProgress ( int, int ) ) );
this, SLOT( dataProgress ( int, int ) ) );

connect(http, SIGNAL( requestFinished ( int, bool ) ),
this, SLOT( dataFinished ( int, bool ) ) );

connect(http, SIGNAL( stateChanged ( int ) ),
this, SLOT( dataStateChanged ( int ) ) );
this, SLOT( dataStateChanged ( int ) ) );

// Set up the watchdog timer
connect(mWatchdogTimer, SIGNAL( timeout () ),
@@ -157,7 +156,6 @@ bool QgsHttpTransaction::getSynchronously(QByteArray &respondedContent, int redi
{
// Do something else, maybe even network processing events
qApp->processEvents();

// TODO: Implement a network timeout
}

@@ -284,7 +282,7 @@ void QgsHttpTransaction::dataProgress( int done, int total )
{

#ifdef QGISDEBUG
// std::cout << "QgsHttpTransaction::dataProgress: got " << done << " of " << total << std::endl;
std::cout << "QgsHttpTransaction::dataProgress: got " << done << " of " << total << std::endl;
#endif

// We saw something come back, therefore restart the watchdog timer
@@ -18,6 +18,7 @@

/* $Id$ */

#include "qgslogger.h"
#include "qgswmsprovider.h"

#include <fstream>
@@ -1527,10 +1528,7 @@ void QgsWmsProvider::parseLayer(QDomElement const & e, QgsWmsLayerProperty& laye
layerProperty.crs.push_back(*i);
}
}
else if (
(e1.tagName() == "EX_GeographicBoundingBox") ||
(e1.tagName() == "LatLonBoundingBox") // legacy from earlier versions of WMS
)
else if (e1.tagName() == "LatLonBoundingBox") // legacy from earlier versions of WMS
{

// std::cout << " LLBB is: '" << e1.attribute("minx") << "'." << std::endl;
@@ -1545,6 +1543,23 @@ void QgsWmsProvider::parseLayer(QDomElement const & e, QgsWmsLayerProperty& laye
e1.attribute("maxy").toDouble()
);
}
else if(e1.tagName() == "EX_GeographicBoundingBox") //for WMS 1.3
{
QDomElement wBoundLongitudeElem = n1.namedItem("westBoundLongitude").toElement();
QDomElement eBoundLongitudeElem = n1.namedItem("eastBoundLongitude").toElement();
QDomElement sBoundLatitudeElem = n1.namedItem("southBoundLatitude").toElement();
QDomElement nBoundLatitudeElem = n1.namedItem("northBoundLatitude").toElement();
double wBLong, eBLong, sBLat, nBLat;
bool wBOk, eBOk, sBOk, nBOk;
wBLong = wBoundLongitudeElem.text().toDouble(&wBOk);
eBLong = eBoundLongitudeElem.text().toDouble(&eBOk);
sBLat = sBoundLatitudeElem.text().toDouble(&sBOk);
nBLat = nBoundLatitudeElem.text().toDouble(&nBOk);
if(wBOk && eBOk && sBOk && nBOk)
{
layerProperty.ex_GeographicBoundingBox = QgsRect(wBLong, sBLat, eBLong, nBLat);
}
}
else if (e1.tagName() == "BoundingBox")
{
// TODO: overwrite inherited
@@ -1905,7 +1920,7 @@ bool QgsWmsProvider::calculateExtent()
it != activeSubLayers.end();
++it )
{

QgsDebugMsg("Sublayer Iterator: "+*it);
// This is the extent for the layer name in *it
QgsRect extent = extentForLayer.find( *it )->second;

0 comments on commit 35f26f0

Please sign in to comment.