0

I am currently trying to build a model that will join two excel tables (without xy coordinates) to one shapefile, which will save some time on a very long process that I have to repeatedly do each day at work. I know that there is a way to manually do it if I right-click the shapefile in the table of contents and add a join from that menu; however, there seems to be no way of doing it in the ModelBuilder.

I am guessing it is a similar situation to the two different merge options in the toolbox and in the editor drop down menu, where they share the same name yet function differently. Therefore, I was wondering if there was a way to make a conversion of an excel table to a shapefile in model builder without coordinates? I know that there is a new tool in ArcGIS 10.2 that would probably help me with this, but the updates are not easily accessed at my work (I am currently using 10.0), so are there other ways of doing this?

This may seem like a simple question, but things are a lot more difficult using model builder due to the fact that I need the process to work automatically each time I use the tool and cannot think of a way that would add xy coordinates and delete them each time I use the tool while not messing with the structure of the original input shapefile. What are my options?

  • 3
    Have you looked at the Add Join tool (Data Management toolbox)? That should be usable in ModelBuilder (and it should be in 10.0). – Erica Mar 23 '15 at 19:51
  • 1
    Also, you can convert your Excel files to Tables instead of Shapefiles, although that will still require you to add a join. – Erica Mar 23 '15 at 19:52
  • I was able to download ArcGIS 10.2 and use the 'convert Excel files to Tables' tool, which seems to work; however, the final output shapefile in the model does not appear in the tool dialogue box despite the model parameters option turned on, so there is something that is still not working right. Thoughts? – TB_ASM Mar 30 '15 at 20:40
1

I think you might use Add Join as mentioned above. Yet I belive that Join Field will be of a better use. It simple works as Add join, but adds flexibility to the process, enabling to add only some fields, or all of them. Otherwise, "regular join" will join all fields, which can make quite a mess with big datasets.

To elaborate on the "conversion" to Shapefile. This would be a crooked way of handling this situation. Shape files are first of all spatial; that is to "make up" some (x,y) coords just to add it would be inefficient and basically wrong. In addition, using merge would not aid your problem, since merge binds rows together, and you are looking to bind coloumns.

edit - due to comments:

Note that when using join in a model, whether it is join field or other join tools, that data is being joined to the original table, i.e. there is no new file being generated. For example:

If you start with Shapefile and join a table to it within a model you will see the output as shapefile(2), or (3) etc. That is, the same input file after you ran an operation on it. Therefore setting shapefile(2) as a model parameter would not help, since there is no new file as an output.

If you insist on a new file for an output, I suggest you use the Copy Features tool, to copy the file after you have joined a table/field. Than you can set its output as a model parameter.

  • Yes, Join Field is generally a better idea in a model/tool -- good elaboration! :) – Erica Mar 24 '15 at 22:41
  • Thank you for the advice, and I did try using the Join Field first. Just joining the fields straight from the excel table and the shapefile table using the Join field tool does not work, because the output of the join has a glitch that some how loops backwards and tries to use the data from the input shapefile (which is un-editable once the join is run) in the rest of the processes required for the model to work, rather than copying it into a new file. So converting the excel sheet to a shapefile (or a compatible format) is necessary for the model to work properly. – TB_ASM Mar 30 '15 at 20:48
  • In that case, .DBF or other tabular format as @Erica mentioned would be best – dof1985 Mar 30 '15 at 20:50
  • I understand that the merge function will not work, it was just an example because there are two different versions of the 'Merge' function, just as there are two different versions of the 'Join field' function. They work differently depending on which menu you choose to use it from. – TB_ASM Mar 30 '15 at 20:50
  • 1
    Wow! That was so obvious, but I did not even consider it as an issue. That fixes my problem, thank you so much! – TB_ASM Apr 1 '15 at 22:05

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.