1

I'm using SimpleKML to create a list of ~600 geotagged pictures (where each pin has an image as the description. So I click one of the pins on the map and it shows the picture I took at that coordinate).

The KMZ file is roughly 1GB and doesn't seem to open in Google Earth Pro. I've been looking around online and it seems that it may be too large of a file size to open. However, I have seen that Earth is capable of showing over a million coordinates. If I don't add the images as the description, the file shrinks to ~5kb and is able to work.

How can I open the file keeping the images as the description? Is there indeed an upper limit to file size?

(Note: I'm not sure if it's a Python/programming question, or Google Earth question so for now I am assuming it's a generic Google Earth question).

CodeMonkey
  • 22,825
  • 4
  • 35
  • 75
BruceWayne
  • 22,923
  • 15
  • 65
  • 110
  • The size of the .kmz file is 1GB or the uncompressed content is 1GB? - big difference. GE is only a 32-bit app and can only access 2GB of memory. Have you tried first to just access the uncompressed files as-is without putting it in a KMZ file? Google Earth is just going to uncompress it when it tries to open it. What about a KML file with only 100 or 300 photos - does that work? – CodeMonkey Sep 22 '17 at 21:43
  • @JasonM1 - Not sure if it's compressed or not. In the File Explorer, the `.kmz` file is ~2GB. I'll try later today to do just 100/300/500 photos and see if that helps. – BruceWayne Sep 22 '17 at 21:51
  • Maybe image links? According to the reference descriptions can contain HTML and ` Links to image files on the local filesystem are always allowed, if contained within an tag.` – rheitzman Sep 25 '17 at 19:43
  • @rheitzman - I'm using image links. I'm adding via `point.description = 'picture'` which I believe is what you're referring to, yeah? – BruceWayne Sep 25 '17 at 19:52

1 Answers1

2

Google Earth Pro has both 32-bit and 64-bit versions. The 32-bit version limits access to 2GB memory and A 1-2 GB KMZ file is most likely larger than 2 GB when uncompressed which exceeds the memory available to Google Earth.

Google Earth itself can handle many GBs of data but not all at once. The only way to make that much data available to Google Earth is to have the KML file load a subset of the pictures at a time.

If the geotagged pictures are physically separable then you could create multiple KMLs where each KML represents a region and the photos in that region. Each KML file can be referenced by a parent KML file via a NetworkLink. NetworkLink would require a Region element to specify when to load the KML file with the geotagged pictures in a given region. The Region contains a bounding box (<LatLonAltBox>) that describes an area of interest defined by geographic coordinates and altitudes. In addition, a Region contains a LOD (level of detail) extent that defines a validity range of the associated Region in terms of projected screen size in pixels.

Your root KML would be structured like this:

<Document>
 <NetworkLink>
  <Region>
    ...
  </Region>
  <Link>
    <href>1.kml</href>
  </Link>
 </NetworkLink>
 ...
</Document>

Getting the Regions to work takes trial and error. You can measure the "screen" pixels dimensions for Regions with this KML screen ruler.

Here are two tutorials for working with Regions:

Alternatively, you can create several KMZ files each with a subset of geotagged pictures. You could tie the sub KMZ files together with a parent KML file with radioFolder List style and NetworkLinks with each of the KMZ files. This allows you to select any of the sub-KMZ files with photos but only one at a time to prevent memory overload.

<Document>
    <Style id="radioStyle">
        <ListStyle>
            <listItemType>radioFolder</listItemType>
        </ListStyle>
    </Style>
    <styleUrl>#radioStyle</styleUrl>
    <NetworkLink>
        <visibility>0</visibility>
        <Link>
            <href>1.kml</href>
        </Link>
    </NetworkLink>
    <NetworkLink>
        <visibility>0</visibility>
        <Link>
            <href>2.kml</href>
        </Link>
    </NetworkLink>
</Document>

If you want one of the KML files to be viewable by default when opened in Google Earth then change its visibility to "1" and leave the others as "0".

The SimpleKML API supports networklinks, Regions, KMZ, etc. so it is best to experiment and try different KML output to see what works better.

CodeMonkey
  • 22,825
  • 4
  • 35
  • 75
  • Ooh I'll have to look in to how to create `NetworkLinks` with Python. I think that answers it! Cheers! – BruceWayne Sep 23 '17 at 14:43
  • Just to comment/clarify - it looks like even if I create ~6 KMZ files (say ~400MB each), I can't load them all into Earth without it crashing. So it's not just that it can't handle *single* files larger than say 2GB, it's not able to handle *total* files that large, all loaded and "showing" at once. (Note: I think, as your last para. states, the next move is to tie those 6 KMZ files together with NetworkLinks/radioFolder List style). – BruceWayne Sep 24 '17 at 23:03
  • 1
    right, it's not the issue of a single file < 2GB. The total memory accessible to GE is 2GB so the total amount of data loaded at any time must be less than 2GB either through NetworkLinks and regions or single manual selection via radioFolder style. – CodeMonkey Sep 25 '17 at 14:59