Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
shifted .kml created with IDL
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
titan  
View profile  
 More options Jul 30 2012, 8:25 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Mon, 30 Jul 2012 05:25:01 -0700 (PDT)
Local: Mon, Jul 30 2012 8:25 am
Subject: shifted .kml created with IDL
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 30 2012, 8:36 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Mon, 30 Jul 2012 06:36:49 -0600
Local: Mon, Jul 30 2012 8:36 am
Subject: Re: shifted .kml created with IDL

titan writes:
> 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?

I would guess the map projection in your GeoTiff
file is different from the map projection Google
Earth uses. You will probably have to convert
your GeoTiff coordinates to the proper map
projection.

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
titan  
View profile  
 More options Jul 30 2012, 8:55 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Mon, 30 Jul 2012 05:55:06 -0700 (PDT)
Local: Mon, Jul 30 2012 8:55 am
Subject: Re: shifted .kml created with IDL

Hi David,
first of all thanks for your answer!
this is how I calculated the coordinates

utmMap = MAP_PROJ_INIT('UTM', DATUM=12, ZONE=32)
lonlat = MAP_PROJ_INVERSE([xLL,yLL,xUR,yUR], MAP_STRUCTURE=utmMap)

lon_range=[lonlat[0,0],lonlat[0,1]]
lat_range=[lonlat[1,0],lonlat[1,1]]
; Set the center of the projection
c_lat = (lat_range(0) + lat_range(1)) * 0.5
c_lon = (lon_range(0) + lon_range(1)) * 0.5

UL_lat=lonlat[1,1]
UL_lon=lonlat[0,0]

LR_lat=lonlat[1,0]
LR_lon=lonlat[0,1]

I'm using the DATUM=12 as you suggest here
http://www.idlcoyote.com/map_tips/utmwrong.php
I thought google earth projection was UTM.

If I'm wrong could you please tell me which kind of projection is google earth using?is it a particular one?
thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 30 2012, 9:08 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Mon, 30 Jul 2012 07:08:40 -0600
Local: Mon, Jul 30 2012 9:08 am
Subject: Re: shifted .kml created with IDL

titan writes:
> If I'm wrong could you please tell me which kind of projection is google earth using?is it a particular one?

I haven't made KML files, but when I work with Google Maps,
they always come back in a Mercator projection. I presume
that is what they are using.

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 30 2012, 9:13 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Mon, 30 Jul 2012 07:13:24 -0600
Local: Mon, Jul 30 2012 9:13 am
Subject: Re: shifted .kml created with IDL

David Fanning writes:
> I haven't made KML files, but when I work with Google Maps,
> they always come back in a Mercator projection. I presume
> that is what they are using.

To navigate the Google Static Maps that I get from Google,
I use a Mercator projection with a WGS84 datum:

   mapCoord = Obj_New('cgMap', 105, Datum=8)

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
titan  
View profile  
 More options Jul 30 2012, 10:23 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Mon, 30 Jul 2012 07:23:18 -0700 (PDT)
Local: Mon, Jul 30 2012 10:23 am
Subject: Re: shifted .kml created with IDL

Thanks a lot David,
Tomorrow I will try using it as structure in the MAP_PROJ_INVERSE function and I will let you know as soon as possible

cheers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
titan  
View profile  
 More options Jul 31 2012, 3:09 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Tue, 31 Jul 2012 00:09:59 -0700 (PDT)
Local: Tues, Jul 31 2012 3:09 am
Subject: Re: shifted .kml created with IDL

Hi David,
unfortunately it does not work or probably I'm still missing something :(
Using the following code I get coordinates that are pointing to an area near Corsica!!

mapCoord_Google_earth = MAP_PROJ_INIT('Mercator', Datum=8)
lonlat_Google_Earth = MAP_PROJ_INVERSE([xLL,yLL,xUR,yUR], MAP_STRUCTURE=mapCoord_Google_earth)

lon_range_Google_Earth=[lonlat_Google_Earth[0,0],lonlat_Google_Earth[0,1]]
lat_range_Google_Earth=[lonlat_Google_Earth[1,0],lonlat_Google_Earth[1,1]]

UL_lat_Google_Earth=lonlat_Google_Earth[1,1]
UL_lon_Google_Earth=lonlat_Google_Earth[0,0]

LR_lat_Google_Earth=lonlat_Google_Earth[1,0]
LR_lon_Google_Earth=lonlat_Google_Earth[0,1]

print ,'UL_lat_Google_Earth',UL_lat_Google_Earth
print ,'UL_lon_Google_Earth',UL_lon_Google_Earth
print ,'LR_lat_Google_Earth',LR_lat_Google_Earth
print ,'LR_lon_Google_Earth',LR_lon_Google_Earth

UL_lat_Google_Earth       47.512672
UL_lon_Google_Earth       4.4728665
LR_lat_Google_Earth       45.054882
LR_lon_Google_Earth       7.7499209

What I'm doing wrong?!?

thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 31 2012, 7:56 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Tue, 31 Jul 2012 05:56:40 -0600
Local: Tues, Jul 31 2012 7:56 am
Subject: Re: shifted .kml created with IDL

Pretty much everything, as far as I can tell. ;-)

Let's see. I think the goal was to take an image that is in
a GeoTiff file and in one map projection (which one?) and
convert it to another map projection (that we presume is
a Mercator map projection), so we can make a KML file that
overlaps.

So, we need:

   1. A map structure that represents the image in the GeoTiff
      file.

   2. A map structure that represents the map projection we
      want to eventually get the image into (Google Earth's
      map projection.

   3. Some method to convert from one map projection to the
      other.

If we are lucky, we can get the map structure for (1) from
cgGeoMap. That will save us about 10 hours of work pawing
though the GeoTiff documentation!

   mapCoord = cgGeoMap(geoTiffFileName)
   geoTiffMapStruct = mapCoord -> GetMapStruct()

We get the second map structure for (2) the way you set it up.

   geMapStruct = Map_Proj_Init('Mercator', /GCTP, Datum=8)

For (3), we use Map_Proj_Image. We convert the XY projected
meter values of the geoTiff image into the XY projected meter
values of the Goggle Earth image. Then, convert those XY projected
meter values into the lat/lon values we want to save in our
KML file.

If we have done all this correctly (we make MANY assumptions
that we hope are correct!), we will have shifted the lat/lon
values in the GeoTiff image just a little bit, so that they
align with the lat/lon values on a Google Earth map.

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
titan  
View profile  
 More options Jul 31 2012, 10:51 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Tue, 31 Jul 2012 07:51:32 -0700 (PDT)
Local: Tues, Jul 31 2012 10:51 am
Subject: Re: shifted .kml created with IDL

Hi david,
thanks for your answer.
my tiff file is in UTM WGS 84 32N projection and I'm not sure if I understood well your step 3.

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

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)

in the third step should I convert again the warp24 file or not in the google earth projection?

thanks a lot for your patience


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 31 2012, 12:30 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Tue, 31 Jul 2012 10:30:34 -0600
Local: Tues, Jul 31 2012 12:30 pm
Subject: Re: shifted .kml created with IDL

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 31 2012, 12:36 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Tue, 31 Jul 2012 10:36:37 -0600
Local: Tues, Jul 31 2012 12:36 pm
Subject: Re: shifted .kml created with IDL

David Fanning writes:
> 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

All this boundary information is more easily obtained
with the Coyote Library routine FindMapBoundary, of course:

   void = FindMapBoundary(geoTiffFile, b, XRANGE=xr, YRANGE=yr)

The boundary is in the variable b. Or you can use the ranges.
Same numbers, just presented differently, depending on what
you need.

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
titan  
View profile  
 More options Aug 2 2012, 3:00 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Thu, 2 Aug 2012 00:00:48 -0700 (PDT)
Local: Thurs, Aug 2 2012 3:00 am
Subject: Re: shifted .kml created with IDL

Hi David,
I tried to collect all your useful suggestions to get the rid of this problem but I think I'm still missing something and I'm getting confused :( (Do I need holiday???)

I had two approaches:
1. I'm calculating the center of the corner pixels and from this (using http://www.idlcoyote.com/map_tips/pixel_to_ll.html) I calculated the lat and lon for all pixel of the image in the Google Earth projection

tiff_image=path_fname+tiff_image

;mapCoord = cgGeoMap(tiff_image)

;geoTiffMapStruct = mapCoord -> GetMapStruct()
geMapStruct = Map_Proj_Init('Mercator', /GCTP, Datum=8)
image=Read_Tiff(tiff_image, GEOTIFF=geotag)

image = Reverse(image, 2) ; Necessary for TIFF files.
s=Size(image, /Dimensions)
xscale  = geotag.ModelPixelScaleTag[0]
yscale  = geotag.ModelPixelScaleTag[1]
tp      = geotag.ModelTiePointTag[3:4]

xOrigin = tp[0]
yOrigin = tp[1] - (yscale * s[1])
xEnd = xOrigin + (xscale * s[0])
yEnd = tp[1]
xCenter = (xEnd - xOrigin) / 2.0 + xOrigin
yCenter = (yEnd - yOrigin) / 2.0 + yOrigin

uvec = Findgen(s[0]) * xscale + xOrigin
vvec = Findgen(s[1]) * yscale + yOrigin

uarray = Rebin(uvec, s[0], s[1])
varray = Rebin(Reform(vvec, 1, s[1]), s[0], s[1])

lonlat_ge= MAP_PROJ_INVERSE(uarray, varray, MAP_STRUCTURE=geMapStruct)  
minLat_ge = Min(lonlat_ge[1,*], MAX=maxLat_ge)
minLon_ge = Min(lonlat_ge[0,*], MAX=maxLon_ge)
limit_ge = [minLat_ge, minLon_ge, maxLat_ge, maxLon_ge]

print, limit_ge
39.646844       6.1113937       42.130700       6.1182209

2. Then I tried the FindMapBoundary function to get the border of my tiff image and then using in a correct way the map_proj_image function. After reading the tiff file and cr4eating a warped image using the Google Earth map structure I convert the uvrange in lat/lon to be passed to my kml.

void = FindMapBoundary(tiff_image, b, XRANGE=xr, YRANGE=yr)
print, 'boundary ', b
print, 'XRANGE ',xr
print, 'YRANGE ',yr

tiffCoord = cgGeoMap(tiff_image)

   tiffCoord -> SetProperty, XRANGE=xr, YRANGE=yr  

    MercatorCoord = Obj_New('cgMap', "MERCATOR", DATUM=8)

    warped_r = Map_Proj_Image(REFORM(image[0,*,*]), b, $
       IMAGE_STRUCTURE=tiffCoord->GetMapStruct(), MAP_STRUCTURE=MercatorCoord->GetMapStruct(), $
        UVRANGE=uvout)

   warped_g = Map_Proj_Image(REFORM(image[1,*,*]), b, $
       IMAGE_STRUCTURE=tiffCoord->GetMapStruct(), MAP_STRUCTURE=MercatorCoord->GetMapStruct(), $
       UVRANGE=uvout)

   warped_b = Map_Proj_Image(REFORM(image[2,*,*]), b, $
       IMAGE_STRUCTURE=tiffCoord->GetMapStruct(), MAP_STRUCTURE=MercatorCoord->GetMapStruct(), $
       UVRANGE=uvout)
print,'uvout'
print,uvout

s=SIZE(warped_r, /DIMENSIONS)
   warped = BytArr(3, s[0], s[1])
 warped[0, *, *] = ROTATE(warped_r,7)
 warped[1, *, *] = ROTATE(warped_g,7)
 warped[2, *, *] = ROTATE(warped_b,7)

 WRITE_PNG, path_fname+'tiff_warped2mercator.png', warped

 lonlat_kml= MAP_PROJ_INVERSE(uvout, MAP_STRUCTURE=geMapStruct)  

boundary        680317.23       4878686.4       1045117.2       5152286.4
XRANGE        680317.23       1045117.2
YRANGE        4878686.4       5152286.4

uvout
       1252403.4       5414120.5       1789982.0       5829831.8

lonlat_kml
       11.250532       43.859578
       16.079682       46.500001

The problem is that I expected coordinate near to these
ul_lat =       47.653348
ul_lon =       8.9734384
lr_lat =       45.292876
lr_lon =       13.830713
which are the corners of the area in which I'm interest.
Am I still doing everything wrong?? :(

Thanks for your support!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Aug 2 2012, 5:33 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Thu, 2 Aug 2012 15:33:19 -0600
Local: Thurs, Aug 2 2012 5:33 pm
Subject: Re: shifted .kml created with IDL

Titan writes:
> lonlat_kml
>        11.250532       43.859578
>        16.079682       46.500001

> The problem is that I expected coordinates near to these
> ul_lat =       47.653348
> ul_lon =       8.9734384
> lr_lat =       45.292876
> lr_lon =       13.830713
> which are the corners of the area in which I'm interest.
> Am I still doing everything wrong?? :(

I would say the art of programming is reconciling what
we expect with what we get. :-)

I don't know how to answer you questions. I had my
own set of assumptions from the get-go. The first
is that you described the problem correctly and
accurately. But, since I've never *seen* the problem,
I can't judge if my assumption is correct. I based
my assumption on my experience that when things are
a "little bit off" it usually involves a mismatch
in map projection parameters.

If things are as bad as you now say they are, then
I'm at a complete loss. I suppose you have good
reasons for expecting something different?

Can you confirm the lat/lon values at the corners
of your geoTiff image (with, for example,
Map_Proj_Forward) are what you expect them to be?

They should not change very much, I don't think,
in this coordinate transformation from UTM to
Mercator.

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
titan  
View profile  
 More options Aug 3 2012, 9:21 am
Newsgroups: comp.lang.idl-pvwave
From: titan <thunder...@inwind.it>
Date: Fri, 3 Aug 2012 06:21:47 -0700 (PDT)
Local: Fri, Aug 3 2012 9:21 am
Subject: Re: shifted .kml created with IDL

Ok David,
at least I can say that the code should work fine.. now I can move on to understand where is the trick in my geotiff image.

thanks a lot for your answers, they were all very useful
cheers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »