Usage¶
From python¶
If your input is a las file, you can use the
jakteristics.las_utils.read_las_xyz()
function to read the xyz coordinates
from your input file as a numpy array.
If your input is already a numpy array, you can use the jakteristics.compute_features()
directly. By default, every geometry feature will be computed. In a future version,
the :py:arg:`feature_names` argument will be required.
Once you have the features, you can use them like any numpy array, or write them
to a las file using jakteristics.write_with_extra_dims()
.
Example:
from jakteristics import las_utils, compute_features, FEATURE_NAMES
input_path = "/path/to/a/las_file.las"
xyz = las_utils.read_las_xyz(input_path)
features = compute_features(xyz, search_radius=0.15, feature_names=FEATURE_NAMES)
output_path = "/path/to/output_file.las"
las_utils.write_with_extra_dims(input_path, output_path, features, FEATURE_NAMES)
# or for a specific feature:
omnivariance = compute_features(xyz, search_radius=0.15, feature_names=["omnivariance"])
output_omnivariance = "/path/to/output_omnivariance.las"
las_utils.write_with_extra_dims(input_path, output_omnivariance, omnivariance, ["omnivariance"])
If you want to to all of these steps (read a las file, compute certain features and write it back to disk), you can use the command line:
jakteristics input/las/file.las output/file.las --search-radius 0.15 --num-threads 4
CLI¶
jakteristics¶
jakteristics [OPTIONS] LAS_INPUT OUTPUT
Options
- -s, --search-radius <search_radius>¶
Required The search radius to use to query neighbors.
- -t, --num-threads <num_threads>¶
The number of threads to use for computation. Defaults to the number of cpu on the machine.
- Default
-1
- -f, --feature <feature_names>¶
The feature names to compute. Repeat this parameter to compute multiple features. Use –show-features to see the list of possible choices. Default: All features.
- Default
eigenvalue_sum, omnivariance, eigenentropy, anisotropy, planarity, linearity, PCA1, PCA2, surface_variation, sphericity, verticality, nx, ny, nz, number_of_neighbors, eigenvalue1, eigenvalue2, eigenvalue3, eigenvector1x, eigenvector1y, eigenvector1z, eigenvector2x, eigenvector2y, eigenvector2z, eigenvector3x, eigenvector3y, eigenvector3z
- -m, --manhattan-distance¶
How to compute the distance between 2 points. If provided, the sum-of-absolute-values is used (‘Manhattan’ distance).By default, the standard Euclidean distance is used.
- Default
False
- -e, --eps <eps>¶
Return approximate nearest neighbors; the k-th returned value is guaranteed to be no further than (1+eps) times the distance to the real k-th nearest neighbor.
- Default
0
- --show-features¶
Show a list of possible feature names and exit.
- --install-completion <install_completion>¶
Install completion for the specified shell.
- Options
bash | zsh | fish | powershell | pwsh
- --show-completion <show_completion>¶
Show completion for the specified shell, to copy it or customize the installation.
- Options
bash | zsh | fish | powershell | pwsh
Arguments
- LAS_INPUT¶
Required argument
- OUTPUT¶
Required argument