Skip to content

Feature Request: Accept more formats #2

@briochemc

Description

@briochemc

I'd like to suggest expanding the accepted coordinate formats. The goal would be able to parse these:

  • 1°1′1 (minute symbol made with \prime + TAB)
  • 1°1' (no seconds)
  • (no minutes)
  • 1°1'1W (North/South/West/East direction at the end)

Here is a little snippet to test these:

julia> strings_to_test = Dict(
           "expected"      => "1°1'1",
           "\\prime"       => "1°1′1",
           "no seconds"    => "1°1'",
           "no minutes"    => "",
           "NSEWdirection" => "1°1'1W"
       ) ;

julia> function myparse(str)
           try
               parse_dms(str)
           catch e
               "does not parse"
           end
       end
myparse (generic function with 1 method)

julia> vcat(([k v myparse(v)] for (k,v) in strings_to_test)...)
5×3 Matrix{Any}:
 "expected"       "1°1'1"   (1.0, 1.0, 1.0)
 "no minutes"     ""      "does not parse"
 "NSEWdirection"  "1°1′1W"  "does not parse"
 "no seconds"     "1°1'"    "does not parse"
 "\\prime"        "1°1'1"   "does not parse"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions