20 #include "qgsversion.h"
22 #include <QCoreApplication>
26 #include "qgsconfig.h"
47 #if GDAL_VERSION_NUM >= 1800
48 const CORE_EXPORT QString
GEOPROJ4 =
"+proj=longlat +datum=WGS84 +no_defs";
50 const CORE_EXPORT QString
GEOPROJ4 =
"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
55 " DATUM[\"WGS_1984\", "
56 " SPHEROID[\"WGS 84\",6378137,298.257223563, "
57 " AUTHORITY[\"EPSG\",7030]], "
58 " TOWGS84[0,0,0,0,0,0,0], "
59 " AUTHORITY[\"EPSG\",6326]], "
60 " PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
61 " UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
62 " AXIS[\"Lat\",NORTH], "
63 " AXIS[\"Long\",EAST], "
64 " AUTHORITY[\"EPSG\",4326]]";
67 "1:1000000,1:500000,1:250000,1:100000,1:50000,1:25000,"
68 "1:10000,1:5000,1:2500,1:1000,1:500";
80 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"meters" ),
81 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"feet" ),
82 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
83 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"<unknown>" ),
84 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
85 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
86 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" )
108 return QCoreApplication::translate(
"QGis::UnitType", qPrintable(
toLiteral( unit ) ) );
113 if ( size == 0 ||
long( size ) < 0 )
115 QgsDebugMsg( QString(
"Negative or zero size %1." ).arg( size ) );
118 void *p = malloc( size );
121 QgsDebugMsg( QString(
"Allocation of %1 bytes failed." ).arg( size ) );
128 if ( nmemb == 0 ||
long( nmemb ) < 0 || size == 0 ||
long( size ) < 0 )
130 QgsDebugMsg( QString(
"Negative or zero nmemb %1 or size %2." ).arg( nmemb ).arg( size ) );
136 memset( p, 0, nmemb * size );
148 switch ( lhs.type() )
151 return lhs.toInt() < rhs.toInt();
153 return lhs.toUInt() < rhs.toUInt();
154 case QVariant::LongLong:
155 return lhs.toLongLong() < rhs.toLongLong();
156 case QVariant::ULongLong:
157 return lhs.toULongLong() < rhs.toULongLong();
158 case QVariant::Double:
159 return lhs.toDouble() < rhs.toDouble();
161 return lhs.toChar() < rhs.toChar();
163 return lhs.toDate() < rhs.toDate();
165 return lhs.toTime() < rhs.toTime();
166 case QVariant::DateTime:
167 return lhs.toDateTime() < rhs.toDateTime();
169 return QString::localeAwareCompare( lhs.toString(), rhs.toString() ) < 0;
static const char * QGIS_VERSION
static UnitType fromLiteral(QString literal, QGis::UnitType defaultType=UnknownUnit)
Converts from the canonical name to the type value.
void * qgsMalloc(size_t size)
Allocates size bytes and returns a pointer to the allocated memory.
const CORE_EXPORT QString GEOWKT
Wkt string that represents a geographic coord sys.
void * qgsCalloc(size_t nmemb, size_t size)
Allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the alloc...
static const double DEFAULT_IDENTIFY_RADIUS
bool qgsVariantGreaterThan(const QVariant &lhs, const QVariant &rhs)
bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
static const char * QGIS_DEV_VERSION
const CORE_EXPORT QString PROJECT_SCALES
static const char * QGIS_RELEASE_NAME
static QString tr(QGis::UnitType unit)
Provides translated version of the type value.
const CORE_EXPORT QString GEO_NONE
Constant that holds the string representation for "No ellips/No CRS".
UnitType
Map units that qgis supports.
const CORE_EXPORT QString GEOPROJ4
PROJ4 string that represents a geographic coord sys.
static QString toLiteral(QGis::UnitType unit)
Provides the canonical name of the type value.
void qgsFree(void *ptr)
Frees the memory space pointed to by ptr.
static const int QGIS_VERSION_INT
static const char * qgisUnitTypes[]
const CORE_EXPORT QString GEO_EPSG_CRS_AUTHID
Geographic coord sys from EPSG authority.