Skip to content

Commit 50ba992

Browse files
committed
backport wmts support
1 parent 84959cb commit 50ba992

12 files changed

+75
-511
lines changed

src/core/qgscoordinatereferencesystem.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ QgsCoordinateReferenceSystem& QgsCoordinateReferenceSystem::operator=( const Qgs
170170
mDescription = srs.mDescription;
171171
mProjectionAcronym = srs.mProjectionAcronym;
172172
mEllipsoidAcronym = srs.mEllipsoidAcronym;
173+
mAxisInverted = srs.mAxisInverted;
173174
mGeoFlag = srs.mGeoFlag;
174175
mMapUnits = srs.mMapUnits;
175176
mSRID = srs.mSRID;
@@ -267,6 +268,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString expression, Q
267268
mSRID = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 5 ) ).toLong();
268269
mAuthId = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 6 ) );
269270
mGeoFlag = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 7 ) ).toInt() != 0;
271+
mAxisInverted = -1;
270272

271273
if ( mSrsId >= USER_CRS_START_ID && mAuthId.isEmpty() )
272274
{
@@ -754,6 +756,22 @@ bool QgsCoordinateReferenceSystem::geographicFlag() const
754756
return mGeoFlag;
755757
}
756758

759+
bool QgsCoordinateReferenceSystem::axisInverted() const
760+
{
761+
if ( mAxisInverted == -1 )
762+
{
763+
OGRAxisOrientation orientation;
764+
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
765+
mAxisInverted = mGeoFlag
766+
? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
767+
: ( orientation == OAO_North || orientation == OAO_South );
768+
QgsDebugMsg( QString( "srid:%1 axis0:%2 orientation:%3 inverted:%4" ).arg( mSRID ).arg( axis0 ).arg( OSRAxisEnumToName( orientation ) ).arg( mAxisInverted ) );
769+
Q_UNUSED( axis0 );
770+
}
771+
772+
return mAxisInverted != 0;
773+
}
774+
757775
QGis::UnitType QgsCoordinateReferenceSystem::mapUnits() const
758776
{
759777
return mMapUnits;

src/core/qgscoordinatereferencesystem.h

+9
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
308308
*/
309309
bool geographicFlag() const;
310310

311+
/*! return if axis is inverted (eg. for WMS 1.3)
312+
* @return bool Whether this is crs axis is inverted
313+
* @note added in 1.9.90
314+
*/
315+
bool axisInverted() const;
316+
311317
/*! Get the units that the projection is in
312318
* @return QGis::UnitType that gives the units for the coordinate system
313319
*/
@@ -426,6 +432,9 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
426432

427433
QString mValidationHint;
428434

435+
//!Whether this is a coordinate system has inverted axis
436+
mutable int mAxisInverted;
437+
429438
static CUSTOM_CRS_VALIDATION mCustomSrsValidation;
430439
};
431440

src/core/spatialindex/storagemanager/DiskStorageManager.cc

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <sys/types.h>
2626
#include <sys/stat.h>
2727
#include <stdio.h>
28+
#include <unistd.h>
2829
#include <cstring>
2930

3031
#ifdef WIN32

src/core/spatialindex/tools/TemporaryFile.cc

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// mhadji@gmail.com
2121

2222
#include <stdio.h>
23+
#include <unistd.h>
2324

2425
#include <Tools.h>
2526

src/providers/wms/CMakeLists.txt

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
1-
SET (WMS_SRCS
2-
qgswmsprovider.cpp
3-
qgswmssourceselect.cpp
4-
qgswmsconnection.cpp
5-
qgswmsdataitems.cpp
1+
SET (WMS_SRCS
2+
qgswmsprovider.cpp
3+
qgswmssourceselect.cpp
64
qgstilescalewidget.cpp
75
qgswmtsdimensions.cpp
6+
../../app/qgsnewhttpconnection.cpp
7+
../../app/qgsnumericsortlistviewitem.cpp
8+
../../app/qgsmanageconnectionsdialog.cpp
89
)
910
SET (WMS_MOC_HDRS
1011
qgswmsprovider.h
1112
qgswmssourceselect.h
12-
qgswmsconnection.h
13-
qgswmsdataitems.h
1413
qgstilescalewidget.h
1514
qgswmtsdimensions.h
15+
../../app/qgsnewhttpconnection.h
16+
../../app/qgsnumericsortlistviewitem.h
17+
../../app/qgsmanageconnectionsdialog.h
1618
)
1719

1820
QT4_WRAP_CPP (WMS_MOC_SRCS ${WMS_MOC_HDRS})
1921

2022
INCLUDE_DIRECTORIES( .
23+
${CMAKE_CURRENT_BINARY_DIR}/../../ui
2124
../../core
2225
../../core/raster
26+
../../gui
2327
${GDAL_INCLUDE_DIR}
2428
)
2529

2630
ADD_LIBRARY(wmsprovider MODULE ${WMS_SRCS} ${WMS_MOC_SRCS})
2731

2832
TARGET_LINK_LIBRARIES(wmsprovider
2933
qgis_core
34+
qgis_gui
3035
)
3136

3237
INSTALL (TARGETS wmsprovider

src/providers/wms/qgstilescalewidget.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "qgsmapcanvas.h"
2121
#include "qgsrasterlayer.h"
2222
#include "qgswmsprovider.h"
23-
#include "qgsmessagelog.h"
2423
#include "qgslogger.h"
2524

2625
#include <QDockWidget>

src/providers/wms/qgswmsconnection.cpp

-139
This file was deleted.

0 commit comments

Comments
 (0)