| Label | Explanation | Data Type |
Input KML File
| The .kml or .kmz file that will be converted. | File; Workspace; KML Layer |
Output Point Feature Class
(Optional) | The output point feature class | Feature Class |
Output Line Feature Class
(Optional) | The output line feature class | Feature Class |
Output Polygon Feature Class
(Optional) | The output polygon feature class | Feature Class |
Summary
Converts a .kml or .kmz file to the appropriate point, polyline, or polygon outputs.
Usage
This tool will automatically detect the feature types in the KML and create the appropriate output feature classes based on feature type. The tool can also output to shapefile, memory workspaces, and any geodatabase format.
When the tool add the outputs to the map, the output will maintain the symbology of the input .kml or .kmz file.
This tool supports importing KML attributes in Extended Data node to feature class attributes fields.
This tool uses a different KML conversion parser than the KML To Layer tool. The output of these tools can be different. Additionally, the KML To Layer tool doesn't support ground overlay rasters and nested network links.
Parameters
arcpy.conversion.KMLToGeodatabase(in_kml, {out_points}, {out_lines}, {out_polygons})| Name | Explanation | Data Type |
in_kml | The .kml or .kmz file that will be converted. | File; Workspace; KML Layer |
out_points (Optional) | The output point feature class | Feature Class |
out_lines (Optional) | The output line feature class | Feature Class |
out_polygons (Optional) | The output polygon feature class | Feature Class |
Code sample
Converts a .kmz file to a point feature class in the Python window.
import arcpy
arcpy.conversion.KMLToGeodatabase(
in_kml=r'C:\kmls\KMZ_point.kmz',
out_points=r'C:data\gisdata.gdb\fromkmls'
)Converts a .kmz file to a point memory feature class in the Python window.
import arcpy
arcpy.conversion.KMLToGeodatabase(
in_kml=r'C:\kmls\KMZ_point.kmz',
out_points="memory\pointkml"
)Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes