Compare commits

...

2 Commits

2 changed files with 11 additions and 1 deletions

View File

@ -70,12 +70,15 @@ void QgsCopcPointCloudIndex::load( const QString &urlString )
return; return;
} }
} }
mUri = urlString;
if ( mAccessType == Qgis::PointCloudAccessType::Remote ) if ( mAccessType == Qgis::PointCloudAccessType::Remote )
mLazInfo.reset( new QgsLazInfo( QgsLazInfo::fromUrl( url ) ) ); mLazInfo.reset( new QgsLazInfo( QgsLazInfo::fromUrl( url ) ) );
else else
mLazInfo.reset( new QgsLazInfo( QgsLazInfo::fromFile( mCopcFile ) ) ); mLazInfo.reset( new QgsLazInfo( QgsLazInfo::fromFile( mCopcFile ) ) );
// now store the uri as it might have been updated due to redirects
mUri = url.toString();
mIsValid = mLazInfo->isValid(); mIsValid = mLazInfo->isValid();
if ( mIsValid ) if ( mIsValid )
{ {

View File

@ -327,6 +327,13 @@ QgsLazInfo QgsLazInfo::fromUrl( QUrl &url )
QByteArray lazHeaderData = reply.content(); QByteArray lazHeaderData = reply.content();
lazInfo.parseRawHeader( lazHeaderData.data(), lazHeaderData.size() ); lazInfo.parseRawHeader( lazHeaderData.data(), lazHeaderData.size() );
// If request was redirected, let's update our url for all next calls
const QUrl requestedUrl = reply.request().url();
if ( requestedUrl != url )
{
url.setUrl( requestedUrl.toString() );
}
} }
// Fetch VLR data // Fetch VLR data