Skip to content

Conversation

@iamsaswata
Copy link
Owner

Summary

Fixes critical logic bug in latitude/longitude validation by changing and to or in coordinate range checks.

Problem

The validation logic at lines 108 and 111 used and operator:

if lat > max(self.lat_array) and lat < min(self.lat_array):

This condition can never be true because a value cannot be both greater than max AND less than min simultaneously.

Solution

Changed to or operator:

if lat > max(self.lat_array) or lat < min(self.lat_array):

Changes

  • Line 108: andor for latitude validation
  • Line 111: andor for longitude validation

Changed 'and' to 'or' in latitude and longitude validation checks.
The previous logic (lines 108 and 111) could never trigger because a
value cannot be both greater than max AND less than min simultaneously.

Fixed:
- Line 108: lat > max AND lat < min  →  lat > max OR lat < min
- Line 111: lon > max AND lon < min  →  lon > max OR lon < min

This critical bug allowed invalid coordinates to pass validation.
Now the validation correctly rejects coordinates outside the valid range.
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.

2 participants