views:

140

answers:

1

I'm building a KML file to use as a map layer in Google Earth and whatever else handles KML/KMZ files.

What I want to do is this: Display a number of bitmap images such that each is stretched to fit into a specified quadrilateral, where the first vertex of the quadrilateral specified would, for example, be the top-left corner of the bitmap, the next vertex would be where the top-right corner fits, and so on. Is there a (relatively) simple way to do this? If distorting/stretching the image isn't possible in any simple way, just displaying it at a specified location, scaling and rotation would be acceptable.

Update: To clarify: Given a set of four geospatial coordinates that form a quadrilateral, I'd like to take a rectangular bitmap (either via a specified URL or included in a KMZ file) and lay it onto the map such that its four corners line up with the four corners of the aforementioned quadrilateral. If it's not possible to distort an image to fit any quadrilateral, it would be sufficient to just specify position, rotation and size. Hopefully that's a little clearer.

Any help would be much appreciated.

Thanks!

+3  A: 

Figured it out; you use a LatLonQuad:

<GroundOverlay>
    <name>Example Image Overlay</name>
    <color>87ffffff</color>
    <Icon>
        <href>mypicture.jpg</href>
        <viewBoundScale>0.75</viewBoundScale>
    </Icon>
    <gx:LatLonQuad>
        <coordinates>
        -115.8993079806076,36.72147153334678,0
        -115.8990441694222,36.72500067085463,0
        -115.9002128356738,36.72511090523616,0
        -115.9005214644026,36.72164386079184,0
    </coordinates>
    </gx:LatLonQuad>
</GroundOverlay>
DanM