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";
83 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"meters" ),
84 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"feet" ),
85 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
86 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"<unknown>" ),
87 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
88 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
89 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"degrees" ),
90 QT_TRANSLATE_NOOP(
"QGis::UnitType",
"nautical miles" )
112 return QCoreApplication::translate(
"QGis::UnitType", qPrintable(
toLiteral( unit ) ) );
117 #define DEGREE_TO_METER 111319.49079327358
118 #define FEET_TO_METER 0.3048
119 #define NMILE_TO_METER 1852.0
169 if ( size == 0 ||
long( size ) < 0 )
171 QgsDebugMsg( QString(
"Negative or zero size %1." ).arg( size ) );
174 void *p = malloc( size );
177 QgsDebugMsg( QString(
"Allocation of %1 bytes failed." ).arg( size ) );
184 if ( nmemb == 0 ||
long( nmemb ) < 0 || size == 0 ||
long( size ) < 0 )
186 QgsDebugMsg( QString(
"Negative or zero nmemb %1 or size %2." ).arg( nmemb ).arg( size ) );
192 memset( p, 0, nmemb * size );
204 switch ( lhs.type() )
207 return lhs.toInt() < rhs.toInt();
209 return lhs.toUInt() < rhs.toUInt();
210 case QVariant::LongLong:
211 return lhs.toLongLong() < rhs.toLongLong();
212 case QVariant::ULongLong:
213 return lhs.toULongLong() < rhs.toULongLong();
214 case QVariant::Double:
215 return lhs.toDouble() < rhs.toDouble();
217 return lhs.toChar() < rhs.toChar();
219 return lhs.toDate() < rhs.toDate();
221 return lhs.toTime() < rhs.toTime();
222 case QVariant::DateTime:
223 return lhs.toDateTime() < rhs.toDateTime();
225 return QString::localeAwareCompare( lhs.toString(), rhs.toString() ) < 0;
236 if ( path.startsWith(
"/vsizip/", Qt::CaseInsensitive ) ||
237 path.endsWith(
".zip", Qt::CaseInsensitive ) )
239 else if ( path.startsWith(
"/vsitar/", Qt::CaseInsensitive ) ||
240 path.endsWith(
".tar", Qt::CaseInsensitive ) ||
241 path.endsWith(
".tar.gz", Qt::CaseInsensitive ) ||
242 path.endsWith(
".tgz", Qt::CaseInsensitive ) )
244 else if ( path.startsWith(
"/vsigzip/", Qt::CaseInsensitive ) ||
245 path.endsWith(
".gz", Qt::CaseInsensitive ) )