Creating Feature Classes from tables

585
4
12-18-2019 09:04 AM
MatthewKauth1
New Contributor II

I'm wondering if there is a way via modelbuilder to create a feature class using a spreadsheet.
My ultimate goal is to format a spreadsheet with the proper field to not only create the attributes for the feature class but create the feature class itself. So in addition to attributes this spread sheet would need other fields such as the name of the feature class, the coordinate system, etc....

0 Kudos
4 Replies
by Anonymous User
Not applicable

Hi Matt,

Yes there is.

I would breakdown the problem and look at the steps that are needed to get an Excel Spreadsheet into ArcGIS/Pro.

Things to consider:

  • Arc will import CSVs easily to tables in a geodatabase
    • Excel will export individual sheets to CSV
  • tables can be converted into feature classes
    • tables must have defined co-ordinate fields
    • Tables must have defined column headers
  • each of the "Table to ..." tools have slightly different requirements, but these are outlined in the tool help
  • there are tools in model builder to extract the name of files and use them as variables

Then we look at process:

  • excel to csv is done from excel
  • csv to gdb table can be done in model builder
  • table to shape can be done in model builder
  • you can string tools together in model builder

I hope that this puts you on the right track,

Michael

P.S: I know that there are some tools for working with Excel in Arc, but in my experience they have never worked well at all.

MatthewKauth1
New Contributor II

Michael, Thanks for your input. I'm not sure that I follow you.  My goal is to create an empty feature classes driven by spreadsheets that would name the feature class, give it a coordinate syste, and attributes.  I have quite a few to make and I'm trying automate the creation of these empty feature classes.

0 Kudos
by Anonymous User
Not applicable

Ahhh, I am with you now.

you have a table like the following:

NameTypeCoordAttribute_1Attribute_2Attribute...
Map_1Polygon3857NumberOfPenguinsNumberOfPolarBearsmore
Map_2Point3857RegionBird_SpeciesFlight_Velocity

and you want to use that to make new maps in model builder.

In which case, whilst I can see a way to do it in Model Builder at this point personally I would be looking at coding it in Python.

To do the same in Model Builder would require building up the model from several models as you would need to iterate once over the Table to do each row, then again over each row to extract the required bit of information and then feeding that into the function to build the feature class.  Since model builder will only accept one iterator per model this means that you will need several models.


If you would like to stick with Model Builder, build from the inside out and plan it something like this:

  • Build a model(make_feature_class) that can build the map from the inputs you are expecting.
  • Build a model(extract_attributes) that will extract the inputs from one row of a CSV and feed them out to the first model built
  • Build a model(iterate_over_csv) that will iterate through each row and and feed the row into the second model built.

I am pretty sure this can be done, but it will be a nested model and those tend to run fairly slowly.

If you feel confident enough with Python I would be going down that path, the result should be faster and can be made into a Toolbox tool to be used again in the future.

Michael

MatthewKauth1
New Contributor II

Yes! This is what I'm trying to accomplish!  Thanks Michael.  I'm going to try your method in model builder as I don't know python.

0 Kudos