comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » sec : U Re: Fitting a map to an image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
sec : U Re: Fitting a map to an image [message #31021] Thu, 06 June 2002 15:42 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Sean Raffuse wrote:
>
> Hello.
>
> I have an image of known size and flat geocoordinates. I want to overlay
> the US states vector in a display window on top of the image. My problem is
> that I cannot get the two to match up properly. There seems to be a border
> on the vector, but the image draws to the edge of the window. I tried using
> the noborder keyword on my call to map_set and also tried setting the !x and
> !y margins to zero. No luck. Can you help? Here is the relevant code. . .
>
> ;set margins to zero
> x_margin = !x.margin
> y_margin = !y.margin
> !x.margin = [0,0]
> !y.margin = [0,0]
>
> ;write output to screen
> Device, decomposed=0
> image = reverse(InArray1, 2)
> LoadCT, 40
> scaledImage = bytscl(image, Min=0, Max=0.5, Top=255)
> window, 0, xsize=nscans, ysize=nlines
> TV, scaledImage
>
> ;setup the map
> xspan = pixelsize*nscans
> yspan = pixelsize*nlines
> upperleftlat = mc[3]
> upperleftlon = mc[2]
> lowerlat = upperleftlat - yspan
> rightlon = upperleftlon + xspan
> map_set, limit=[lowerlat,upperleftlon,upperleftlat,rightlon], /noborder,
> /noerase
> map_continents, /usa, color = 254, mlinethick=2
>
> ;write to jpeg
> image = tvread(filename=out_name, /JPEG, /nodialog, Quality=100)
>
> ***thanks to David Fanning for the tvread procedure***
>
> -Sean Raffuse

Sean,

I'd say there's no way that you can just TV an image and *then*
call MAP_SET to define the geographic data space!

Try along the lines of :-

1. Map_set .. blah,blah
2. geo_warped_image = Map_image(image,.. blah,blah)
3. TV, geo_warped_image, xpos,ypos.. blah,blah
3. map_continents, /usa, color = 254, mlinethick=2


Andrew

------------------------------------------------------------ -----------------
Andrew D. Cool .->-.
Electromagnetics & Propagation Group '-<-'
Intelligence, Surveillance & Reconnaissance Division Transmitted on
Defence Science & Technology Organisation 100% recycled
PO Box 1500, Edinburgh electrons
South Australia 5111

Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@crapdsto.defence.gov.au
Please remove the crap from my email address to reply ;-)
------------------------------------------------------------ -----------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: dynamic memory in dll
Next Topic: Fitting a map to an image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 06:05:11 PDT 2025

Total time taken to generate the page: 0.48008 seconds