Skip to content

Add input validation for coordinates, dates, and parameters#82

Open
mihiarc wants to merge 2 commits intotaraskiba:mainfrom
mihiarc:feature/input-validation
Open

Add input validation for coordinates, dates, and parameters#82
mihiarc wants to merge 2 commits intotaraskiba:mainfrom
mihiarc:feature/input-validation

Conversation

@mihiarc
Copy link
Contributor

@mihiarc mihiarc commented Feb 2, 2026

Summary

  • Add validate_coordinates() function to check latitude/longitude bounds (-90 to 90, -180 to 180) and detect missing values
  • Add validate_date_range() function to ensure start date is before or equal to end date
  • Add validate_buffer_radius() function to check for positive values and warn on radii > 1 mile
  • Add validate_sample_count() function to check for positive integers and warn on counts > 100
  • Integrate validation in all extraction modules (point_extraction.py, aggregated_point_extraction.py, buffer_method.py, buffer_and_sample.py, geojson_buffering.py) before processing

Test plan

  • Verified all validation functions work correctly with test cases
  • Verified all modules import successfully with new validation
  • Test with invalid coordinates (lat > 90, lon > 180)
  • Test with invalid date ranges (start > end)
  • Test with invalid buffer radius (negative, very large)
  • Test with invalid sample count (negative, very large)

Fixes #78

🤖 Generated with Claude Code

mihiarc and others added 2 commits February 2, 2026 11:52
- Add validate_coordinates() to check lat/lon bounds and missing values
- Add validate_date_range() to ensure start_date <= end_date
- Add validate_buffer_radius() to check positive values and warn on large radii
- Add validate_sample_count() to check positive integers and warn on large counts
- Integrate validation in all extraction modules before processing

Fixes taraskiba#78

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@taraskiba taraskiba self-requested a review February 3, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add input validation for coordinates, dates, and parameters

1 participant