Skip to content

Coordinates in DMS format with postfix hemisphere doesn't work #40

@CachingFoX

Description

@CachingFoX

Create a waypoint with coordinates in DMS format with postfix hemisphere doesn't work.

Example: 50 11 30.0N 8 30 30.0E => bad values

DMS semi-postfix hemisphere 50N 11 30.0 8E 30 30.0 => okay
DMS prefix hemisphere N 50 11 30.0 E8 30 30.0 => okay
DMM prefix hemisphere N 50 11.500 E 008 30.500 => okay
DMM postfix hemisphere 50 11.500N 08 30.500E => okay

coordinates.ts

// DMS / D M S H
{
    regexp: /^\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*([NEWS])\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*([NEWS])\s*$/,
    fields: [4, 1, 2, 3, 6, 5, 6, 7],
},

fix: change 5th field from 6to 8:

// DMS / D M S H
{
    regexp: /^\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*([NEWS])\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*([NEWS])\s*$/,
    fields: [4, 1, 2, 3, 8, 5, 6, 7],
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions