write
Description
write(
writes the blocked point cloud data bpc
,destination
)bpc
to the location specified by
destination
.
write(
specifies additional options for writing the blocked point cloud data using name-value
arguments.bpc
,destination
,Name=Value
)
Examples
Downsample Point Cloud Data and Write
Create a full file path for a LAZ file that contains aerial lidar data.
pcfile = fullfile(toolboxdir("lidar"),"lidardata", ... "las","aerialLidarData.laz");
Create pcdownsample
function handle.
fun = @(block)pcdownsample(block.Data,random=0.1);
Create blockedPointCloud
object using the LAZ file.
bpc = blockedPointCloud(pcfile,[50 50]);
Process each block of the aerial point cloud data using the specified pcdownsample
function handle.
pcdown = apply(bpc,fun);
Write the downsampled data to a specified destination.
write(pcdown,"aerial")
Create a new blockedPointCloud
from the output and display its properties.
bpc2 = blockedPointCloud("aerial/");
disp(bpc2)
blockedPointCloud with properties: Read-only properties. Source: "/tmp/Bdoc24b_2725827_1669037/tpa4cc45e3/lidar-ex50165705/aerial" Adapter: [1x1 lidar.blocked.LASBlocks] SizeInBlocks: [9 6 1] XLimits: [4.2975e+05 4.3015e+05] YLimits: [3.6798e+06 3.6801e+06] ZLimits: [79.2600 124.9100] ClassUnderlying: "pointCloud" Settable properties BlockSize: [44.4722 47.2250 45.6500]
Input Arguments
bpc
— Blocked point cloud
blockedPointCloud
object
Blocked point cloud, specified as a blockedPointCloud
object.
destination
— Location to write data
character vector | string scalar
Location to write data, specified as a character vector or string scalar. If you do
not specify a full file or folder path, this function creates a folder specified by
destination
in the present working directory and writes the data in
the created folder.
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: write(bpc,destination,DisplayWaitbar=true)
displays a wait
bar for operations with long run times.
Adapter
— Adapter used for writing blocked point cloud data
adapter object
DisplayWaitbar
— Wait bar visualization
true
or 1
(default) | false
or 0
Wait bar visualization, specified as a logical 1
(true
) or 0
(false
). When
set to true
, the apply
object function displays
a wait bar operations with long run times. If you cancel the wait bar, the
apply
object function returns partial output, if
available.
Data Types: logical
Version History
Introduced in R2022a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)