X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 30 Jun 2015 11:11 PM by  anon
Retrieve pixel Map location from display to IDL
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:6
New Member


--
30 Jun 2015 11:11 PM
    ENVI 5.2 Hello, I'm trying to get a pixels map location from the display. I'm looking for a functionally similar method as disp_get_location. But instead of the x/y coordinate pairs I'd like to retrieve the Map value for the pixel to IDL. I'm trying to compare map locations between two open images and using IDL for this would make it much faster. ex. Map: 392145.00E, 2976045.00N Is there something that can help me do this? Thanks.

    Deleted User



    New Member


    Posts:6
    New Member


    --
    01 Jul 2015 02:13 AM
    I figured it out. I'll put it here in case anyone else might find it useful. display = envi_get_display_numbers() ; check for open display if (display[0] eq -1) then return foreach img, display do begin ; in case more than 1 open display envi_disp_query, img, fid=img_fid ; get fid (for image file) of open display disp_get_location, img, xfloc, yfloc, /FLOATING, /NO_OFFSET ; pull x/y location from selected pixel envi_convert_file_coordinates, img_fid, xfloc, yfloc, x_map, y_map, /TO_MAP ; convert x/y to map coord endforeach

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    02 Jul 2015 01:28 PM
    Hi Kenneth, You can also use the new ENVI API to get similar results. Here is a link to the documentation and the example from the link: http://www.exelisvis.com/...tCenterLocation.html ; Launch the application e = ENVI() ; Open a file file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $ SUBDIRECTORY = ['data']) raster = e.OpenRaster(file) ; Display the data view = e.GetView() layer = view.CreateLayer(raster) ; Get the center of the view in lon, lat center = view.GetCenterLocation() PRINT, 'View Center' PRINT, 'lon = ', center[0] PRINT, 'lat = ', center[1]
    You are not authorized to post a reply.