@@ -90,15 +90,15 @@ QgsQuantizedMeshMetadata::QgsQuantizedMeshMetadata(
90
90
QgsBlockingNetworkRequest request;
91
91
if ( !mAuthCfg .isEmpty () )
92
92
request.setAuthCfg ( mAuthCfg );
93
- auto respCode = request.get ( requestData );
93
+ const QgsBlockingNetworkRequest::ErrorCode respCode = request.get ( requestData );
94
94
if ( respCode != QgsBlockingNetworkRequest::ErrorCode::NoError )
95
95
{
96
96
error.append (
97
97
QObject::tr ( " Failed to retrieve quantized mesh tiles metadata: %1" )
98
98
.arg ( request.errorMessage ().data () ) );
99
99
return ;
100
100
}
101
- auto reply = request.reply ().content ();
101
+ const QByteArray reply = request.reply ().content ();
102
102
103
103
try
104
104
{
@@ -112,7 +112,7 @@ QgsQuantizedMeshMetadata::QgsQuantizedMeshMetadata(
112
112
return ;
113
113
}
114
114
115
- auto crsString = QString::fromStdString ( jsonGet<std::string>( replyJson, " projection" ) );
115
+ const QString crsString = QString::fromStdString ( jsonGet<std::string>( replyJson, " projection" ) );
116
116
mCrs = QgsCoordinateReferenceSystem ( crsString );
117
117
if ( !mCrs .isValid () )
118
118
{
@@ -135,12 +135,11 @@ QgsQuantizedMeshMetadata::QgsQuantizedMeshMetadata(
135
135
mExtent = mCrs .bounds ();
136
136
}
137
137
138
- auto zRange = dummyZRange;
139
138
mBoundingVolume =
140
139
QgsOrientedBox3D::fromBox3D (
141
140
QgsBox3D (
142
- mExtent .xMinimum (), mExtent .yMinimum (), zRange .lower (),
143
- mExtent .xMaximum (), mExtent .yMaximum (), zRange .upper () ) );
141
+ mExtent .xMinimum (), mExtent .yMinimum (), dummyZRange .lower (),
142
+ mExtent .xMaximum (), mExtent .yMaximum (), dummyZRange .upper () ) );
144
143
145
144
// The TileJSON spec uses "scheme", but some real-world datasets use "schema"
146
145
if ( replyJson.find ( " scheme" ) != replyJson.end () )
@@ -190,7 +189,7 @@ QgsQuantizedMeshMetadata::QgsQuantizedMeshMetadata(
190
189
191
190
QgsCoordinateReferenceSystem wgs84 ( QStringLiteral ( " EPSG:4326" ) );
192
191
// Bounds of tile schema in projected coordinates
193
- auto crsBounds =
192
+ const QgsRectangle crsBounds =
194
193
QgsCoordinateTransform ( wgs84, mCrs , transformContext )
195
194
.transform ( mCrs .bounds () );
196
195
QgsPointXY topLeft ( crsBounds.xMinimum (), crsBounds.yMaximum () );
@@ -228,7 +227,7 @@ bool QgsQuantizedMeshMetadata::containsTile( QgsTileXYZ tile ) const
228
227
// be given in TMS-style
229
228
if ( mTileScheme == QLatin1String ( " tms" ) )
230
229
tile = tileToTms ( tile );
231
- for ( auto &range : mAvailableTiles [tile.zoomLevel ()] )
230
+ for ( const QgsTileRange &range : mAvailableTiles [tile.zoomLevel ()] )
232
231
{
233
232
if ( range.startColumn () <= tile.column () && range.endColumn () >= tile.column () &&
234
233
range.startRow () <= tile.row () && range.endRow () >= tile.row () )
@@ -273,8 +272,8 @@ QgsTileXYZ QgsQuantizedMeshIndex::decodeTileId( long long id )
273
272
QgsTiledSceneTile QgsQuantizedMeshIndex::rootTile () const
274
273
{
275
274
// Returns virtual tile to paper over tiling schemes which have >1 tile at zoom 0
276
- auto tile = QgsTiledSceneTile ( ROOT_TILE_ID );
277
- auto bounds = mWgs84ToCrs .transform ( mMetadata .mCrs .bounds () );
275
+ QgsTiledSceneTile tile = QgsTiledSceneTile ( ROOT_TILE_ID );
276
+ const QgsRectangle bounds = mWgs84ToCrs .transform ( mMetadata .mCrs .bounds () );
278
277
tile.setBoundingVolume (
279
278
QgsOrientedBox3D::fromBox3D (
280
279
QgsBox3D ( bounds, mMetadata .dummyZRange .lower (), mMetadata .dummyZRange .upper () ) ) );
@@ -285,16 +284,18 @@ long long QgsQuantizedMeshIndex::parentTileId( long long id ) const
285
284
{
286
285
if ( id == ROOT_TILE_ID )
287
286
return -1 ;
288
- auto tile = decodeTileId ( id );
287
+ const QgsTileXYZ tile = decodeTileId ( id );
289
288
if ( tile.zoomLevel () == 0 )
290
289
return ROOT_TILE_ID;
291
290
return encodeTileId ( {tile.zoomLevel () - 1 , tile.column () / 2 , tile.row () / 2 } );
292
291
}
293
292
QVector<long long > QgsQuantizedMeshIndex::childTileIds ( long long id ) const
294
293
{
295
- auto tile = decodeTileId ( id );
294
+ const QgsTileXYZ tile = decodeTileId ( id );
296
295
QVector<long long > children;
297
- auto x = tile.column (), y = tile.row (), zoom = tile.zoomLevel ();
296
+ const int x = tile.column ();
297
+ const int y = tile.row ();
298
+ const int zoom = tile.zoomLevel ();
298
299
299
300
if ( mMetadata .containsTile ( {x * 2 , y * 2 , zoom + 1 } ) )
300
301
children.push_back ( encodeTileId ( {x * 2 , y * 2 , zoom + 1 } ) );
@@ -309,11 +310,11 @@ QVector<long long> QgsQuantizedMeshIndex::childTileIds( long long id ) const
309
310
}
310
311
QgsTiledSceneTile QgsQuantizedMeshIndex::getTile ( long long id )
311
312
{
312
- auto xyzTile = decodeTileId ( id );
313
+ QgsTileXYZ xyzTile = decodeTileId ( id );
313
314
QgsTiledSceneTile sceneTile ( id );
314
315
315
- auto zoomedMatrix = QgsTileMatrix::fromTileMatrix ( xyzTile.zoomLevel (), mMetadata .mTileMatrix );
316
- auto tileExtent = zoomedMatrix.tileExtent ( xyzTile );
316
+ const QgsTileMatrix zoomedMatrix = QgsTileMatrix::fromTileMatrix ( xyzTile.zoomLevel (), mMetadata .mTileMatrix );
317
+ const QgsRectangle tileExtent = zoomedMatrix.tileExtent ( xyzTile );
317
318
318
319
sceneTile.setBoundingVolume (
319
320
QgsOrientedBox3D::fromBox3D (
@@ -334,8 +335,8 @@ QgsTiledSceneTile QgsQuantizedMeshIndex::getTile( long long id )
334
335
else
335
336
{
336
337
// TODO: Intelligently choose from alternatives. Round robin?
337
- auto tileUri = QgsVectorTileUtils::formatXYZUrlTemplate (
338
- mMetadata .mTileUrls [0 ], xyzTile, zoomedMatrix );
338
+ const QString tileUri = QgsVectorTileUtils::formatXYZUrlTemplate (
339
+ mMetadata .mTileUrls [0 ], xyzTile, zoomedMatrix );
339
340
sceneTile.setResources ( {{" content" , tileUri}} );
340
341
sceneTile.setMetadata (
341
342
{
@@ -365,25 +366,25 @@ QgsQuantizedMeshIndex::getTiles( const QgsTiledSceneRequest &request )
365
366
mMetadata .geometricErrorAtZoom ( zoomLevel ) > request.requiredGeometricError () )
366
367
zoomLevel++;
367
368
}
368
- auto tileMatrix = QgsTileMatrix::fromTileMatrix ( zoomLevel, mMetadata .mTileMatrix );
369
+ const QgsTileMatrix tileMatrix = QgsTileMatrix::fromTileMatrix ( zoomLevel, mMetadata .mTileMatrix );
369
370
370
371
QVector<long long > ids;
371
372
// We can only filter on X and Y
372
- auto extent = request.filterBox ().extent ().toRectangle ();
373
+ const QgsRectangle extent = request.filterBox ().extent ().toRectangle ();
373
374
if ( request.parentTileId () != -1 )
374
375
{
375
- auto parentTile = decodeTileId ( request.parentTileId () );
376
+ const QgsTileXYZ parentTile = decodeTileId ( request.parentTileId () );
376
377
extent.intersect ( tileMatrix.tileExtent ( parentTile ) );
377
378
}
378
379
379
- auto tileRange = tileMatrix.tileRangeFromExtent ( extent );
380
+ const QgsTileRange tileRange = tileMatrix.tileRangeFromExtent ( extent );
380
381
if ( !tileRange.isValid () )
381
382
return {};
382
383
383
384
for ( int col = tileRange.startColumn (); col <= tileRange.endColumn (); col++ )
384
385
for ( int row = tileRange.startRow (); row <= tileRange.endRow (); row++ )
385
386
{
386
- auto xyzTile = QgsTileXYZ ( col, row, zoomLevel );
387
+ const QgsTileXYZ xyzTile = QgsTileXYZ ( col, row, zoomLevel );
387
388
if ( mMetadata .containsTile ( xyzTile ) )
388
389
ids.push_back ( encodeTileId ( xyzTile ) );
389
390
}
@@ -393,7 +394,7 @@ QgsQuantizedMeshIndex::getTiles( const QgsTiledSceneRequest &request )
393
394
Qgis::TileChildrenAvailability
394
395
QgsQuantizedMeshIndex::childAvailability ( long long id ) const
395
396
{
396
- auto childIds = childTileIds ( id );
397
+ const QVector< long long > childIds = childTileIds ( id );
397
398
if ( childIds.count () == 0 )
398
399
return Qgis::TileChildrenAvailability::NoChildren;
399
400
return Qgis::TileChildrenAvailability::Available;
0 commit comments