Changelog
Source:NEWS.md
geomattR 0.3.1
CRAN resubmission. No user-visible changes to package functionality.
- The parallel-processing example in
calculate_geometric_attributes()is now wrapped in\donttest{}instead of\dontrun{}, and operates on two features so that the cluster code path is genuinely exercised. - All examples and vignette code now use at most two cluster workers. The vignette no longer derives a worker count from
parallel::detectCores().
geomattR 0.3.0
Accuracy improvements for geodesic workflows. Values of reock, elongation_rectangle and maxlength may change for lon/lat input, especially at high latitudes:
- The minimum enclosing circle (
reock) and minimum bounding rectangle (elongation_rectangle) are now computed in a local Lambert azimuthal equal-area projection centred on each feature, instead of in raw lon/lat degrees. GEOS hull constructions are planar, so minimizing in degree space distorted the “minimum” geometry wherever a degree of longitude is shorter than a degree of latitude. The hull is measured back in the input’s CRS. -
maxlength(and thedistance/bearingoutputs ofget_distant_points()) are now found by evaluating all convex-hull vertex pairs geodesically in a single vectorisedterra::distance()call. The previous rotating-calipers candidate search operated in planar coordinate space and could miss the true geodesic maximum. The internal rotating-calipers helper was removed.
Performance and packaging:
-
calculate_geometric_attributes()gains a vectorised fast path when onlyarea,perimeter,decimallongitudeand/ordecimallatitudeare requested: terra’s multi-feature methods are called once instead of looping per feature. - The
by_featurebranches ofcalc_extent(),calc_elongation()andget_distant_points()no longer compute (and discard) the convex hull of the entire input set. -
NAMESPACEnow uses targetedimportFrom()declarations instead of blanketimport(terra)/import(methods); the two previously unqualifiedsubset()/aggregate()calls are nowterra::-qualified.
geomattR 0.2.0
Breaking changes to documented metric contracts:
-
bearingis now documented as an axial orientation in [-90, 90] degrees: the maximum-length line is always oriented from its southernmost to its northernmost endpoint, so values outside that range were unreachable. 0 = north-south axis, -90/90 = east-west axis. Computed values are unchanged. -
northerness = cos(bearing)is now documented to range in [0, 1]; negative values were unreachable. -
fractaldimensionnow follows the FRAGSTATS convention2 * log(0.25 * P) / log(A)(McGarigal & Marks 1995, doi:10.2737/PNW-GTR-351). Values change relative to the previous2 * log(P) / log(A), which could fall outside [1, 2] for small polygons. -
hole_area_pctnow uses the gross area (including holes) as denominator, matching its documentation. Values change relative to the previous net-area denominator. -
decimallongitude/decimallatitudeare now always in decimal degrees: the centroid is reprojected to EPSG:4326 when the input CRS is projected. Previously,method = "cosine"on a projected CRS returned metres under these column names.
Other fixes and improvements:
- Documentation no longer describes
method = "cosine"as “for planar CRS”.geo,haversineandcosineare all lon/lat great-circle methods interra::distance(); on a projected CRS the argument is ignored and distances are Cartesian. -
calc_elongation()computes rectangle side lengths explicitly from the unique corners in ring order, instead of relying on undocumented ordering ofterra::crds()output, and returnsInffor degenerate (zero-width) rectangles instead of failing or dividing by zero. - Removed the no-op
transformargument passed toterra::expanse(); area is geodesic on lon/lat input and Cartesian on projected input. -
num_holesis counted from theholecolumn ofterra::geom()instead oflength()on thefillHoles()result;num_polygonsusesnrow(). - New input validation: clear error for zero-row inputs, warning for invalid geometries, and a warning when a hull spans more than 180 degrees of longitude (antimeridian), where bounding-box extents are unreliable.
geomattR 0.1.2
- Fixed
"subscript out of bounds"error incalc_extent(direction = <single>, output = "polygon", by_feature = TRUE). - Added R CMD check continuous integration via GitHub Actions.
- Declared
parallelinImports(used bycalculate_geometric_attributes()). -
inst/CITATIONnow uses the installed package version instead of a hardcoded one.