WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Could basemap plot in a UTM projection? - pyproj documentation

Re: Could basemap plot in a UTM projection? - pyproj documentation

by Jeff Whitaker-2 :: Rate this Message:

| View in Thread

On 4/2/12 11:23 AM, Jeff Whitaker wrote:
On 4/2/12 10:03 AM, Mathew Topper wrote:
On 02/04/12 16:21, Jeff Whitaker wrote:
On 4/2/12 9:10 AM, Mathew Topper wrote:
Hi,

I've been trawling round the internet for a while trying to work out if basemap could be made to plot using a UTM zone projection. I've found some references to pyproj that could be used to convert out of a UTM projection, but I haven't found any references to defining a custom projection for basemap. Is it possible?

Also, there is not a lot of documentation regarding pyproj and I find this a little odd considering it comes packaged with basemap.

Many Thanks,

Mat


Mat:  Basemap can plot in the tranverse mercator projection (projecton='tmerc') - UTM zones are transverse mercator with specific lat/lon boundaries and a WGS84 ellipsoid. I suppose I could add UTM zone support if there is enough demand for it.

-Jeff
-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@...
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

OK, thanks Jeff. So I just need to know the lon/lat bounds of the desired UTM zone and I have effectively created a UTM projection of that zone in basemap i.e. for UTM29 we have 12W to 6W.
Will basemap then except coordinates in meters defined by UTM29 or do I have to convert to lon/lat first?

Mat:  If you use projection='tmerc' and then give the lat/lon coords of the upper right and lower left corners with llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat, the projection coordinates will be such that x,y = 0 in the lower left corner.  Since those will not match the UTM coordinates exactly, you will have to add an offset in x,y to make them match.

-Jeff

Mat:  I just updated git master to add the 'k_0' keyword when using projection='tmerc'.  This is the scaling factor along the central meridian, and is needed to exactly match the UTM definition.  I also added a utmtest.py example, that shows how to plot a UTM zone, and convert Basemap coordinates to UTM coordinates.

-Jeff
-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@...
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 « Return to Thread: Could basemap plot in a UTM projection? - pyproj documentation