# HG changeset patch # User David Barts # Date 1629906336 25200 # Node ID a56d3d3b5efddeb8f6c61ff50aafacc93b0cfe53 # Parent 290b0b2a584bc10fe20fd64bf7d05413b4a04d99 Reject out of range latitide and longitide values. diff -r 290b0b2a584b -r a56d3d3b5efd MakeWaypoints.kt --- a/MakeWaypoints.kt Wed Aug 25 08:33:59 2021 -0700 +++ b/MakeWaypoints.kt Wed Aug 25 08:45:36 2021 -0700 @@ -8,6 +8,7 @@ import java.text.SimpleDateFormat import java.util.Date import java.util.TimeZone +import kotlin.math.abs private const val MYNAME = "MakeWaypoints" private const val CHARSET = "UTF-8" @@ -72,7 +73,9 @@ Pair(parts[0].trim(), parts[1].trim()) else Pair(parts[1].trim(), parts[0].trim()) - if (lat.toDoubleOrNull() == null || long.toDoubleOrNull() == null) { + val dLat = lat.toDoubleOrNull() + val dLong = long.toDoubleOrNull() + if (dLat == null || abs(dLat) > 90.0 || dLong == null || abs(dLong) > 180.0) { System.err.println(invalid) continue }