Recent Releases of spanner

spanner - v 1.0.4

1.0.4
Fixed non-API call to R (R_UnboundValue) in compiled code (flagged by CRAN r-devel checks on Linux and Windows).
Fixed create_rotation_gif() example to use if (interactive()) inside \donttest{} so they are skipped on headless CI environments.
1.0.3
Replaced bare Rf_error() call in src/backports.h with the parenthesized form (Rf_error)(...) to avoid interception by future Rcpp macro wrapping (see https://github.com/RcppCore/Rcpp/issues/1247).

Biosphere - Forest Modeling and Analysis - C++
Published by bi0m3trics about 2 months ago

spanner - v1.0.2 release on CRAN

spanner 1.0.2

This release corresponds to the CRAN release of spanner 1.2.0.

  • Added screen_size parameter to create_rotation_gif() to allow custom window dimensions (e.g., c(800, 600) or c(1920, 1080))

  • Added colorize_las() function with four coloring methods: attr (attribute-based), rgb (raster extraction), pcv (true 3D ambient occlusion), and ssao (fast screen-space ambient occlusion)

  • Added download_naip_for_las() function to automatically download NAIP imagery from Microsoft Planetary Computer STAC API

  • Added C++ implementations with OpenMP parallelization for PCV and SSAO ambient occlusion methods

  • Expanded comprehensive test suite for all new functionality

  • Removed deprecated sp and raster package dependencies for CRAN compliance

  • Replaced all grid_metrics() calls with pixel_metrics() for native terra support

  • Updated CRS handling to use sf::st_crs() throughout codebase

  • Fixed documentation examples to include proper namespace prefixes and run without deprecated packages

    • Includes edge case testing and error handling validation
    • Test suite designed for CRAN compliance (uses skip_on_cran() for intensive tests)
  • Bug fixes:

    • Fixed segment_graph() scientific notation issue where large point indices (e.g., 800000) were converted to strings like '8e+05' by cppRouting::makegraph(), causing "not all nodes are in the graph" errors. Now explicitly formats indices without scientific notation.
    • Fixed segment_graph() null pointer error when no trees detected
    • Replaced 1:nrow() with seq_len(nrow()) to prevent zero-length errors
    • Added early return when tree.locations is NULL or empty

Previous Changes in 1.0.2

  • New eigen metrics added (to match CloudCompare)
    • Roughness: Distance from query point to fitted plane through neighborhood centroid
    • Mean Curvature: Differential geometry-based curvature using quadric surface fitting
    • Gaussian Curvature: Product of principal curvatures from quadric surface
    • PCA1: Eigenvector projection variance normalized by eigensum
    • PCA2: Second eigenvector projection variance normalized by eigensum
    • NumNeighbors: Count of points in sphere neighborhood
  • Code optimization and cleanup:
    • Removed 20+ unused C++ exports to streamline the package interface
    • Fixed namespace issues by removing ::: calls in internal code
    • Reduced exported C++ functions to only those actively used (C_eigen_in_sphere, C_count_in_disc, C_count_in_sphere, cppCylinderFit)
    • Removed lidR from Imports field (kept in Depends and LinkingTo only)
  • Updated documentation examples:
    • Fixed examples to use sf::st_coordinates() with proper namespace qualification
    • Updated get_raster_eigen_treelocs() examples with optimized parameters for better tree detection in forests with interlocking crowns (res=0.25, dens_threshold=0.25, eigen_threshold=0.75, minimum_polygon_area=0.005)
    • Corrected circle area formula in plotting examples (Radius^2*3.14)
  • Bug fixes - replaced null checks with is.empty for LAS objects and stopped R from collapsing the one-row subset into a vector, so the circle fit still receives a 2-column input when there's on one tree in get_raster_eigen_treelocs.
  • Removed depends on magrittr and removed all %>% in codebase
  • Added process_tree_data funciton that takes the output of get_raster_eigen_treelocs and segment_graph to adds information about the height, crown area and volume, and diameter for each unique TreeID. It also has an optional parameter to return either points or hulls as an sf object for each tree.
  • Added the citation for the package
  • Added a couple default datasets and got rid of getExampleData()
  • Added the xyz normals as returns for eigen_metrics()
  • Added PatchMorph functions:
    • process_rasters_patchmorph: Processes an input raster by reclassifying it based on suitability levels and applying gap and spur distance transformations to generate a list of processed rasters.
    • plot_raster_by_name: Plots a raster from a list of rasters based on the provided raster name.
    • sum_rasters_by_suitability: Sums rasters from a list based on their suitability levels and returns a list of summed rasters for each suitability level.
  • Added dependencies fopr sf and terra
  • Modified get_raster_eigen_treelocs and segment_graph to use sf and not write any intermediate files to optput locations with parallel processing to make sure that all possible operations use
    • the available CPU cores
      *efficient data structures; used lapply for list operations and dplyr::bind_rows for combining data frames.
      *reduce redundant ralculations; stored intermediate results and reused them where possible.
      *removed unnecessary objects and used more efficient data structures.
  • Added spanner_pal() which is a custom color palette

Biosphere - Forest Modeling and Analysis - C++
Published by bi0m3trics 4 months ago

spanner - v1.0.2

Major Changes:

  • CRAN compliance improvements - Multiple fixes to pass CRAN package checks including documentation updates and code adjustments
  • Bug fixes - Fixed edge cases in raster eigen tree location processing, tree ID matching issues on large/dense scans, and various other bugs
  • New features and functions:
    • Added patch morphology processing capabilities
    • Enhanced tree location post-processing functions
    • Added CloudCompare-compatible metrics
    • New utility functions for plotting, color palettes, and data processing
  • Code modernization - Removed pipe operators (%>%), updated to C++17 compiler standard for Windows
  • Documentation enhancements - Updated/added help files, improved README, updated NEWS.md
  • Example data added - Included sample LiDAR point clouds (.laz files) and raster data (.tif)
  • Infrastructure updates:
    • Added GitHub Actions workflow (rhub.yaml)
    • Added CITATION file
    • Updated .gitignore
  • Function cleanup - Removed deprecated getExampleData function and some C++ exports
  • Visual assets - Added multiple images for documentation and branding

Overall: 1,589 lines added, 632 lines removed across 46 files

Biosphere - Forest Modeling and Analysis - C++
Published by bi0m3trics 5 months ago

spanner - v1.0.1

Biosphere - Forest Modeling and Analysis - C++
Published by bi0m3trics over 4 years ago

spanner - v1.0.0

Manuscript version release
DOI

Biosphere - Forest Modeling and Analysis - C++
Published by bi0m3trics about 5 years ago