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

Home » Public Forums » archive » Re: Image Warp Success?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Image Warp Success? [message #69742 is a reply to message #69732] Tue, 09 February 2010 04:12 Go to previous messageGo to previous message
philipelson is currently offline  philipelson
Messages: 9
Registered: March 2009
Junior Member
> Has anyone ever had any success using MAP_PROJ_IMAGE to
> warp an image in one map projection into another map
> projection?


I did something similar to this recently, though not on the
projections that you want - in *theory* that shouldn't matter! You
will need to get hold of the image found at the URL below, but here is
the code:


URL = 'http://onearth.jpl.nasa.gov/wms.cgi?
request=GetMap&width=256&height=256&layers=modis &styles=&srs=EPSG:
4326&format=image/png&bbox=-30,0,70,80'

file = 'wms.cgi.png'

image = READ_IMAGE(file,r,g,b)

limit = [0, -30, 80, 70]

tileStruct = MAP_PROJ_INIT(8, LIMIT = limit)
mapStruct = MAP_PROJ_INIT('Lambert Azimuthal')

PLOT, mapStruct.uv_box[[0,2]], $
mapStruct.uv_box[[1,3]], $
/NoData, XSTYLE=5, YSTYLE=5

r = MAP_PROJ_IMAGE(reform(image[0,*,*]), tileStruct.uv_box,
MAP_STRUCTURE=mapStruct, IMAGE_STRUCTURE=tileStruct, /BILINEAR,
UVRANGE=uv)
g = MAP_PROJ_IMAGE(reform(image[1,*,*]), tileStruct.uv_box,
MAP_STRUCTURE=mapStruct, IMAGE_STRUCTURE=tileStruct, /BILINEAR,
UVRANGE=uv)
b = MAP_PROJ_IMAGE(reform(image[2,*,*]), tileStruct.uv_box,
MAP_STRUCTURE=mapStruct, IMAGE_STRUCTURE=tileStruct, /BILINEAR,
UVRANGE=uv, mask=mask)

top_right = CONVERT_COORD(uv[2], uv[3], /DATA, /TO_DEVICE)
bottom_left = CONVERT_COORD(uv[0], uv[1], /DATA, /TO_DEVICE)
img_size = (ceil(top_right - bottom_left))[0:1]

image = congrid([[[r]], [[g]], [[b]]], img_size[0], img_size[1], 3)

tv, image, uv[0], uv[1], true=3, /data

map_continents, MAP_STRUCTURE=mapStruct, /hires

map_grid, MAP_STRUCTURE=mapStruct



I hope this is helpful,

Regards,

Philip
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simultaneous write on textfile over NFS
Next Topic: Re: dereference with wildcard

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

Current Time: Wed Oct 08 19:55:07 PDT 2025

Total time taken to generate the page: 0.00494 seconds