geohashTools
geohashTools copied to clipboard
Phase 1: Quick Fixes and Improvements
Summary
This PR implements Phase 1 improvements focusing on documentation fixes, code quality enhancements, and minor optimizations.
Changes
Documentation
- ✅ Fixed
gh_encode.Rdprecision limit (was incorrectly stated as 28, corrected to 25)
Code Quality
-
✅ Added bounds checking to
gh_deltato 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, andgh_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
- Changed from double-scan (
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