Nesting KMZ files

家住魔仙堡 提交于 2019-12-17 20:52:42

问题


Is it possible to create one KMZ file that is composed of several smaller KMZ files? I would prefer to not have to manually merge the actual KML entities, but I will if that's the only option.


回答1:


A KMZ file can have any number of inner KML files (NOT KMZ files). But the first entry in the KMZ file must be the root KML file (typically named doc.kml), which may include network links with references to other KML or KMZ files. Several inner KML files, for example, could reference a shared style (in another KML file) via relative URLs.

The inner KML files can nest to any level of depth to other KML files so you can create a hierarchy of nested KML files.

KMZ files within KMZ files is not supported in Google Earth so that is not recommended. If you want a root KMZ file to reference other sub-KMZ files then the sub-KMZ files should not be sub-entries of the root KMZ file but located at the same relative context in the web server or file system.

Here is what a root KML file in a KMZ file would look like that includes at least two sub-KML files.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
        <NetworkLink>
            <Link>
                <href>test1.kml</href>
            </Link>
        </NetworkLink>
        <NetworkLink>
            <Link>
                <href>test2.kml</href>
            </Link>
        </NetworkLink>
        ...
    </Document>
</kml>

You can set visibility tag to 0 or add radio folders to selectively load inner KML files or add Region elements to load when given region is active. This would be needed to scale to lots of Features to achieve good performance.

Reference: https://developers.google.com/kml/documentation/kmlreference#networklink




回答2:


You could create a network link to your other kmz files.



来源:https://stackoverflow.com/questions/2109555/nesting-kmz-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!