Skip to content

Commit

Permalink
fix validator
Browse files Browse the repository at this point in the history
  • Loading branch information
ckuethe committed Jun 18, 2024
1 parent 3f12cdd commit d3aaea6
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/track_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,16 @@ def _geobox(s) -> GeoBox:
raise ValueError

def _geocircle(s) -> GeoCircle:
try:
rv = [float(f) for f in s.split(",")]
if (
True
and (3 == len(rv))
and (-90 <= rv[0] <= 90)
and (-180 <= rv[1] <= 180)
and (0 < rv[2] <= 40030e3) # 3.1416 * 2 * 6371km
):
return GeoCircle(*rv)
except Exception:
pass
finally:
raise ValueError
rv = [float(f) for f in s.split(",")]
if (
True
and (3 == len(rv))
and (-90 <= rv[0] <= 90)
and (-180 <= rv[1] <= 180)
and (0 < rv[2] <= 40030e3) # 3.1416 * 2 * 6371km
):
return GeoCircle(*rv)
raise ValueError

ap = ArgumentParser(description="Edit a Radiacode track by clipping to (or out) time ranges and geometries.")
ap.add_argument( # -t include-time-range
Expand Down

0 comments on commit d3aaea6

Please sign in to comment.