X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 27 Dec 2016 03:35 PM by  anon
Getting Lat/Lon from object based map function
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:2
New Member


--
27 Dec 2016 03:35 PM
    In direct graphics I could use the CONVERT_COORD function to return the lat/lon, in degrees, of a pixel after I had set a map projection in MAP_SET. The new object-oriented MAP function shows provides a ConverCoord method but what it returns is a mystery. For example if I set a map with: m = map('Mercator', limit=[59, -170, 74, -135], dimensions = [640, 640]) and then query the coordinates near the center I get print, m.convertcoord(320,320,/device,/to_data) -3812.2263 10309072. 9.2530546e-10 These look like perhaps distances in meters from a datum, but when I divide by an Earth radius and convert, I get a latitude of 92 degreees, which is problematic. When I query what m is, I find it is defined as a MAPPROJECTION, but can find no documentation of what all the elements are. Does anyone know how to get the lat/lon in radians or degrees from a specific pixel in a object oriented map projection?

    Deleted User



    New Member


    Posts:2
    New Member


    --
    28 Dec 2016 12:19 AM
    Figured it out - two step process: map.convertcoord to get the x,y position in meters, then map.inverse to get the lat/lon.
    You are not authorized to post a reply.