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

Home » Public Forums » archive » shifted .kml created with IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
shifted .kml created with IDL [message #80955] Mon, 30 July 2012 05:25 Go to previous message
titan is currently offline  titan
Messages: 59
Registered: March 2006
Member
Hi all,
I'm creating a .kml starting from a geotiff image. After reading this geotiff file I transformed it as a .png file and then I create the .kml file.

the code I'm using is the following



img_tiff=READ_TIFF(file_tiff, GEOTIFF=geotag)
png_fname='test' + tag + '.png'
WRITE_PNG, png_fname, img_tiff,/ORDER

name='kml_test'

openw, lun, kml_file, /get_lun
printf, lun, '<?xml version="1.0" encoding="UTF-8"?>'
printf, lun, '<kml xmlns="http://www.opengis.net/kml/2.2">'
printf, lun, '<GroundOverlay>'
printf, lun, name, format='("<name>", a, "</name>")'
printf, lun, '<Icon>'
printf, lun, png_fname, format='("<href>", a, "</href>")' ;
printf, lun, '</Icon>'
printf, lun, '<LatLonBox>'
printf, lun, ul_lat, format='("<north>", f10.4, "</north>")'
printf, lun, ul_lon, format='("<west>", f10.4, "</west>")'
printf, lun, lr_lat, format='("<south>", f10.4, "</south>")'
printf, lun, lr_lon, format='("<east>", f10.4, "</east>")'
printf, lun, '<rotation>0.0</rotation>'
printf, lun, '</LatLonBox>'
printf, lun, '<drawOrder>10</drawOrder>'
printf, lun, '</GroundOverlay>'
printf, lun, '</kml>'
free_lun, lun
PRINT,'KML file created'

The UL and LR coordinates I'm using are calculated in a previous section of the code and they are the following:
ul_lat = 47.653348
ul_lon = 8.9734384
lr_lat = 45.292876
lr_lon = 13.830713

My problem is that when I open the .kml file it is shifted and is not correctly overlaying with the features likes lake or border lines.
Even if I inserted the coordinates taken from google earth:

ul_lat_GE=47.750684
ul_lon_GE=9.015974
;
lr_lat_GE=45.222022
lr_lon_GE=13.612157

I'm still not able to correctly overlay my image :(


Could someone tell me what I'm doing wrong?

thanks in advance
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: max_value/min_value in the x-axis?
Next Topic: IDL User Group Meeting 2012

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

Current Time: Thu Oct 09 16:10:30 PDT 2025

Total time taken to generate the page: 1.43930 seconds