UPDATE:
Well, for those who have been following this thread, I have been playing with
MAP_SET and MAP_IMAGE and feel that I understand them much better now. I have
discovered a way to keep the resolution of my imagery *almost* the same.
Basically, MAP_SET will create a window of a default size if one does not
exist, and MAP_IMAGE will place the image warped to the selected projection
within that window...in a best fit. So, I set things up so that the window
size = image size of the raw image. (I will have to use tiling on my full
implementation anyway, so having a small window to put this all to is no big
deal, I will probably use a pixmap window, or possibly the z-buffer). Here is
a small snippet of my test code that will place the sub image in the map
projection and keep it at the correct resolution:
image = bytarr(188,124)
openu, lun,'image.dat', /get_lun
readu,lun, IMAGE
close, lun
free_lun, lun
window, 0, xsize =188, ysize =124
TV, IMAGE ;Display the image so we can see what it looks like before warping.
pi = 3.1415925 LL_rad = 1.268 * 2.D * !pi / 360.D degfix = 1.0 /
double(cos(LL_rad)) ; Earth radius = 6378.17km ==> 111.32km/degree ; of
longitude at the equator, or 0.0089 deg/km ; xdegpkm = .00899D * degfix ;
fix size of longitudinal mile based on ; ydegpkm = .00899D ; cosine of
latitude x_mpdeg = double(111320.0 * degfix) y_mpdeg = double(111320.0)
;(image is approx .25 meters per pixel)
Minlon = double(-71.829 - ((94.0 *.25)/x_mpdeg)) ;71.829 lon W for center
pixel
Maxlon = double(-71.829 + ((94.0 *.25)/x_mpdeg))
Minlat = double(1.268 - ((62.0 * .25) / y_mpdeg)) ;1.268 lat N for center
pixel
Maxlat = double(1.268 + ((62.0 * .25) / y_mpdeg))
limit1 = [minlat, minlon, maxlat, maxlon]
loncenter = double(-71.829)
window, 1, xsize =188, ysize =124
MAP_SET, 0, loncenter, 0, /TRANSVERSE, limit=limit1, /noborder, xmargin=[0,0],
ymargin=[0,0]
result=MAP_IMAGE(image,startx,starty,xsize,ysize,$
latmin=limit1(0),latmax=limit1(2),$
lonmin=limit1(1),lonmax=limit1(3),$
compress=1)
tv,result,0,0 ;Display the warped image on the map at the proper position.
For my limited example, this works like a charm.
The one remaining problem I have is sometimes I can get a resulting image
back that is 187 by 125 or some such, usually only a pizel or two. What I
would like and have looked into a little is for MAP_SET and MAP_IMAGE to use
xsize and ysize values as passed in, and not the window size. Has anyone
attempted to do this, or should I go ahead and make my own?
------------------------------------------------------------ ----------
Sean P. Rumelhart Positive Systems, Inc.
seanr@possys.com 250 Second St. East
PH: 406.862.7745 Whitefish MT 59937
FAX: 406.862.7759 www.possys.com
------------------------------------------------------------ ----------
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
|