Add support for a vpc-in-zip (.vpz) virtual point cloud format#65334
Add support for a vpc-in-zip (.vpz) virtual point cloud format#65334uclaros wants to merge 6 commits intoqgis:masterfrom
Conversation
|
@uclaros A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
|
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
| } | ||
|
|
||
| if ( outputName.endsWith( ".vpc"_L1 ) ) | ||
| if ( outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) || outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) ) |
There was a problem hiding this comment.
| if ( outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) || outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) ) | |
| if ( outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) || outputName.endsWith( ".vpz"_L1, Qt::CaseInsensitive ) ) |
| const QDir dir( tmpDir->path() ); | ||
| for ( const QString &f : std::as_const( fileList ) ) | ||
| { | ||
| if ( f.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) ) | ||
| { | ||
| if ( !readFromFilename.isEmpty() ) | ||
| { | ||
| appendError( QgsErrorMessage( u"VPZ file contains multiple VPCs"_s ) ); | ||
| return {}; | ||
| } | ||
| readFromFilename = dir.filePath( f ); | ||
| } | ||
| } |
There was a problem hiding this comment.
Should we care if there are multiple VPCs in the file? Can we not just grab first and return early? We are only reading the ZIP and are not error detecting/correcting. I believe other software also just use the first file that has the correct extension in similar situations.
No strong opinion.
However, if you'd still prefer to have the check instead of an early return, consider something like this instead of the loop:
const QStringList vpcFiles = dir.entryList( QStringList( "*.vpc" ), QDir::Files );
if ( vpcFiles.isEmpty() )
...
else if ( vpcFiles.size() > 1 )
...
readFromFilename = dir.filePath( vpcFiles.first() );
There was a problem hiding this comment.
I prefer not to use the first vpc in case there are multiple, as that may not be obvious to the user that only a single vpc is being used.
I updated to use the suggested QDir::entryList :)
Description
VPC files can become quite big and the ascii json format does not really help keeping the size down.
Now that we have support for reading remote
.vpcfiles, the need for a smaller file size is more apparent.This PR adds a
.vpzformat with a zipped.vpc, similar to how we have.qgzwith a.qgsinside.Support for writing those files in
pdal_wrenchis pending: PDAL/wrench#84AI tool usage