geohashTools icon indicating copy to clipboard operation
geohashTools copied to clipboard

Phase 1: Quick Fixes and Improvements

Open dshkol opened this issue 5 months ago • 0 comments

Summary

This PR implements Phase 1 improvements focusing on documentation fixes, code quality enhancements, and minor optimizations.

Changes

Documentation

  • ✅ Fixed gh_encode.Rd precision limit (was incorrectly stated as 28, corrected to 25)

Code Quality

  • ✅ Added bounds checking to gh_delta to validate precision is between 0 and 25

    • Prevents silent incorrect results for invalid inputs
    • Added comprehensive tests for edge cases
  • ✅ Updated CRS specification from deprecated PROJ.4 string to EPSG:4326

    • Better compatibility with modern PROJ versions
    • Updated all tests to use new format

Performance

  • ✅ Optimized duplicate detection in gh_to_sp, gh_to_spdf.default, and gh_to_spdf.data.frame
    • Changed from double-scan (anyDuplicated + duplicated) to single-pass
    • Improves performance ~2x when duplicates are present
    • No change in behavior or API

Testing

  • ✅ Updated tests for testthat edition 3 compatibility
  • ✅ All 125 tests passing, 0 failures, 0 warnings
  • ✅ No breaking changes

Testing

devtools::test()
# [ FAIL 0 | WARN 0 | SKIP 0 | PASS 125 ]

Next Steps

This is part of a series of performance improvement PRs. Upcoming phases:

  • Phase 2: gh_covering grid generation optimization (6-25× speedup expected)
  • Phase 3: CI/CD modernization (GitHub Actions)

🤖 Generated with Claude Code

dshkol avatar Nov 11 '25 05:11 dshkol