Skip to content

Instantly share code, notes, and snippets.

@kathysll
Last active November 7, 2019 15:11
Show Gist options
  • Save kathysll/ee7da91f063d89b194ecaad9b0960162 to your computer and use it in GitHub Desktop.
Save kathysll/ee7da91f063d89b194ecaad9b0960162 to your computer and use it in GitHub Desktop.
import arcpy
arcpy.env.overwriteOutput = True
output_folder = r'\\tank1\production\2019\geomni\nc\USNCASH\user_data\Maps'
in_kml_file = output_folder + r'\USNCASH.kmz'
output_data = "USNCASH"
in_features = "USNCASH\Polygons"
out_feature_class = output_folder + r'\USNCASH.shp'
print("KML to layer")
arcpy.KMLToLayer_conversion(in_kml_file, output_folder, output_data, include_groundoverlay="NO_GROUNDOVERLAY")
print("copy feature")
arcpy.CopyFeatures_management(in_features, out_feature_class, config_keyword="",
spatial_grid_1="0", spatial_grid_2="0", spatial_grid_3="0")
print("done")
@kathysll
Copy link
Author

kathysll commented Nov 7, 2019

import arcpy

arcpy.env.overwriteOutput = True

output_folder = r'\tank1\production\2019\geomni\nc\USNCASH\user_data\Maps'
in_kml_file = output_folder + r'\USNCASH.kmz'
output_data = "USNCASH"
in_features = "USNCASH\Polygons"
out_feature_class = output_folder + r'\USNCASH.shp'

print("KML to layer")
arcpy.KMLToLayer_conversion(in_kml_file, output_folder, output_data, include_groundoverlay="NO_GROUNDOVERLAY")

print("copy feature")
arcpy.CopyFeatures_management(in_features, out_feature_class, config_keyword="",
spatial_grid_1="0", spatial_grid_2="0", spatial_grid_3="0")

print("done")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment