KML To Layer (Conversion)
Summary
Converts a KML or KMZ file into a feature class along with a layer file derived from the source renderer information inside the KML/KMZ.
Usage
This tool creates a file geodatabase containing a feature class within a feature dataset. The feature class name will have _point, _line or _polygon appended to the end, based on output feature type. At the same folder level as the file geodatabase will be a layer (.lyr) file which will render the output features similar to the original KML input (features inside a group layer).
-
Input up to KMZ version 2.2 supported.
Output will be generated in the WGS84 coordinate system. The output features can be reprojected to another coordinate system if desired using the Project tool.
-
Note: Not all KML/KMZ files provide valid geographic features for use within a GIS. Some files, for example, only store images with approximate worldly locations, not georeferenced imagery. Some files may not conform to the OGC KML standard and will not translate into geographic features as expected. Manual validation of KML/KMZ files may be required before using this tool.
Syntax
Parameter | Explanation | Data Type |
in_kml_file |
The KML or KMZ file to translate. | File |
output_folder |
The destination folder for the File Geodatabase and layer (.lyr) file. | Folder |
output_data (Optional) |
The name of the output File Geodatabase and layer file (.lyr). Defaults to the name of the input KML file. | String |
Code Sample
Converts a KMZ file into an FGDB from the Python window.
import arcpy arcpy.KMLToLayer_conversion(r'C:\kmls\earthquakes.kml',r'C:\gisdata\fromkmls','earthquake_09')