Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer proj style geographical coordinate formatting #3562

Closed
anbj opened this issue Jun 30, 2020 · 5 comments
Closed

Offer proj style geographical coordinate formatting #3562

anbj opened this issue Jun 30, 2020 · 5 comments
Labels
feature request Request a new feature

Comments

@anbj
Copy link
Contributor

anbj commented Jun 30, 2020

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.

@PaulWessel
Copy link
Member

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

@PaulWessel PaulWessel added the feature request Request a new feature label Jun 30, 2020
@anbj
Copy link
Contributor Author

anbj commented Jul 1, 2020

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.

@anbj
Copy link
Contributor Author

anbj commented Jul 6, 2020

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.

@PaulWessel
Copy link
Member

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.

@anbj
Copy link
Contributor Author

anbj commented Feb 15, 2023

Missed approach in #5153. Closing.

@anbj anbj closed this as completed Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants