I am trying to batch export kml from shapefiles that are all in WGS84. For this I have created a simple model in model builder to iterate through all feature classes in a directory, make a feature layer and convert it to kml. This is how it looks like.


The first kmz comes out OK. However all the next ones get mixed up and this is what it looks like when I import it to GE (the grey lines going round the Earth).

Google Earth

I am using ArcMap 10.3.1

2 Answers 2


Try replacing the second "Biotops_Corine_layer" after the Make Feature Layer tool with an in-line name variable "%Name%". I created a very similar model for a different purpose and it works for me (iterates through several hundred rasters). The in-line name variable is the only difference between my model and your model.

Additional Detail:

I reproduced your model without any problem. I iterated and processed 88 files and was able to load in Google Earth. See the series of images. I think the key is the in-line variable name in the Make Feature Layer tool. I have provided the screenshot of my setup.

enter image description here

enter image description here

enter image description here

enter image description here

  • I have tried this with no success. Can you pease see if you can make it work with the layer to kml?
    – mikmar
    Oct 24, 2017 at 22:14

Seems overly complicated just use GDAL OGR2OGR (OSGEO4W) to transform a folder of shapefiles to KML. Write a batch script with

@echo off set /p sourcefolder=folder where shapefiles are located: CD /D %sourcefolder% echo converting shapefile to KML For /f %%f (*.shp) do ogr2ogr -f "KML" folder/ %~dpnf.kml %%f

  • 1
    I am sure there are many options to accomplish this, but I think it's more helpful to the OP to get help over a small hurdle on their chosen path. Nothing complicated about replacing a hard coded name with a variable - that's all it is. The rest is explanation and exhibits.
    – ZrSiO4
    Oct 25, 2017 at 15:33
  • 1
    I actually LOL'd at your "seems overly complicated"... if the OP does not have GDAL, I'd say that finding it, downloading, getting it installed/setup sounds "overly complicated". "Simple" is in the eye of the beholder.
    – KHibma
    Oct 25, 2017 at 15:54
  • ALL GIS Users even full ESRI shops should have OSGEO4W with QGIS installed. You are missing out otherwise. trac.osgeo.org/osgeo4w Plus there are NO install options like OSGEOLIVE. Oct 25, 2017 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.