Skip to content

Commit

Permalink
Explicitly get the index from the provider, explicitly call template …
Browse files Browse the repository at this point in the history
…for doubles
  • Loading branch information
uclaros authored and wonder-sk committed Jan 10, 2025
1 parent d989f59 commit ac77049
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/pointcloud/qgspointcloudeditingindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@


QgsPointCloudEditingIndex::QgsPointCloudEditingIndex( QgsPointCloudLayer *layer )
: mIndex( layer ? layer->index() : QgsPointCloudIndex() )
{
if ( !layer ||
!layer->dataProvider() ||
!layer->dataProvider()->hasValidIndex() ||
!( layer->dataProvider()->capabilities() & QgsPointCloudDataProvider::Capability::ChangeAttributeValues ) )
return;

mIndex = layer->dataProvider()->index();

mAttributes = mIndex.attributes();
mScale = mIndex.scale();
mOffset = mIndex.offset();
Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointcloudlayereditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool QgsPointCloudLayerEditUtils::changeAttributeValue( const QgsPointCloudNodeI
for ( int i : sortedPoints )
{
// replace attribute for selected point
lazStoreToStream_( ptr, i * recordSize + attributeOffset, attribute.type(), value );
lazStoreToStream_<double>( ptr, i * recordSize + attributeOffset, attribute.type(), value );
}

return mIndex.updateNodeData( {{n, data}} );;
Expand Down

0 comments on commit ac77049

Please sign in to comment.