params.permit(:query, :lat, :lon, :latlon_digits, :zoom, :minlat, :minlon, :maxlat, :maxlon)
end
+ def dms_regexp(name_prefix)
+ /
+ (?: (?<#{name_prefix}d>\d{1,3}(?:\.\d+)?)°? ) |
+ (?: (?<#{name_prefix}d>\d{1,3})°?\s*(?<#{name_prefix}m>\d{1,2}(?:\.\d+)?)['′]? ) |
+ (?: (?<#{name_prefix}d>\d{1,3})°?\s*(?<#{name_prefix}m>\d{1,2})['′]?\s*(?<#{name_prefix}s>\d{1,2}(?:\.\d+)?)["″]? )
+ /x
+ end
+
def to_decdeg(captures)
- ns = captures.fetch("ns").casecmp("s").zero? ? -1 : 1
+ ns = captures.fetch("ns").casecmp?("s") ? -1 : 1
nsd = BigDecimal(captures.fetch("nsd", "0"))
nsm = BigDecimal(captures.fetch("nsm", "0"))
nss = BigDecimal(captures.fetch("nss", "0"))