Skip to content
Permalink
Browse files

[qt6] Allow using QCoordinateReferenceSystem in QMap

  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 31, 2021
1 parent 666fcda commit 81c372d0a5e33575d0cd120fe9131f54c88c33c5
Showing with 26 additions and 0 deletions.
  1. +17 −0 src/core/qgscoordinatereferencesystem.cpp
  2. +9 −0 src/core/qgscoordinatereferencesystem.h
@@ -2584,3 +2584,20 @@ void QgsCoordinateReferenceSystem::invalidateCache( bool disableCache )
}
sCrsStringLock()->unlock();
}

bool operator> ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId > c2.d->mSrsId;
}
bool operator< ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId < c2.d->mSrsId;
}
bool operator>= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId >= c2.d->mSrsId;
}
bool operator<= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId <= c2.d->mSrsId;
}
@@ -983,6 +983,10 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
friend class TestQgsCoordinateReferenceSystem;
friend class QgsPostgresProvider;
friend class QgsCoordinateReferenceSystemRegistry;
friend bool operator> ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
friend bool operator< ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
friend bool operator>= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
friend bool operator<= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );

bool createFromPostgisSrid( const long id );
};
@@ -1035,6 +1039,11 @@ inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateReferenc
// Using streams we need to use local 8 Bit
return os << mySummary.toLocal8Bit().data() << std::endl;
}

bool operator> ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool operator< ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool operator>= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool operator<= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
#endif

#endif // QGSCOORDINATEREFERENCESYSTEM_H

0 comments on commit 81c372d

Please sign in to comment.