Re: Convert pixel coordinates to LAT/LON [message #58292 is a reply to message #58291] |
Thu, 24 January 2008 10:38  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gary writes:
> Many apologies for what might be an entirely newbie question, which I
> am. I am trying to determine the lat/lon of a given position on a
> radar image. I have the lat/lon of the center point of the image. The
> image space covers less than a full degree of longitude and covers
> double the latitude. The difference in the meters/degree of latitude
> over the range is ~6m, so I linearly scale latitude over the range of
> pixels. For the longitude, I determine the meters/degree longitude for
> the given latitude (determine from the linear scaling). I then
> multiply the pixel coordinates by the meters/degree, and determine the
> degree offset from the edge of the image and add this to the lat or
> lon of the edge of the image. I understand all of this might be
> tedious and better served by using IDL's mapping functions, however,
> I'm trying to do all of this in as simple a fashion as possible in a
> GUI I've cobbled together which is already growing. I'm looking for
> some validation of this as a method that will provide reasonable
> results. Of course, I recognize I may have failed to supply addequate
> info, so please let me know if anything else is required. Thanks
Well, depending upon what kind of map projection this
image is in you are either going to be in the ball park
with this approach, or wildly wrong. It is unlikely that
you are going to be spot on. :-)
Assuming you are not using a Mercator projection (since we
are on the verge of proclaiming the one normally used
in IDL worthless), I think you would be MUCH further
ahead to use a map projection to make these calculations.
http://www.dfanning.com/map_tips/pixel_to_ll.html
It's really pretty easy if you can get the map projection
set up correctly.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|