Re: get rectangular bounding box of oblique mercator projection
Paul Wessel <[email protected]>
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Eric- I've needed this many times myself so I understand the problem. To script a solution is a bit painful since two of your sides are great circles and two are small circles. The ugly truth is that you will have to do something like this: 1. Run mapproject with your -J -R for the upper right lon/lat corner. This gives you X1, Y1 in inches or cm. The lower left X0, Y0 is 0,0 in this coordinate system. 2. Sample N points along each straight line, i.e., X0 ->X1 for Y0, then N points from Y0 to Y1 for X1, etc etc all the way around. This gives you 4*N c,y coordinates. You could use sample1d and possibly some awk to do this. 3. Run mapproject -R -J -I on this table to get the corresponding lon,lat coordinates of your rectangle. 4. Now you can plot this lon,lat polygon on some other map with possibly another projection. I will look into if this capability could be baked into on of our programs, such as mapproject or similar. We already have something like this for grids in GMT5, i.e. grdinfo -Ib, but not for this case. Cheers, Paul On Apr 2, 2014, at 7:54 AM, Eric Lindsey <[email protected]> wrote: > Greetings, > Is there a simple way to get (or plot) the rectangular bounding box defined by an oblique mercator projection? For example, in one figure I'm using > > -JOa-115.9/33.5/135/9i -R-116.2/33.7/-115.6/33.4r > > This is a rectangular area, tilted at 135deg. relative to North. I want to show the outline of that area as a line on another plot. Two of the corners are defined by the -R command above, but I need the other two. I could probably do the math by hand (intersections of great circles?), but is there an easier way to do that in GMT? > > Thanks, Eric > To unsubscribe, send the message "signoff gmt-help" to [email protected] To unsubscribe, send the message "signoff gmt-help" to [email protected]