Skip to content
Permalink
Browse files
backport wmts support
  • Loading branch information
jef-n committed May 14, 2012
1 parent 84959cb commit 50ba9929afaf470e9417b4779e85835648f022cc
@@ -170,6 +170,7 @@ QgsCoordinateReferenceSystem& QgsCoordinateReferenceSystem::operator=( const Qgs
mDescription = srs.mDescription;
mProjectionAcronym = srs.mProjectionAcronym;
mEllipsoidAcronym = srs.mEllipsoidAcronym;
mAxisInverted = srs.mAxisInverted;
mGeoFlag = srs.mGeoFlag;
mMapUnits = srs.mMapUnits;
mSRID = srs.mSRID;
@@ -267,6 +268,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString expression, Q
mSRID = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 5 ) ).toLong();
mAuthId = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 6 ) );
mGeoFlag = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 7 ) ).toInt() != 0;
mAxisInverted = -1;

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

bool QgsCoordinateReferenceSystem::axisInverted() const
{
if ( mAxisInverted == -1 )
{
OGRAxisOrientation orientation;
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
mAxisInverted = mGeoFlag
? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
: ( orientation == OAO_North || orientation == OAO_South );
QgsDebugMsg( QString( "srid:%1 axis0:%2 orientation:%3 inverted:%4" ).arg( mSRID ).arg( axis0 ).arg( OSRAxisEnumToName( orientation ) ).arg( mAxisInverted ) );
Q_UNUSED( axis0 );
}

return mAxisInverted != 0;
}

QGis::UnitType QgsCoordinateReferenceSystem::mapUnits() const
{
return mMapUnits;
@@ -308,6 +308,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
*/
bool geographicFlag() const;

/*! return if axis is inverted (eg. for WMS 1.3)
* @return bool Whether this is crs axis is inverted
* @note added in 1.9.90
*/
bool axisInverted() const;

/*! Get the units that the projection is in
* @return QGis::UnitType that gives the units for the coordinate system
*/
@@ -426,6 +432,9 @@ class CORE_EXPORT QgsCoordinateReferenceSystem

QString mValidationHint;

//!Whether this is a coordinate system has inverted axis
mutable int mAxisInverted;

static CUSTOM_CRS_VALIDATION mCustomSrsValidation;
};

@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <cstring>

#ifdef WIN32
@@ -20,6 +20,7 @@
// mhadji@gmail.com

#include <stdio.h>
#include <unistd.h>

#include <Tools.h>

@@ -1,32 +1,37 @@
SET (WMS_SRCS
qgswmsprovider.cpp
qgswmssourceselect.cpp
qgswmsconnection.cpp
qgswmsdataitems.cpp
SET (WMS_SRCS
qgswmsprovider.cpp
qgswmssourceselect.cpp
qgstilescalewidget.cpp
qgswmtsdimensions.cpp
../../app/qgsnewhttpconnection.cpp
../../app/qgsnumericsortlistviewitem.cpp
../../app/qgsmanageconnectionsdialog.cpp
)
SET (WMS_MOC_HDRS
qgswmsprovider.h
qgswmssourceselect.h
qgswmsconnection.h
qgswmsdataitems.h
qgstilescalewidget.h
qgswmtsdimensions.h
../../app/qgsnewhttpconnection.h
../../app/qgsnumericsortlistviewitem.h
../../app/qgsmanageconnectionsdialog.h
)

QT4_WRAP_CPP (WMS_MOC_SRCS ${WMS_MOC_HDRS})

INCLUDE_DIRECTORIES( .
${CMAKE_CURRENT_BINARY_DIR}/../../ui
../../core
../../core/raster
../../gui
${GDAL_INCLUDE_DIR}
)

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

TARGET_LINK_LIBRARIES(wmsprovider
qgis_core
qgis_gui
)

INSTALL (TARGETS wmsprovider
@@ -20,7 +20,6 @@
#include "qgsmapcanvas.h"
#include "qgsrasterlayer.h"
#include "qgswmsprovider.h"
#include "qgsmessagelog.h"
#include "qgslogger.h"

#include <QDockWidget>

This file was deleted.

Loading

0 comments on commit 50ba992

Please sign in to comment.