Skip to content

Offer proj style geographical coordinate formatting #3562

Closed

Description

@anbj

The FORMAT_GEO_OUT (https://docs.generic-mapping-tools.org/dev/gmt.conf.html#format-parameters) offers a range of combinations, but none of which conforms to the proj style, e.g. (https://proj.org/usage/projections.html#prime-meridian):

===========     ================
 Meridian        Longitude
 ===========     ================
   greenwich     0dE
      lisbon     9d07'54.862"W
       paris     2d20'14.025"E
      bogota     74d04'51.3"E
      madrid     3d41'16.48"W
        rome     12d27'8.4"E
        bern     7d26'22.5"E
     jakarta     106d48'27.79"E
       ferro     17d40'W
    brussels     4d22'4.71"E
   stockholm     18d3'29.8"E
      athens     23d42'58.815"E
        oslo     10d43'22.5"E
 ===========     ================

What about adding an option, FORMAT_GEO_OUT=proj, that uses this kind of template? This format also calls for less ambiguity, which really is a great feature when it comes to coordinates.

When I come to think of it, this would really just be a modifier on top of the FORMAT_GEO_OUT-template. You would specify the formatting, and tell GMT to make it proj-style.

Activity

  1. PaulWessel commented on Jun 30, 2020

    @PaulWessel
    Contributor

    That should be doable. Are these formats also expected to be understood when reading data files?

  2. added
    feature request
    on Jun 30, 2020
  3. anbj commented on Jul 1, 2020

    @anbj
    ContributorAuthor

    When I first thought of it, this was only meant as a more friendly way of formatting coordinates for human reading. But, it is proj's (default) way of outputting coordinates, so if GMT does support it for input as well, it would be nice. proj does support different styles of input so I dont know how this may complicate things, e.g. (https://proj.org/apps/cs2cs.html#using-proj-strings):

    cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10 +datum=NAD27 -r <<EOF
    45d15'33.1" 111.5W
    45d15.551666667N -111d30
    +45.25919444444 111d30'000w
    EOF
    

    I dont mean to make this a big deal, so any ideas are welcome. Keep it simple.

  4. anbj commented on Jul 6, 2020

    @anbj
    ContributorAuthor

    I guess this boils down to having a way of specifying different delimiters, which may be degrees (d), minutes (') or seconds ('') and optionally prefixing +/- or appending w/e/s/n.

  5. PaulWessel commented on Jul 6, 2020

    @PaulWessel
    Contributor

    For time we have settings like FORMAT_DATE_IN where you can specify crazy input format, including Y2K-challenged data. We have no FORMAT_GEO_IN but internally we accommodate ±ddd:mm:ss.xxxx[letter]. So we are more flexible with geo data since both -123.5 and 123:30S will be parsed correctly, whereas with time data your input better match your FORMAT_DATE_IN setting.

  6. anbj commented on Feb 15, 2023

    @anbj
    ContributorAuthor

    Missed approach in #5153. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions