@@ -595,7 +595,6 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &wkt )
595
595
QgsDebugMsg ( " theWkt is uninitialized, operation failed" );
596
596
return d->mIsValid ;
597
597
}
598
- QgsDebugMsg ( " wkt: " + wkt );
599
598
QByteArray ba = wkt.toLatin1 ();
600
599
const char *pWkt = ba.data ();
601
600
@@ -620,7 +619,6 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &wkt )
620
619
QString authid = QStringLiteral ( " %1:%2" )
621
620
.arg ( OSRGetAuthorityName ( d->mCRS , nullptr ),
622
621
OSRGetAuthorityCode ( d->mCRS , nullptr ) );
623
- QgsDebugMsg ( " authid recognized as " + authid );
624
622
bool result = createFromOgcWmsCrs ( authid );
625
623
sCRSWktLock .lockForWrite ();
626
624
sWktCache .insert ( wkt, *this );
@@ -701,16 +699,13 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
701
699
// +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515.000000472 +units=m +no_defs
702
700
//
703
701
QString myProj4String = proj4String.trimmed ();
704
- QgsDebugMsg ( " proj4: " + myProj4String );
705
702
d->mIsValid = false ;
706
703
d->mWkt .clear ();
707
704
708
705
QRegExp myProjRegExp ( " \\ +proj=(\\ S+)" );
709
706
int myStart = myProjRegExp.indexIn ( myProj4String );
710
707
if ( myStart == -1 )
711
708
{
712
- QgsDebugMsg ( " proj string supplied has no +proj argument" );
713
-
714
709
sProj4CacheLock .lockForWrite ();
715
710
sProj4Cache .insert ( proj4String, *this );
716
711
sProj4CacheLock .unlock ();
@@ -724,7 +719,6 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
724
719
myStart = myEllipseRegExp.indexIn ( myProj4String );
725
720
if ( myStart == -1 )
726
721
{
727
- QgsDebugMsg ( " proj string supplied has no +ellps argument" );
728
722
d->mEllipsoidAcronym .clear ();
729
723
}
730
724
else
@@ -734,10 +728,6 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
734
728
735
729
QRegExp myAxisRegExp ( " \\ +a=(\\ S+)" );
736
730
myStart = myAxisRegExp.indexIn ( myProj4String );
737
- if ( myStart == -1 )
738
- {
739
- QgsDebugMsg ( " proj string supplied has no +a argument" );
740
- }
741
731
742
732
long mySrsId = 0 ;
743
733
QgsCoordinateReferenceSystem::RecordMap myRecord;
@@ -849,7 +839,6 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
849
839
if ( !myRecord.empty () )
850
840
{
851
841
mySrsId = myRecord[QStringLiteral ( " srs_id" )].toLong ();
852
- QgsDebugMsg ( " proj4string param match search for srsid returned srsid: " + QString::number ( mySrsId ) );
853
842
if ( mySrsId > 0 )
854
843
{
855
844
createFromSrsId ( mySrsId );
@@ -858,10 +847,8 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
858
847
else
859
848
{
860
849
// Last ditch attempt to piece together what we know of the projection to find a match...
861
- QgsDebugMsg ( " globbing search for srsid from this proj string" );
862
850
setProj4String ( myProj4String );
863
851
mySrsId = findMatchingProj ();
864
- QgsDebugMsg ( " globbing search for srsid returned srsid: " + QString::number ( mySrsId ) );
865
852
if ( mySrsId > 0 )
866
853
{
867
854
createFromSrsId ( mySrsId );
@@ -899,7 +886,6 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
899
886
sqlite3_stmt *myPreparedStatement = nullptr ;
900
887
int myResult;
901
888
902
- QgsDebugMsg ( " running query: " + sql );
903
889
// Get the full path name to the sqlite3 spatial reference database.
904
890
myDatabaseFileName = QgsApplication::srsDatabaseFilePath ();
905
891
QFileInfo myInfo ( myDatabaseFileName );
@@ -920,7 +906,6 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
920
906
// XXX Need to free memory from the error msg if one is set
921
907
if ( myResult == SQLITE_OK && sqlite3_step ( myPreparedStatement ) == SQLITE_ROW )
922
908
{
923
- QgsDebugMsg ( " trying system srs.db" );
924
909
int myColumnCount = sqlite3_column_count ( myPreparedStatement );
925
910
// loop through each column in the record adding its expression name and value to the map
926
911
for ( int myColNo = 0 ; myColNo < myColumnCount; myColNo++ )
@@ -942,7 +927,6 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
942
927
943
928
if ( myMap.empty () )
944
929
{
945
- QgsDebugMsg ( " trying user qgis.db" );
946
930
sqlite3_finalize ( myPreparedStatement );
947
931
sqlite3_close ( myDatabase );
948
932
@@ -989,15 +973,6 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
989
973
sqlite3_finalize ( myPreparedStatement );
990
974
sqlite3_close ( myDatabase );
991
975
992
- #ifdef QGISDEBUG
993
- QgsDebugMsg ( " retrieved: " + sql );
994
- RecordMap::Iterator it;
995
- for ( it = myMap.begin (); it != myMap.end (); ++it )
996
- {
997
- QgsDebugMsgLevel ( it.key () + " => " + it.value (), 2 );
998
- }
999
- #endif
1000
-
1001
976
return myMap;
1002
977
}
1003
978
@@ -1130,11 +1105,8 @@ void QgsCoordinateReferenceSystem::setProj4String( const QString& proj4String )
1130
1105
}
1131
1106
d->mWkt .clear ();
1132
1107
setMapUnits ();
1133
-
1134
- #if defined(QGISDEBUG) && QGISDEBUG>=3
1135
- debugPrint ();
1136
- #endif
1137
1108
}
1109
+
1138
1110
void QgsCoordinateReferenceSystem::setGeographicFlag ( bool geoFlag )
1139
1111
{
1140
1112
d.detach ();
@@ -1187,15 +1159,12 @@ void QgsCoordinateReferenceSystem::setMapUnits()
1187
1159
if ( qAbs ( toMeter - FEET_TO_METER ) < SMALL_NUM )
1188
1160
unit = QStringLiteral ( " Foot" );
1189
1161
1190
- QgsDebugMsg ( " Projection has linear units of " + unit );
1191
-
1192
1162
if ( qgsDoubleNear ( toMeter, 1.0 ) ) // Unit name for meters would be "metre"
1193
1163
d->mMapUnits = QgsUnitTypes::DistanceMeters;
1194
1164
else if ( unit == QLatin1String ( " Foot" ) )
1195
1165
d->mMapUnits = QgsUnitTypes::DistanceFeet;
1196
1166
else
1197
1167
{
1198
- QgsDebugMsg ( " Unsupported map units of " + unit );
1199
1168
d->mMapUnits = QgsUnitTypes::DistanceUnknownUnit;
1200
1169
}
1201
1170
}
@@ -1207,10 +1176,8 @@ void QgsCoordinateReferenceSystem::setMapUnits()
1207
1176
d->mMapUnits = QgsUnitTypes::DistanceDegrees;
1208
1177
else
1209
1178
{
1210
- QgsDebugMsg ( " Unsupported map units of " + unit );
1211
1179
d->mMapUnits = QgsUnitTypes::DistanceUnknownUnit;
1212
1180
}
1213
- QgsDebugMsgLevel ( " Projection has angular units of " + unit, 3 );
1214
1181
}
1215
1182
}
1216
1183
@@ -1258,19 +1225,13 @@ long QgsCoordinateReferenceSystem::findMatchingProj()
1258
1225
QString myProj4String = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 1 ) ) );
1259
1226
if ( toProj4 () == myProj4String.trimmed () )
1260
1227
{
1261
- QgsDebugMsg ( " -------> MATCH FOUND in srs.db srsid: " + mySrsId );
1262
1228
// close the sqlite3 statement
1263
1229
sqlite3_finalize ( myPreparedStatement );
1264
1230
sqlite3_close ( myDatabase );
1265
1231
return mySrsId.toLong ();
1266
1232
}
1267
- else
1268
- {
1269
- // QgsDebugMsg(QString(" Not matched : %1").arg(myProj4String));
1270
- }
1271
1233
}
1272
1234
}
1273
- QgsDebugMsg ( " no match found in srs.db, trying user db now!" );
1274
1235
// close the sqlite3 statement
1275
1236
sqlite3_finalize ( myPreparedStatement );
1276
1237
sqlite3_close ( myDatabase );
@@ -1297,19 +1258,13 @@ long QgsCoordinateReferenceSystem::findMatchingProj()
1297
1258
QString myProj4String = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 1 ) ) );
1298
1259
if ( toProj4 () == myProj4String.trimmed () )
1299
1260
{
1300
- QgsDebugMsg ( " -------> MATCH FOUND in user qgis.db srsid: " + mySrsId );
1301
1261
// close the sqlite3 statement
1302
1262
sqlite3_finalize ( myPreparedStatement );
1303
1263
sqlite3_close ( myDatabase );
1304
1264
return mySrsId.toLong ();
1305
1265
}
1306
- else
1307
- {
1308
- // QgsDebugMsg(QString(" Not matched : %1").arg(myProj4String));
1309
- }
1310
1266
}
1311
1267
}
1312
- QgsDebugMsg ( " no match found in user db" );
1313
1268
1314
1269
// close the sqlite3 statement
1315
1270
sqlite3_finalize ( myPreparedStatement );
@@ -1345,7 +1300,6 @@ QString QgsCoordinateReferenceSystem::toWkt() const
1345
1300
bool QgsCoordinateReferenceSystem::readXml ( const QDomNode & node )
1346
1301
{
1347
1302
d.detach ();
1348
- QgsDebugMsg ( " Reading Spatial Ref Sys from xml ------------------------!" );
1349
1303
bool result = true ;
1350
1304
QDomNode srsNode = node.namedItem ( QStringLiteral ( " spatialrefsys" ) );
1351
1305
@@ -1382,27 +1336,14 @@ bool QgsCoordinateReferenceSystem::readXml( const QDomNode & node )
1382
1336
}
1383
1337
}
1384
1338
}
1385
- else
1386
- {
1387
- QgsDebugMsg ( " Ignoring authid/epsg for user crs." );
1388
- }
1389
1339
1390
- if ( initialized )
1391
- {
1392
- QgsDebugMsg ( " Set from auth id" );
1393
- }
1394
- else
1340
+ if ( !initialized )
1395
1341
{
1396
1342
myNode = srsNode.namedItem ( QStringLiteral ( " proj4" ) );
1397
1343
1398
- if ( createFromProj4 ( myNode.toElement ().text () ) )
1344
+ if ( ! createFromProj4 ( myNode.toElement ().text () ) )
1399
1345
{
1400
- // createFromProj4() sets everything, including map units
1401
- QgsDebugMsg ( " Setting from proj4 string" );
1402
- }
1403
- else
1404
- {
1405
- QgsDebugMsg ( " Setting from elements one by one" );
1346
+ // Setting from elements one by one
1406
1347
1407
1348
myNode = srsNode.namedItem ( QStringLiteral ( " proj4" ) );
1408
1349
setProj4String ( myNode.toElement ().text () );
@@ -1529,10 +1470,6 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int srsId )
1529
1470
QString myProjString;
1530
1471
QString mySql = QStringLiteral ( " select parameters from tbl_srs where srs_id = %1 order by deprecated" ).arg ( srsId );
1531
1472
1532
- QgsDebugMsg ( " mySrsId = " + QString::number ( srsId ) );
1533
- QgsDebugMsg ( " USER_CRS_START_ID = " + QString::number ( USER_CRS_START_ID ) );
1534
- QgsDebugMsg ( " Selection sql : " + mySql );
1535
-
1536
1473
//
1537
1474
// Determine if this is a user projection or a system on
1538
1475
// user projection defs all have srs_id >= 100000
@@ -1552,7 +1489,6 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int srsId )
1552
1489
{
1553
1490
myDatabaseFileName = QgsApplication::srsDatabaseFilePath ();
1554
1491
}
1555
- QgsDebugMsg ( " db = " + myDatabaseFileName );
1556
1492
1557
1493
sqlite3 *db = nullptr ;
1558
1494
int rc;
@@ -1586,7 +1522,6 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int srsId )
1586
1522
1587
1523
int QgsCoordinateReferenceSystem::openDatabase ( const QString& path, sqlite3 **db, bool readonly )
1588
1524
{
1589
- QgsDebugMsgLevel ( " path = " + path, 3 );
1590
1525
int myResult = readonly
1591
1526
? sqlite3_open_v2 ( path.toUtf8 ().data (), db, SQLITE_OPEN_READONLY, nullptr )
1592
1527
: sqlite3_open ( path.toUtf8 ().data (), db );
@@ -1703,7 +1638,6 @@ bool QgsCoordinateReferenceSystem::saveAsUserCrs( const QString& name )
1703
1638
sqlite3_errmsg ( myDatabase ) ) );
1704
1639
return false ;
1705
1640
}
1706
- QgsDebugMsg ( QString ( " Update or insert sql \n %1" ).arg ( mySql ) );
1707
1641
myResult = sqlite3_prepare ( myDatabase, mySql.toUtf8 (), mySql.toUtf8 ().length (), &myPreparedStatement, &myTail );
1708
1642
1709
1643
qint64 return_id;
@@ -1988,7 +1922,6 @@ int QgsCoordinateReferenceSystem::syncDatabase()
1988
1922
else
1989
1923
{
1990
1924
updated++;
1991
- QgsDebugMsgLevel ( QString ( " SQL: %1\n OLD:%2\n NEW:%3" ).arg ( sql, srsProj4, proj4 ), 3 );
1992
1925
}
1993
1926
}
1994
1927
}
@@ -2104,7 +2037,6 @@ int QgsCoordinateReferenceSystem::syncDatabase()
2104
2037
if ( sqlite3_exec ( database, sql.toUtf8 (), nullptr , nullptr , &errMsg ) == SQLITE_OK )
2105
2038
{
2106
2039
updated++;
2107
- QgsDebugMsgLevel ( QString ( " SQL: %1\n OLD:%2\n NEW:%3" ).arg ( sql, params, proj4 ), 3 );
2108
2040
}
2109
2041
else
2110
2042
{
@@ -2253,9 +2185,6 @@ bool QgsCoordinateReferenceSystem::syncDatumTransform( const QString& dbPath )
2253
2185
2254
2186
insert = " INSERT INTO tbl_datum_transform(" + insert + " ) VALUES (" + values + ' )' ;
2255
2187
2256
- QgsDebugMsgLevel ( QString ( " insert:%1" ).arg ( insert ), 4 );
2257
- QgsDebugMsgLevel ( QString ( " update:%1" ).arg ( update ), 4 );
2258
-
2259
2188
CSLDestroy ( fieldnames );
2260
2189
2261
2190
Q_ASSERT ( idxid >= 0 );
0 commit comments