Hi. I'm trying to display an image of the United States and overlay some political boundaries onto it. The problem is that my boundaries are off, especially on the west coast. They are too small for the image.
Here's a link to the image: http://cse.unl.edu/~jschirf/overlay.JPG
I've tried using map_image to correct, but haven't had any luck. Here is my code:
pro overlay
compile_opt strictarr
envi, /restore_base_save_files
envi_batch_init
; Retrieve the file using ENVI
filename = 'N:\ssl\weekly_avhrr\imagine_format\us01_005011_ch1_imagine.img'
envi_open_file, filename, r_fid=fid1
envi_file_query, fid1, ns=ns, nl=nl
dims = [-1, 0, ns-1, 0, nl-1]
data1 = envi_get_data(fid=fid1, dims=dims, pos=0);
; Resize the image for display
scaleFactor = 4;
width = fix(ns / scaleFactor);
height = fix(nl / scaleFactor);
smallData = CONGRID(data1, width, height);
; Flip the data because CONGRID reverses it.
smallData = REVERSE(smallData, 2);
WINDOW, 2, XSIZE = width, YSIZE = height, TITLE = filename
; Set the map projection
map_set, 45, -100, /lambert, limit=[22.4515,-128.4388,48.4225,-75.4583], /noerase
;Display the image
TVSCL, smallData
; Show the borders
map_continents
envi_batch_exit
END
If anyone could help identify possible errors I've made, I would be very appreciative.
|