1

I am trying my hand at ModelBuilder today. This is a simple task; I wish to accomplish this to:

  1. Make this task more autonomous
  2. Hone my ModelBuilder Skills.

All I'm trying to do is create a simple tool that will allow me to convert a KML/KMZ (or several via batch) to a shapefile which will subsequently allow me to save the shapefile in the desired folder. When I attempt to do this process manually I have to convert via 'KML to layer' tool then export layer to shapefile by right clicking "export data" in the TOC and then adding it to the layer. This process becomes tedious if I have several KMZs.

Can anyone assist?

I am using ArcGIS Desktop 10.5.

Below is my first attempt which failed miserably.

enter image description here

  • Connect your "output layer" to a FeatureClass to FeatureClass tool, not the FeatureClass to shapefile (multiple) as that is expecting many datasets. You KML to layer tool is only ever creating one output. – Hornbydd Mar 29 '18 at 21:02
  • How come you have iterated this selection of mutliple kmls? – Girija Kalyani Jun 29 '18 at 15:25
2

What you did in your ModelBuilder is alright, except you forgot to add the only Model tool (Select Data), so you ModelBuilder will be something like that.

enter image description here

PS: I used (Select Tool) to copy my polygon as shapefile in any folder I want.

The result is the layer (KML to Layer), the geodatabase contains the feature and the result shapefile.

enter image description here

Then to save your Model as Tool (Just save as > e.g KML_Tool) Before You need to define the parameters (Input files, outputs) by right click>Model Parameter as shown:

enter image description here

And save your model. Then it works when you open it.

  • where is the 'Select Data' & "select" tool located? – Natedawg5509 Apr 2 '18 at 12:59
  • Model>Insert>Model inly tools>Select Data. for the select tool, you can find in it in the tools box, just search for it and drag it in the model – Moh Apr 2 '18 at 13:18
  • 1
    @Natedawg5509 I updated my answer for the parameters. Sorry, I was confused and thought you are asking something else. – Moh Apr 2 '18 at 17:54
  • 1
    It worked perfect. Thank you for your effort! Life just became easier – Natedawg5509 Apr 2 '18 at 18:28
  • 1
    @Natedawg5509 you welcome, as I mentioned before that the best way is to toggle the answer as accepted and upvote. – Moh Apr 2 '18 at 18:30
0

By adding file iterator and according to these steps and pnj attached you can do it.

1- file iterator 2 insert from KMLto layer tool 3 connect outputs of file iterator (file and name ) to "KMLto layer tool" 4- specify only output folder in KMLto layer tool

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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