KML is supported as an output format when using the REST API in the following ways:
Note that KML options are not available when services are secured using token based authentication.
The following options are available for requesting data in KML format:
f
parameter in the URL. The response is a KML document wrapped in a KMZ file. It may be a footprint or the result of an operation. In the Services Directory, this option is used when you click the "View Footprint In: Google Earth" link.
In the following example, a request is made for a KML footprint of a map service of Portland, Oregon:
For more information about format output options, see Output formats.The following is a URL request for a map service returned as a KML Region:
The next example shows a URL to an image service. Image services are always returned as ground overlay KML:
For more information about KML Region or ground overlay documents, see KML Image for map services and image services.Note that a server administrator can limit or disable some options. For example, the administrator may have disabled the ability for the server to return vector features, or the administrator may have set a limit on how many KML features the server can return.
For more information, see Generate KML (Operation).