banner



How To Animate A Track In Google Earth

Animative a line tin add a neat element to your Google Earth Tour. Here is an example of a line animative a path:

Path animative in Google Earth


To animate a line, you should be comfy with the following things:

1. Opening a KML file, cutting, pasting code, looking for errors

2. Using a text editor similar SCiTE  (PC) or TextWrangler (MAC), both free

3. Using the 'find and replace' tool

iv. If y'all find whatsoever ways to improve this procedure, delight email me at ahecht@google.com and I will incorporate them!

Animative a Path is merely editing characteristic visibility, except you're turning on a agglomeration of tiny Path segments sequentially. The process beneath is the most bones mode of creating a line animation, and thus a little more than easily on than creating information technology through the API with Java.

Part 1: Creating a Path that you lot will utilise in the animation - the path to be animated needs to be created in a specific fashion to exist used in a tour.

 i. Create the Path in segments in Google World - Add a folder and create the Path segments you want to animate. Proper name them numerically.

Folder construction Paths

Considerations:

  • This is a long process; exist sure to relieve the folder to 'My Places' and 'Salve My Places' often.
  • Try to get the beginning and end of each Path segment close together to create a smooth animation.
  • Try to go along Path segments like length for a shine looking animation.
  • The smaller the segments, the more detailed the animation will announced.

ii. Save the Binder equally a KML  - You will extract some of the KML out of this file

Saving a KML

3. Open the KML in a text editor- in guild to for the Path segments KML to work properly in an animation, it has to exist edited a chip

4. Find and Replace the following data:

Detect and replace: <Placemark>

With: <Placemark id ="-----" >

Notice and replace: <styleUrl> #m_ylw-pushpin </styleUrl>    ( #m_ylw-pushpin may vary)

With: <styleUrl> #line-style </styleUrl>

Find and replace: </proper name>

With : </name> <visibility> 0 </visibility>

The path chunks will await like this:

Before:

<Placemark>

<proper name> 1 </proper name>

<styleUrl> #m_ylw-pushpin </styleUrl>

<LineString>

<tessellate> one </tessellate>

<coordinates>

14.20695788474047,40.8154896676023,0 14.20658768403162,forty.81540606262579,0

</coordinates>

</LineString>

</Placemark>

After:

<Placemark id ="-----" >

<proper name> 1 </name> <visibility> 0 </visibility>

<styleUrl> #line-style </styleUrl>

<LineString>

<tessellate> i </tessellate>

<coordinates>

14.20695788474047,40.8154896676023,0 xiv.20658768403162,40.81540606262579,0

</coordinates>

</LineString>

</Placemark>

Do this for all Placemarks at once by using "Replace All" or similar with the Find and Supervene upon tool.

v. Proper name Placemark ID's appropriately - in order for the script to know what Path segment to plough on, they must be named correctly

Match the <Placemark id ="-----" > to match the number in the <name> 1 </name>

<Placemark id ="1" >

<name> 1 </proper noun>

....

<Placemark id ="2" >

<proper name> 2 </name>

                        ....

<Placemark id ="iii" >

<name> 3 </proper noun>

                        ....

    etc.

There is a sample KML at the bottom of this page calledpath-segment-edited.kml that you lot tin take a expect at likewise.

6. Examination the KML Path segment file -To test if everything is correct, Save the new Path segment KML and open up it in Google Earth. The Paths should all be white and thin, every bit we have non identified the <styleUrl> #line-style </styleUrl>  yet. If information technology does not open or something looks wrong, in that location may be an fault in your Path segment KML file.

Role 2: Consummate the Template File - The template file has two parts

  • The top of the KML file controls when the lines come on
    • Path segments are turned on with the

      <gx:AnimatedUpdate>

       tags
    • The

      <gx:AnimatedUpdate>

       tags are separated past the<gx:Wait> tags
    • All of the

      <gx:AnimatedUpdate>

       tags are independent by

      <Tour>

       tags at the top and lesser of this part of the KML
  • The bottom of the KML file holds the Path data
    • These are the <coordinates> or the LAT,LONG of the points on the Path
    • Each<Placemark> tag holds the information to 1 Path segment
    • Each<Placemark> tags is referenced in a higher place past the

      <gx:AnimatedUpdate>

       tags

The KML looks roughly similar this, notes are in orange :

<(KML stuff that's in every KML file)>

    <LookAt>

        (lat,long,alt,etc.) - the opening view

    </LookAt>

    <Tour>

        <gx:AnimatedUpdate> - Path segment one plow on

            <Wait> - interruption a fraction of a 2nd

        < gx:AnimatedUpdate > - Path segment two plow on

            <Look> - break a fraction of a second

        < gx:AnimatedUpdate > - Path segment three plough on

            <Wait> - pause a fraction of a second

        <etc.>

    </Tour> - animating over

        <Placemark ID="ane"> - Path segment one information

        <Placemark ID="2"> - Path segment 2 information

        <Placemark ID="3"> - Path segment 3 information

        <etc.>

</(KML stuff that's in every KML file)>

7. Open the Template File  - At the bottom of this folio yous will discover the line-animation-template.KML  file that you tin can put your Path information into to save time.

  • Notes are added in yellow and look like this: <!-- helpful notes -->
  • Yous can as well open up the line-animation-template-simplified.KML file and see the construction simplified into 3 Path segments.
  • Be sure not to remove whatever < or / or your file volition not piece of work properly.

8. Insert your Path segment information into the template file  - copy all the Path segment Placemark data into the template file. This can be done all at once past coping everything from the commencement <Placemark id ="1" > to the last </Placemark > and  paste it into the template.

Open in YouTube, and full screen for full result.

9. Delete unused AnimatedUpdate tags - The template file has 180 <gx:AnimatedUpdate>  tags in the <Tour> . They look like this:

<gx:AnimatedUpdate>

<Update>

<Change><Placemark targetId ="fifty" ><visibility> 1 </visibility></Placemark></Change>

</Update>

</gx:AnimatedUpdate>

<gx:Look><gx:elapsing> 0.02 </gx:duration></gx:Await>

If your Path segment file has fewer, yous can delete the <gx:AnimatedUpdate>  tags you lot don't need. Likewise, if you have more than than 180, you can Copy/Paste more.

10. Change the style of the Path - At the top of the template KML, you can change the color and width of the path to suit your needs:

<Style id ="Line-fashion" >

<LineStyle>

<color> bf00aaff </color> <!-- this is the color of your path -->

<width> 5 </width> <!-- this is the width of your path -->

</LineStyle>

</Style>

To go a new colour, brand a new Path in Google Earth, color it how yous'd like, and extract the AA##AAAA from the KML.

eleven. Speed upwards or boring down the animation - use Find/Replace All to change the <gx:Wait>  to make the bout faster or slower

Fast <gx:Look><gx:duration> 0.02 </gx:duration></gx:Await>

Med <gx:Await><gx:duration> 0.05 </gx:duration></gx:Wait>

Irksome <gx:Expect><gx:duration> 0.10 </gx:duration></gx:Wait>

Y'all tin experiment with these settings to see what works all-time for y'all as Find/Replace is pretty fast and easy.

12. Set the camera view - Just similar calculation the line style, set a photographic camera view by Copy/Pasting the KML into the Template file.

  • Put a Placemark at the desired view
  • Save the Placemark equally a KML
  • Open up the KML
  • Copy the <LookAt> data to the Template file

<LookAt> information includes all this:

<LookAt>

<longitude> 14.20830952335358 </longitude>

<latitude> 40.8143508364044 </latitude>

<altitude> 0 </altitude>

<heading> -12.36466847352015 </heading>

<tilt> 36.96541540083902 </tilt>

<range> 5026.432628192288 </range>

<gx:altitudeMode> relativeToSeaFloor </gx:altitudeMode>

</LookAt>

Copy the whole matter and paste over the<LookAt> data at the top of the template file.

Source: https://sites.google.com/site/kmltouring/animating-a-line

Posted by: vinsonpaun1939.blogspot.com

0 Response to "How To Animate A Track In Google Earth"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel