Skip to content

Add support for a vpc-in-zip (.vpz) virtual point cloud format#65334

Open
uclaros wants to merge 6 commits intoqgis:masterfrom
uclaros:vpz
Open

Add support for a vpc-in-zip (.vpz) virtual point cloud format#65334
uclaros wants to merge 6 commits intoqgis:masterfrom
uclaros:vpz

Conversation

@uclaros
Copy link
Copy Markdown
Contributor

@uclaros uclaros commented Mar 11, 2026

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 .vpc files, the need for a smaller file size is more apparent.

This PR adds a .vpz format with a zipped .vpc, similar to how we have .qgz with a .qgs inside.

Support for writing those files in pdal_wrench is pending: PDAL/wrench#84

AI tool usage

  • AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.

@uclaros uclaros added Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting Point Clouds labels Mar 11, 2026
@github-actions github-actions bot added the Processing Relating to QGIS Processing framework or individual Processing algorithms label Mar 11, 2026
@github-actions github-actions bot added this to the 4.2.0 milestone Mar 11, 2026
@qgis-bot
Copy link
Copy Markdown
Collaborator

@uclaros
This pull request has been tagged as requiring documentation.

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.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Copy Markdown
Collaborator

@uclaros

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2026

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 80d6694)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit 80d6694)

}

if ( outputName.endsWith( ".vpc"_L1 ) )
if ( outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) || outputName.endsWith( ".vpc"_L1, Qt::CaseInsensitive ) )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ) )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

Comment on lines +498 to +510
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 );
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog Items that are queued to appear in the visual changelog - remove after harvesting Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Point Clouds Processing Relating to QGIS Processing framework or individual Processing algorithms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants