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

Home » Public Forums » archive » Image Overlays on Google Earth with KML Files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Image Overlays on Google Earth with KML Files [message #81876] Tue, 30 October 2012 15:36 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I don't get really excited about IDL too much these days.
Except, of course, when a new release comes out, but those
moments are fleeting and almost immediately followed by
disappointment, so maybe they don't count.

I'm excited today, though.

Someone asked a week or so ago about creating KML files
from IDL, so that they could display them on Goggle Earth.
When I read the request I immediately realized how such a
capability would be valuable for the work I am doing, too.
So, I have been thinking about it ever since.

KML files are hierarchtical, so I immediately thought
about an object hierarchy approach. Over the weekend,
I started to put some of this object framework together.
There is a LOT more work to do, but I built just enough
to be able to create ground overlays from images in IDL.
Such images are draped onto the terrain map in Google Earth.

The exciting thing to me (as always!) is how nicely the
Coyote Graphics routines just lend themselves to doing
the next, new thing. It's like magic sometimes. But small
tweaks to the Coyote map routines to return map boundaries
in Goggle Earth preferred formats, and a new routine to
warp images in other map projections to the Google Earth
map projection (otherwise images won't align with Google
Earth continental boundaries, etc.) was almost too easy.

I also wrote a cgImage2KML program so those of you
terrified of objects can just ignore the darn things.
Who cares what's going on under the hood! :-)

The cgImage2KML program can use image variables, etc.
But, most of my images are in GeoTiff files, so the
routine is written to gather information from the
GeoTiff file directly. If you want to try this out,
you can use the AVHRR NDVI image from my web page.
You can find it here:

http://www.idlcoyote.com/data/AF03sep15b.n16-VIg.tif

Here is how you create a KML file with it. I'm using
a color table and displaying the image with 50%
transparency. The KML file will be named avhrr_ndvi.kml.

cgImage2KML, GeoTiff='AF03sep15b.n16-VIg.tif', Min_Value=0, $
CTIndex=11, /Brewer, /Reverse, Transparent=50, $
Filename='avhrr_ndvi.kml', $
Description='AVHRR NDVI Data from Africa'

Once the file is created, simply start Google Earth and open
the file. I haven't implemented a "goto" capability yet,
so you will have to rotate the Earth to see Africa, probably.
But, I'll have this fixed by tomorrow, no doubt.

Did you ever see anything more beautiful!? And perfectly aligned!
Wow! Blows me away.

You will need new files:

http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip

I have LOTS of ideas for more functionality. If you have ideas of your
own, let me know. Check back often because I am sure there are bugs
and I know there will be many, many changes as I start to use these
programs at work.

Documentation for all these routines is available on-line:

http://www.idlcoyote.com/idldoc/cg/index.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Image Overlays on Google Earth with KML Files [message #81936 is a reply to message #81876] Thu, 08 November 2012 05:50 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
dave poreh writes:

> That is cool. How about vector data like this:
>
> 1.1602939e+01 4.4446562e+01 2.7623378e+01
> 1.1604566e+01 4.4446339e+01 1.4114955e+01
> 1.1604247e+01 4.4446755e+01 3.8753678e+00
> 1.1605390e+01 4.4447162e+01 1.9553264e+01

I'm just developing things for the free version of
Google Earth at the moment.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Image Overlays on Google Earth with KML Files [message #81939 is a reply to message #81876] Thu, 08 November 2012 01:04 Go to previous messageGo to next message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Wednesday, November 7, 2012 9:16:01 PM UTC-8, David Fanning wrote:
> Craig Markwardt writes:
>
>
>
>> You make the making of beautiful graphics with IDL seem natural.
>
>
>
> Yes, natural and FAST! ;-)
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

That is cool. How about vector data like this:

1.1602939e+01 4.4446562e+01 2.7623378e+01
1.1604566e+01 4.4446339e+01 1.4114955e+01
1.1604247e+01 4.4446755e+01 3.8753678e+00
1.1605390e+01 4.4447162e+01 1.9553264e+01
1.1608997e+01 4.4447025e+01 -3.7990320e+01
1.1607682e+01 4.4446983e+01 -1.4271144e+01
1.1609584e+01 4.4447007e+01 -1.8167818e+01
1.1610609e+01 4.4447495e+01 -4.0033611e+01
1.1608824e+01 4.4447496e+01 1.9855096e+01
1.1609659e+01 4.4447633e+01 3.4076399e+01
1.1608224e+01 4.4447478e+01 -3.9572417e+01
1.1610918e+01 4.4447906e+01 -3.9880344e+01
1.1607643e+01 4.4447524e+01 -3.5140565e+01
1.1610039e+01 4.4447860e+01 2.0528444e+00
1.1607069e+01 4.4447474e+01 2.4701208e+01
1.1611104e+01 4.4447429e+01 3.8922598e+01
1.1608838e+01 4.4447587e+01 2.6964236e+01
1.1612929e+01 4.4447453e+01 2.0973375e+01
1.1611593e+01 4.4447311e+01 -1.6856587e+01
1.1611646e+01 4.4447415e+01 -2.9453914e+01
1.1611620e+01 4.4447781e+01 8.2054304e+00
1.1613786e+01 4.4448333e+01 -6.4471234e+00
1.1614280e+01 4.4447748e+01 1.4550981e+00
........... ............ .......

Cheers,
Dave
Re: Image Overlays on Google Earth with KML Files [message #81940 is a reply to message #81876] Wed, 07 November 2012 21:16 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> You make the making of beautiful graphics with IDL seem natural.

Yes, natural and FAST! ;-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Image Overlays on Google Earth with KML Files [message #81942 is a reply to message #81876] Wed, 07 November 2012 20:06 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
That is really cool David!

You make the making of beautiful graphics with IDL seem natural. I have to work at it. :-)

Craig

On Friday, November 2, 2012 6:02:27 PM UTC-4, David Fanning wrote:
> Folks,
>
>
>
> For those of you interested in displaying IDL images on
>
> Google Earth (I guess this would be every one doing any
>
> kind of physical science on the Earth!), I have written
>
> a short article on how I use my new cgImage2KML program
>
> to write KML files that can be loaded in Google Earth.
>
>
>
> I used images from articles on my web page to give you
>
> a feel for what kinds of things can be done.
>
>
>
> You can find the article here:
>
>
>
> http://www.idlcoyote.com/cg_tips/image2kml.php
>
>
>
> You will need today's (4PM Colorado time) Coyote Library
>
> to run the code. :-)
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Image Overlays on Google Earth with KML Files [message #81988 is a reply to message #81876] Fri, 02 November 2012 15:02 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

For those of you interested in displaying IDL images on
Google Earth (I guess this would be every one doing any
kind of physical science on the Earth!), I have written
a short article on how I use my new cgImage2KML program
to write KML files that can be loaded in Google Earth.

I used images from articles on my web page to give you
a feel for what kinds of things can be done.

You can find the article here:

http://www.idlcoyote.com/cg_tips/image2kml.php

You will need today's (4PM Colorado time) Coyote Library
to run the code. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Image Overlays on Google Earth with KML Files [message #82093 is a reply to message #81876] Wed, 14 November 2012 07:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sverre Solberg writes:

> This will be a very valuable tool if it works out. However, I have a
> basic question about this. How do you import the data into Google
> Earth? Well, from the description I see that I should just use
> 'open file' and then import the klm file. But that doesnt work
> for me. I'm confused about the two files (klm and png). Are
> the klm file referring to the png in some way?

The klm and png file will need to be in the same directory
when you open the KLM file in Goggle Earth. Yes, the KLM
file is referring to the PNG file.

> It just displays the area with a red frame and a cross inside.

Yes, this is what happens when the image file can't be found.

> I have imported other klm files into Google E. and that works
> perfectly ok with just one file, no additional jpg/png etc.
> I'm probably missing some very basic stuff here ...

You probably opened a KMZ file. This is a zip file containing
the klm file and any other files the KLM file references. I
plan to add the ability to create KMZ files soon, but I
haven't figured out how to access the zip functionality
in a general way on different machines yet.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Image Overlays on Google Earth with KML Files [message #82094 is a reply to message #81936] Wed, 14 November 2012 07:35 Go to previous message
Sverre Solberg is currently offline  Sverre Solberg
Messages: 18
Registered: February 2005
Junior Member
This will be a very valuable tool if it works out. However, I have a basic question about this. How do you import the data into Google Earth?
Well, from the description I see that I should just use 'open file' and then import the klm file. But that doesnt work for me. It just displays the area with a red frame and a cross inside. I'm confused about the two files (klm and png). Are the klm file referring to the png in some way? I have imported other klm files into Google E. and that works perfectly ok with just one file, no additional jpg/png etc. I'm probably missing some very basic stuff here ...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL sav files and console output (IDL 8.2)
Next Topic: Re: Make the plots invisible

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

Current Time: Wed Oct 08 15:05:47 PDT 2025

Total time taken to generate the page: 0.00670 seconds