image interplate and overlay lat/lon? [message #81178] |
Wed, 22 August 2012 08:57  |
beardown911
Messages: 21 Registered: March 2007
|
Junior Member |
|
|
Hello all,
My goal is to take an image(s) and overlay geographic lat/lon information onto the image. I have lat/lon information of four boundaries and tried to create a regular grid using them.
I’ve used David’s code to generate a regular lat/lon grid, and tried to interpolate image with gridded lat/lon data.
However, outImage looks blank and only geographin lat/lon data are shown with 0 image pixel values. I am working on 8-bit tif images.
Would anybody give me some tips how to make this work or what I did wrong?
Thanks in advance,
Kim
P.S. Below is what I've been working on.
;---------------------------------------------------------
; image(0,0)locates at the upper left corner
xOrigin = maxLon
yOrigin = maxLat
xscale = (maxLon – minLon)/nS
yscale = (maxLat – minLat)/nL
uvec = Findgen(nS) * xscale + xOrigin
vvec = yOrigin - (Findgen(nL) * yscale)
uarray = Rebin(uvec, nS, nL)
varray = Rebin(Reform(vvec, 1, nL), nS, nL)
outImage = Interpolate(inImage, varray, uarray)
.
.
.
geoTag = { $
ModelTiepointTag: [0.0, 0.0, 0.0, xOrigin, yOrigin, 0.0], $
ModelPixelScaleTag: [xscale, yscale, 0.0], $
GTModelTypeGeoKey: 2, $ ; (ModelType Geographic)
GTRasterTypeGeoKey: 2, $ ; (RasterPixelIsPoint)
GeographicTypeGeoKey: 4326 $ ; (WGS84)
}
.
.
WRITE_TIFF, outImage, GEOTIFF = geoTag
;-----------------------------------------------------
|
|
|
|
|