3D Robotics

Utility for merging mapped areas in Google Earth


One of the great things about using drones to map areas is that you can do the same mapping mission many times, showing change over time. But it's sometimes hard to merge that data into Google Earth for viewing. Thankfully, the team at the Google Earth blog have created a Java utility to help you do that. 

For the ‘Sorted by country’ section, we want to combine the new outline with the old outline removing the shared border.

We already have the outline of the old extent of the 3D imagery (region 1) and we need two new outlines, one of just the newly covered area (region 2) that we use in the timeline and one showing the total area now covered that is used for the ‘Sorted by country’ section. So we want two new Polygons, one using segments 3 and 4 and another using segments 3 and 5.

It is possible to draw one of the new Polygons by starting with the existing polygon (1) and deleting the points in either segment 4 or 5 and then drawing segment 3. However, it still means that at least one segment of an outline needs to be redrawn. What would be ideal is to take a segment of the already existing outline and combine it with segments of the newly covered area outline. However Google Earth has no easy way to do this. So we have written a bit of JavaScript to accomplish the task and we thought that it might be something that other people who work with KML regions might find useful so we decided to share it.

To use our merger utility, first make sure you have two Polygon outlines that share a common border. Remove all points from the common border except the two at the ends of the shared border for each Polygon. Save the two polygons either in two separate KML files or a single KML file. Upload them below, then click the ‘Download merged Polygon’ button. Open the downloaded file in Google Earth.

It has not yet been tested very thoroughly so if you find any bugs please let us know in the comments. One problem that we encountered is that Google Earth Polygons may go clockwise or counter clockwise, so when combining two polygons by simply concatenating the list of points, it is possible to get a figure 8. We have tried to check for this and automatically correct it.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones