Create kml file to display al bitmap vertically in Google Earth

555 Views Asked by At

I have seen examples where it is possible to display a bitmap as a vertical profile in Google Earth. Like this:

Vertical profile in google Earth

However, I have not been able to find any kml/kmz examples of this. Does anyone have a simple example of how to do this?

Does it include using the dae (collada) file format too?

3

There are 3 best solutions below

1
On

One method to do this would be to use a KML "Photo Overlay". They are designed to place landscape photographs vertically in the world, so that they can be viewed with the Earth terrain & imagery as matching background. You could use that technique to place images like these on vertical planes. There is a basic tool in Earth Pro to create Photo Overlays (Add menu >> Photo). Or you can create them manually or programmatically by writing the appropriate KML (reference links below), though it can get pretty complex with all the placement and field of view parameters. Also note that Photo Overlays work in Earth Pro (Earth v7.x), but do not currently work in Earth for web & mobile (Earth v9.x).

You could also do this using 3D models (yes, collada based) where you have a model representing your vertical plane(s), and the images as textures on the models. 3D models also only work in Earth Pro at this time. Which technique is easier will depend on the tools and skills you have available.

https://developers.google.com/kml/documentation/photos https://developers.google.com/kml/documentation/kmlreference#photooverlay

6
On

My PhotoOverlay example is just here.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
    <Document id="7">
        <visibility>0</visibility>
        <PhotoOverlay id="8">
            <name>PhotoOverlay Test</name>
            <visibility>0</visibility>
            <Camera>
                <longitude>-122.3599987260313</longitude>
                <latitude>47.62949781133496</latitude>
                <altitude>100</altitude>
                <heading>-90</heading>
                <tilt>90</tilt>
                <roll>0</roll>
            </Camera>
            <Icon id="10">
                <href>foo.png</href>
            </Icon>
            <ViewVolume>
                <leftFov>-45</leftFov>
                <rightFov>45</rightFov>
                <bottomFov>-45</bottomFov>
                <topFov>45</topFov>
                <near>20000</near>
            </ViewVolume>
        </PhotoOverlay>
    </Document>
</kml>
0
On

My kml example using collada is here. You have to prepare your_prepared_square.dae and your_prepared.png in same folder. The square size is 1m x 1m. This model is scaling base.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
    <Document id="1">
        <Placemark id="2">
            <name>My billboard</name>
            <Model id="3">
                <altitudeMode>absolute</altitudeMode>
                <Location>
                    <longitude>140.037</longitude>
                    <latitude>36.84895</latitude>
                    <altitude>500</altitude>
                </Location>
                <Orientation>
                    <heading>90</heading>
                    <tilt>0</tilt>
                    <roll>0</roll>
                </Orientation>
                <Scale>
                    <x>1</x>
                    <y>10000</y>
                    <z>3500</z>
                </Scale>
                <Link id="4">
                    <href>your_prepared_square.dae</href>
                </Link>
                <ResourceMap>
                    <Alias>
                        <targetHref>your_prepared.png</targetHref>
                        <sourceHref>mapping.png</sourceHref>
                    </Alias>
                </ResourceMap>
            </Model>
        </Placemark>
    </Document>
</kml>

And mapping.png is texture filename in the collada model. This has to be defined in the model. following fragment is a part of your_prepared_square.dae. But you don't need to prepare mapping.png. KML replaces it to your_prepared.png.

 :
 :
 <library_images>
    <image id="texture" name="texture">
      <init_from>mapping.png</init_from>
    </image>
  </library_images>
 :
 :

folllowing image is applied this method.

enter image description here