Skip to content

UTM example: go on to add metric basemap too #7541

Closed

Description

@jidanni

Description of the desired feature

We read

Universal Transverse Mercator [conformal]
To use this projection you must know the UTM zone number, which defines the central meridian. A UTM basemap for Indo-China can be plotted as

gmt basemap -R95/5/108/20+r -Ju46/1:10000000 -Bafg -B+tUTM -pdf utm

Well that is just great, except many users would also like to know how to make the familiar meters also appear on the basemap. So please add an additional example.

Are you willing to help implement and maintain this feature? Yes/No

Sure, if I only had an inkling of how to accomplish it!!

Activity

  1. added
    feature request
    on Jun 13, 2023
  2. joa-quim commented on Jun 13, 2023

    @joa-quim
    Member

    Sure, if I only had an inkling of how to accomplish it!!

    • use mapproject to get the limits (BoundingBox) in the desired projection
    • make two psbasemap calls. One in geogs with, let say; -BWS -Ba and the other with the projected limits and -BEN -Ba
  3. PaulWessel commented on Jun 13, 2023

    @PaulWessel
    Contributor

    Cannot be done in a one-liner since we are not going to add more complications to -B. So it remains a more elaborate thing. You could get those meter bounds via

    gmt mapproject -R95/5/108/20+r -Ju46/1:10000000 /dev/null -V -F -C

    and then parse out the max/xmin/ymin/ymax, here 721387.055456/2080949.09788/552077.474203/2279563.58956.

    Then

    gmt begin utm
    	gmt basemap -R95/5/108/20+r -Ju46/1:10000000 -Bafg -BwS+tUTM
    	gmt basemap  -R721387.055456/2080949.09788/552077.474203/2279563.58956 -Jx1:10000000 -Bafg -BNE
    gmt end show
    
    

    Unless @joa-quim has a better idea, one thing we could consider is a way to get that -R string out via mapproject.

  4. PaulWessel commented on Jun 13, 2023

    @PaulWessel
    Contributor

    Sorry, now see @joa-quim basically said the same thing.

  5. PaulWessel commented on Jun 13, 2023

    @PaulWessel
    Contributor

    Could image a new option -M[r|s] where

    gmt mapproject -R95/5/108/20+r -Ju46/1:10000000 /dev/null -V -F -C -M

    would either change the region in gmt.history (-Ms) or just output the -Rstring (-Mr). If that was available then the above script would be

    gmt begin utm
    	gmt basemap -R95/5/108/20+r -Ju46/1:10000000 -Bafg -BwS+tUTM
    	gmt mapproject  /dev/null -V -F -C -Ms
    	gmt basemap -Jx1:10000000 -Bafg -BNE
    gmt end show
    
    
  6. jidanni commented on Jun 13, 2023

    @jidanni
    ContributorAuthor

    (Yeah, parsing out the data from a -V call doesn't sound very dignified.)

  7. joa-quim commented on Jun 13, 2023

    @joa-quim
    Member

    Don't particularly like this. Too convoluted.

  8. jidanni commented on Jun 13, 2023

    @jidanni
    ContributorAuthor

    Here's what a revised example should look like.

    k

    And here's the ugly way to get it:

    gmt begin utm
    gmt basemap --MAP_FRAME_AXES=SE -R95/5/108/20+r -Ju46/1:10000000 -B
    gmt coast -W -Na
    gmt basemap --MAP_FRAME_AXES=NW -R721387.055456/2080949.09788/552077.474203/2279563.58956 -Jx1:10000000 -B
    gmt end show
    

    Note we don't goop it up with color or anything.
    We are just trying to get an example for the Average Joe.
    We need to simplify the method more.
    That's where I'm thinking making a grid file with 0 points in it,
    would be one way of porting the region between commands...

  9. joa-quim commented on Jun 13, 2023

    @joa-quim
    Member

    That's where I'm thinking making a grid file with 0 points in it,

    You can't. A grid is a matrix

    A bit better.

    gmt begin utm
        gmt coast -W -Na -R95/5/108/20+r -Ju46/1:10000000 -BSE -Ba
        gmt basemap -R721387.055456/2080949.09788/552077.474203/2279563.58956 -Jx1:10000000 -BNW -Ba
    gmt end show
    
    
  10. jidanni commented on Jun 13, 2023

    @jidanni
    ContributorAuthor

    Yes, we will note in the comments that we can goop the coast and basemap calls together and save a step.
    But it is best to have each step separate so new users can easily turn them off and on with just a "#" in front,
    without injuring the rest.

  11. PaulWessel commented on Jun 13, 2023

    @PaulWessel
    Contributor

    FYI, The GMT team is busy working on podcasts for the UNAVCO GMT for Geodesy workshops so we wont really have time to implement new features right now.

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