Skip to content

Commit

Permalink
Support for WMS1.3 EX_GeographicBoundingBox. In 1.3, there are the su…
Browse files Browse the repository at this point in the history
…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 35f26f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
10 changes: 4 additions & 6 deletions src/providers/wms/qgshttptransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 () ),
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
25 changes: 20 additions & 5 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

/* $Id$ */

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

#include <fstream>
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 35f26f0

Please sign in to comment.