blankblank blank




High-Resolution Sea Level Rise Flooding Animations In Google Earth



Creating a high-resolution static sea-level rise image for a specific sea level rise value, and displaying it in Google Earth, is fairly straightforward (see these three posts for the details):

geoverlay1

But creating an animated version viewable in Google Earth, comparable to this animation created in MicroDEM

… takes a bit more work, including diving into the KML code. But while it’s a bit time-consuming, it’s not that hard, and the results are worth it:

Addendum: Do read the rest of this post, but also check out the next post in the series as well for even cooler effects.

Step 1: Generating the images for the animation.

Follow the steps in this post for creating a sea level rise flood map in MicroDEM. You could create the flooding maps for every level one at a time, but that’ll get tedious very quickly. Instead, create a full animation from the lowest water level to the highest water level by entering the desired low level, reservoir top and interval in the Flooding Form:

floodingform1

The smaller the interval, the smoother the final animation will be, but the more time it will take to calculate the images, and assemble them into an animation. For the animation I’m creating, I’m going from 0 meters to 12 meters by an interval of 0.2 meters, for a total of 61 images. The 12-meter figure is the “doomsday” flooding scenario from “An Inconvenient Truth”, where the Greenland ice cap has melted completely and the West Antarctic Ice Shelf has collapsed; unlikely, but possible. After entering the parameters, I click on movie, and then wait until the images are created, and the animation is displayed. This can take a while.

All of the images used to create the animation can be found in MicroDEM’s movie data directory (usually C:\mapdata\movies). They will be saved as bitmap images, with the filenames depending on the flooding level:

LEVEL0.BMP – Sea level at 0, i.e. no rise

LEVEL0.2.BMP – Sea level rise of 0.2 meters

LEVEL0.4.BMP – Sea level rise of 0.4 meters

LEVEL12.BMP – Sea level rise of 12 meters

A total of 61 images in all, looking like this one as an example:

floodedblank3

You should copy and paste the files into a different directory, since if you run another flooding simulation in MicroDEM, they’ll be overwritten with new files. As described in this post, you’ll also need to get the geographic bounds of these images (latitude and longitude) to help align them properly in Google Earth.

Step 2: Convert all the BMP images to GIF images, with the color white made the transparent color.

This will be a repeat of the process used in this post, where the program IrfanView was used to convert images to GIF format, specifying white as the transparent color so that it wouldn’t obscure the view of what was underneath. You could process the images one by one, but thankfully IrfanView has a batch conversion mode, available from the File => Batch Conversion menu:

batchconversion

Make sure that the Output format is set as GIF, and under Options make sure that “Save transparent color” is checked, and “Choose transparent color during saving” is selected. Click on Start, and the files will be processed into GIF format, with you specifying for every file which color is the transparent one (white in this case). You’ll wind up with 61 GIF files, each with the original filename prefix (LEVEL0, LEVEL0.2, etc).

Step 3: Start up Google Earth, and create the baseline KML data file

Open up Google Earth, and create a folder to put the graphic files into (right-click, choose Add=> Folder); I’ll call mine “Manhattan Flooding”. Then right-click on the folder, select Add=> Image Overlay, and open up a single GIF file created above; position it using the latitude/longitude bounds as described in this post. I would recommend using the image that shows the maximum amount of flooding, LEVEL12.GIF for this example. The reason is that you also need to set the transparency of the overlay at this point, and the image with the greatest amount of flooding area is the best one to use at this stage. Here’s the LEVEL12.GIF image loaded into Google Earth, and set to what I think is a reasonable transparency:

level12

You should also give this image overlay an appropriate name, like “12.0 meters”. Right-click on the folder you created above, and save it as a KML file (not KMZ), then open it in your favorite text editor:

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://earth.google.com/kml/2.1″>
<Folder>
<name>Manhattan flooding</name>
<open>1</open>
<GroundOverlay>
<name>12.0 meters</name>
<color>70ffffff</color>
<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL12.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>
</Folder>
</kml>

Step 4: Associate time data with the image, and add all the other images to the KML file

Animations in Google Earth are time-based, so even though this will be animation based on sea-level rise, we’ll have to assign a timespan to every image to create a sea-level rise animation. The most logical way to do that, for me anyway, is to assign each graphic layer a year’s worth of time, with 2000 being the year of no sea level rise, 2001 0.2 meters of sea level rise, and so on to 2060 corresponding to 12 meters of sea level rise. The exact date/time you assign to each graphic image has to be sequential, and equal in length, but the exact value doesn’t matter. For this, I’ll use KML’s Timespan tag:

<TimeSpan>
<begin>2060-01-01</begin>
<end>2060-12-31</end>
</TimeSpan>

This will specify that this image overlay should be displayed for all days in the year 2060 during the animation. Insert it into the KML file above between the <GroundOverlay> and </GroundOverlay> tags above, like so:

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://earth.google.com/kml/2.1″>
<Folder>
<name>Manhattan flooding</name>
<open>1</open>
<GroundOverlay>
<name>12.0 meters</name>
<color>70ffffff</color>

<TimeSpan>
<begin>2060-01-01</begin>
<end>2060-12-31</end>
</TimeSpan>

<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL12.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>
</Folder>
</kml>

Now the tedium begins. Copy the sections between and including the <Ground Overlay> … </GroundOverlay> tags, and then paste it into between the <open>1</open> and current <GroundOverlay> tags 60 times; you’re making an overlay for every other image that will be used in the animation. Then, starting at the first set of <GroundOverlay> … </GroundOverlay> data, you will sequentially change:

The <name>…</name> data to a sea level rise value(0.0 meters, 0.2 meters, 0.4 meters … 11.8 meters);

The filename in the <Icon> … </Icon> section to the correct one for that level of sea rise (LEVEL0.GIF, LEVEL0.2.GIF, LEVEL0.4.GIF … LEVEL11.8.GIF);

The years in the <TimeSpan> … </TimeSpan> to the correct one for that sea level rise value (2000, 2001, 2002 … 2059).

So the final KML file in the text editor will look something like this:

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://earth.google.com/kml/2.1″>
<Folder>
<name>Manhattan flooding</name>
<open>1</open>

<GroundOverlay>
<name>0.0 meters</name>
<color>70ffffff</color>

<TimeSpan>
<begin>2000-01-01</begin>
<end>2000-12-31</end>
</TimeSpan>

<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL0.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>

<GroundOverlay>
<name>0.2 meters</name>
<color>70ffffff</color>

<TimeSpan>
<begin>2001-01-01</begin>
<end>2001-12-31</end>
</TimeSpan>

<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL0.2.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>

<GroundOverlay>
<name>0.4 meters</name>
<color>70ffffff</color>

<TimeSpan>
<begin>2002-01-01</begin>
<end>2002-12-31</end>
</TimeSpan>

<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL0.4.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>

(… the rest of the overlay data sets in the middle …)

<GroundOverlay>
<name>11.8 meters</name>
<color>70ffffff</color>

<TimeSpan>
<begin>2059-01-01</begin>
<end>2059-12-31</end>
</TimeSpan>

<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL11.8.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>

<GroundOverlay>
<name>12.0 meters</name>
<color>70ffffff</color>

<TimeSpan>
<begin>2060-01-01</begin>
<end>2060-12-31</end>
</TimeSpan>

<Icon>
<href>N:/Manhattan 12-meter/Manhattan 12-meter by 0.2 no label/LEVEL12.gif</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>40.7828</north>
<south>40.6931</south>
<east>-73.93250000000001</east>
<west>-74.0326</west>
</LatLonBox>
</GroundOverlay>
</Folder>
</kml>

If anyone can think of a simple way to automate this process, that would be great! Maybe someday I’ll write up a simple program to do it …

When you’re done, save the KML file, then open it up in Google Earth.

Step 5: Set the animation parameters, and view the results

You should see all of the image overlays listed inside the folder, and you should also see the following new control at the top of the screen:

animation-control

This is the animation control. Click on the play button on the right to play the animation, click on the “pause” button while it’s playing to stop it. The white arrows on the left and right scroll through the animation by large steps. If you click and drag the short white horizontal bar below the time line, you can scroll rapidly through the animation, with the date that corresponds to that position displayed below (AUG 2023 in the example above). The two short arrow symbols define the width of the time span for which the animation overlays are displayed, and you can change that width by clicking and dragging on an arrow. For this animation, though, the two time span arrow should be set to the same position, i.e. time span of zero.

Click on the “check” mark at the left, and you’ll be able to set additional parameters for the animation, most notably the animation speed and repeat mode (Once, Wrap, or Bounce).

So what’s the final result look like? Here’s the animation running in Google Earth, looking down from directly overhead:

And here’s the oblique view of the southern tip of Manhattan shown at the start of the post:

Note: Created with the free 30-second demo version of FRAPS, the best program for capturing animated screen displays at high frame rates. The full version, allowing for unlimited video captures, is $37, a lot cheaper than spending $400 to get animated video capture in Google Earth Pro. There appear to be some capture artifacts (streaking), which you don’t normally get with FRAPS captures – not sure why I get them here. But those streaking artifacts don’t appear in the actual Google Earth view.If you want to try it yourself in Google Earth, here’s a link to the Google Earth KMZ file used to create the animations above.You can turn on the buildings in Google Earth if you want, but you won’t get a realistic view of the flooding because all of the images in the animation above are pinned to the ground. So you’ll see the extent of the flooding amongst the buildings, but you won’t see the sea level rising to cover their lower levels. For that, altitude has to be added to the overlays in the KML file, and that will be covered in the next post in the series; this one is too long already.


Looking for something else? Enter some keywords below, then click "Search".    




6 Responses to “High-Resolution Sea Level Rise Flooding Animations In Google Earth”


  1. 1 Anonymous

    Very good and didactic job.

    Regards from Buenos Aires

  2. 2 Leszek Pawlowicz

    Didactic? Not sure I like that – how about comprehensive?

  3. 3 Ales

    It seems GE have problems with small gif files. My 17kb file looks in GE as an overlay blank white. Where is the problem?

  4. 4 Leszek Pawlowicz

    The size of the GIF file shouldn’t be an issue. If you can email it to me, I can take a look at it.

  5. 5 Leszek Pawlowicz

    Looks like Google Earth has a problem with transparency in large GIF files (bigger than roughly 1000 x 1000); for those sizes, you’ll have to use PNG, which also supports transparency.

  6. 6 Stephanie

    Hi! I was wondering if I could get your permission to use some of your model code and information in a research paper I am writing for a grad class. I would need more contact information for the references portion, but there is a possibility that the paper could end up being published in a journal. Thanks so much!

Comments are currently closed; feel free to contact me with questions/issues.