[GIS] How to create one KML per polygon (from one Shapefile)

arcgis-9.3arcgis-desktopkmlpolygonqgis

I have a shapefile containing hundreds of polygons. I need to create a kml of each of the polygon. Is there any way that I may not have to deal each polygon individually and my polygon file may give me individual kml of each polygon.

I'm using ArcGIS 9.3 or QGIS.

Best Answer

With an arcpy.SearchCursor go through your shape file and for each row, append the let's say OBJECTID to a python list. Now loop through that list and for every entry, create a table view on your shape file with the list entry as query condition. Now I am not sure but I think you need the arcpy.LayerToKML_conversion function. Hopefully you can use the table view as an input for this function, otherwise I think you will need to create temporary shapefiles for each view and use them as input for arcpy.LayerToKML_conversion.

LayerToKML_conversion : http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00120000004n000000

I hope these functions are available in 9.3!