titan writes:
> Translating (I hope correctly!!)your suggestions I have
>
> mapCoord = cgGeoMap(tiff_image)
>
> geoTiffMapStruct = mapCoord -> GetMapStruct()
> geMapStruct = Map_Proj_Init('Mercator', /GCTP, Datum=8)
> image=Read_Tiff(path_fname+tiff_image, GEOTIFF=geotag)
>
> ul_lat = 47.653348
> ul_lon = 8.9734384
> lr_lat = 45.292876
> lr_lon = 13.830713
I'm not sure if these are the *centers* of the corner
pixels or the outside edge. I would probably get this
information directly from the GeoTiff file. If you did,
you would be getting the outside edge boundaries.
In other words, you can get this information from the
GeoTiff structure using tie points, the scale in the
X and Y direction, and the size of the image. All info
that is available for the GeoTiff file:
http://www.idlcoyote.com/map_tips/pixel_to_ll.html
> warp_r = Map_Proj_image(Reform(image[0,*,*]),[lr_lat,ul_lon,ul_lat,lr _lon], IMAGE_STRUCTURE=geoTiffMapStruct,MAP_STRUCTURE=geMapStruct, UVRANGE=warp_r_uvrange)
> s = Size(warp_r, /Dimensions)
> warp_g = Map_Proj_image(Reform(image[1,*,*]),[lr_lat,ul_lon,ul_lat,lr _lon], IMAGE_STRUCTURE=geoTiffMapStruct,MAP_STRUCTURE=geMapStruct, UVRANGE=warp_g_uvrange)
> warp_b = Map_Proj_image(Reform(image[2,*,*]),[lr_lat,ul_lon,ul_lat,lr _lon], IMAGE_STRUCTURE=geoTiffMapStruct,MAP_STRUCTURE=geMapStruct, UVRANGE=warp_b_uvrange)
> warp24 = BytArr(3, s[0], s[1])
> warp24[0, *, *] = ROTATE(warp_r,7)
> warp24[1, *, *] = ROTATE(warp_g,7)
> warp24[2, *, *] = ROTATE(warp_b,7)
Unfortunately, the "limit" parameter in Map_Proj_Image is documented
incorrectly in some on-line help versions. (I think this was fixed in
IDL 7.1.2 or something like that.) Those limits should be in terms of
XY coordinates, not lat/lon coordinates!
http://www.idlcoyote.com/map_tips/warpimage.html
(Latitude and longitude are not rectangular coordinates, so using those
as the "limits" makes no sense at all, except in a few map projections.)
These limits are the limits of your input image. The UVRANGE keyword
returns the limits of your re-projected image. It is *these* limits that
you want to turn into lat/lon values for your input to your KML file.
> in the third step should I convert again the warp24 file or not in the google earth projection?
You Inverse project the UVRANGE limits to lat/lon to
pass this to your KML code.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|