comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Amazingly accurate UTM <-> Lat/Lon transformations
items: Re: Amazingly accurate UTM <-> Lat/Lon transformations

Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: Hi all, In this newsgroup, I recently inquired as to whether inverse hyperbolics would be available in IDL anytime soon. I added a link to the Wikipedia entry on UTM (The Universal Transverse Mercator map projection) by way of explanation. I got an exasperated reply: "If you want this post to be usefull to at least one more person (I cant talk only for me) you might want to give more information than a link to a wikipedia page. I am using UTM (in IDL) and I am asking myself: what's the point?" To my mind, the question (on inverse hyperbolics) was self-explanatory. My pocket calculator is older than IDL, and it has inverse hyperbolics. It's just weird that IDL doesn't. (I'm glad to see that Mark Piper agrees.) If you, like me, abuse the UTM coordinate system to map regions that cover much more than the intended 6 degrees of latitude (or 12 degrees in zones 31-37X around Svalbard), and you want your conversions to be reversible (in case you should ever need to reproject), then you should be aware that the projections performed by IDL's map system are _not_ reversible without significant errors outside their target zone. In our application, we have used projection in UTM zone 33 (centered at 15°E) to cover most of Europe. Iceland is the westmost part, extending to westward of 21°W, and belonging in UTM zone 27. My benchmark point in the tables below is Surtsey (63.303°N, 20.6047°W), which is close to the middle of zone 27. I use the IDL routines MAP_PROJ_INIT, MAP_PROJ_FORWARD and MAP_PROJ_INVERSE to convert these coordinates to UTM and back to Lat/Lon. Whatever discrepancy arises is multiplied with a Earth circumference of 4e7 metres and the longitude scaled by COS(63.303°) to give the round-trip error in metres. (This computation is just for the scale of the error, no need to drag in geodesy for that). Here is my IDL code for this (and if I'm doing something wrong, PLEASE let me know!): ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; zones = 27 + indgen(13) - 6…
creator: tom.grydeland
date: 2013-09-17T08:50:55-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: Tom Grydeland writes: > Also anyone who uses UTM with IDL, especially if they abuse the UTM > projection well outside its intended area (instead of switching to a > projection more suited for large regions) should have a look at the > Wikipedia article on UTM and its references, and try implementing these > formulas. Maybe it's just me, but it seems a little weird to me to claim that if you use the software in a way that it is clearly not intended to be used, you get bad results. Isn't this making a claim for clairvoyance on the part of the developers? I agree that IDL's map projection software is probably overdue for an update. But, I'm not convinced this is any kind of a deal breaker. Cheers, David P.S. For what it's worth, I, too, was confused by the initial reference and had to spend 15 minutes or so figuring it out. That's about 14.5 minutes more than most readers of the newsgroup would have, I imagine. -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2013-09-17T18:16:08-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: On 09/17/2013 08:16 PM, David Fanning wrote: > I agree that IDL's map projection software is probably overdue for an > update. But, I'm not convinced this is any kind of a deal breaker. I forwarded Tom's post to my colleagues, because many of them are not aware of these problems and Tom nicely showed the huge discrepancies that can occur when using UTM. Having said this, I am also concerned that even if the LonLat->EastingsNothings->LonLat transforms work better with Tom's code, it might still not be a good idea to use UTM for large maps. Regarding the map projections in IDL, it seems that IDL is far behind many other GIS softwares (correct me if I'm wrong): - the panel of "out of the box" projections is small - there is no datum shift transformation tool (!) - the accuracy, as shown by Tom, could be higher I believe this is due to the fact that Exelis wants to sell ENVI to IDL users in need for more complete/accurate projection engines...
creator: Fabzi
date: 2013-09-18T09:13:02-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: On Tuesday, September 17, 2013 8:16:08 PM UTC+2, David Fanning wrote: > Maybe it's just me, but it seems a little weird to me to claim that if > you use the software in a way that it is clearly not intended to be > used, you get bad results. Isn't this making a claim for clairvoyance on > the part of the developers? I'll admit to weird most Tuesdays and Saturdays, and the third Wednesday of the month, but clairvoyance I will leave to others (you know who you are!) :-) > I agree that IDL's map projection software is probably overdue for an > update. But, I'm not convinced this is any kind of a deal breaker. My intention was not to throw dirt on the IDL mapping routines. As I wrote (and you also point out), this is clearly abusing the UTM projection, and there are other projections more suited for this kind of application. I also wrote quite clearly that (depending on your requirements) the IDL routines produce acceptable results in the first and possibly second neighbouring zones. That said, I am quite confident that I'm not the only one abusing UTM in this way, and indeed it turned out that my correspondent was also abusing UTM in exactly the same way, without being aware of the problems they were bringing upon themselves. Maybe it is the way of people to take what they know and see if it can be streched to fit over what they don't, what do you think? So -- the information was intended for those who persist in doing this, even when told that it may not be the best of ideas, and to show them that the transformations _can_ be made in an invertible way, using the expressions from Wikipedia rather than IDL's mapping routines. Furthermore: IDL's routines will happily accept the task of transforming to UTM projections a quarter of a globe away, even if the morality of such action can be questioned. Given that the task will be performed, I think an accurate result is to be preferred over a wildly inaccurate one. Don't you agree? > Cheers, > David > > P.S. For what it's wor…
creator: tom.grydeland
date: 2013-09-18T09:15:59-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: Tom Grydeland writes: > So -- the information was intended for those who persist in doing this, even when told that it may not be the best of ideas, and to show them that the transformations _can_ be made in an invertible way, using the expressions from Wikipedia rather than IDL's mapping routines. Furthermore: IDL's routines will happily accept the task of transforming to UTM projections a quarter of a globe away, even if the morality of such action can be questioned. Given that the task will be performed, I think an accurate result is to be preferred over a wildly inaccurate one. Don't you agree? I agree that wildly inaccurate results should be avoided. ;-) I'm not totally convinced the way to avoid them in this case is to roll your own software. I'd rather see folks fix the problem by using map projection software correctly. My guess is that both of our efforts will prove to be for naught for most users. :-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2013-09-18T13:04:13-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: Fabien writes: > I forwarded Tom's post to my colleagues, because many of them are not > aware of these problems and Tom nicely showed the huge discrepancies > that can occur when using UTM. Having said this, I am also concerned > that even if the LonLat->EastingsNothings->LonLat transforms work better > with Tom's code, it might still not be a good idea to use UTM for large > maps. > The UTM projection is surely one of the most abused map projections in history. Perhaps scientists should be made to take a quick course on it in additional the the mandatory typing classes I've been advocating forever. > Regarding the map projections in IDL, it seems that IDL is far behind > many other GIS softwares (correct me if I'm wrong): > - the panel of "out of the box" projections is small > - there is no datum shift transformation tool (!) > - the accuracy, as shown by Tom, could be higher > > I believe this is due to the fact that Exelis wants to sell ENVI to IDL > users in need for more complete/accurate projection engines... Now, now, Fabien, I'm not dead yet. Please don't be usurping my role of cynic on this newsgroup. ;-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2013-09-18T13:19:13-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: On Wednesday, September 18, 2013 9:19:13 AM UTC-4, David Fanning wrote: > > The UTM projection is surely one of the most abused map projections in > > history. Perhaps scientists should be made to take a quick course on it > > in additional the the mandatory typing classes I've been advocating > > forever. > > > David Fanning, Ph.D. As a scientist and self-taught programmer, I completely agree with David that it would have been nice to formally have been taught programming, map projections (I know that I still don't know as much as I should about them), and many other things! As it is we learn as we go and sometimes I shudder to look back at old code. I also agree with Tom, David etc that if IDL will do the coordinate conversion even when it is not 'sensible', it'd be good for it to be reasonably accurate, and/or have a big obvious warning in the documentation about that. Andy
creator: Andy Sayer
date: 2013-09-18T14:20:52-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: On Wednesday, September 18, 2013 3:04:13 PM UTC+2, David Fanning wrote: > I'm not totally convinced the way to avoid them in this case is to roll > your own software. I'd rather see folks fix the problem by using map > projection software correctly. In other words, don't use UTM for this kind of task. I don't disagree. On the other hand, I cannot demonstrate how much more accurate these formulas are without implementing them (i.e. rolling my own), and the improvements are not available to anyone else without rolling their own until Exelis takes notice. > My guess is that both of our efforts will > prove to be for naught for most users. :-) You're much too cynical. The Coyote library is a great benefit to all those using it, and my little note has enlightened at least one reader. Trying to be of benefit to _most_ users is a tall order. > David --T
creator: tom.grydeland
date: 2013-09-19T12:40:35-00:00

Re: Amazingly accurate UTM <-> Lat/Lon transformations
type: item
description: Tom Grydeland writes: >> My guess is that both of our efforts will >> prove to be for naught for most users. :-) > > You're much too cynical. Yeah, I think Coyote must have been typing. I was thinking "many" and was shocked to see "most" when I re-read the article after it was posted. :-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2013-09-19T12:47:23-00:00