Using Model Builder for several formatting steps

156
1
10-06-2021 11:42 PM
scott_taylor_he360
New Contributor

Good afternoon,

Long time listener, first time caller!

So I searched the forums and I have come up lacking.  So I am asking for a little help, if you can point me in the direction of a current post or if you have ideas that would be great.  

So here is the situation.  Let's say my job is to track all of the hotdog carts and counterfeit watch salesmen in New York.  Every week I am given Geojson files for those two groups.  I import them into ArcGis Pro and  have to do the following:

1.  Move each point into their respective group folder in the Contents 

2.  Change the symbology of each point (All are different colors and some have different symbols (squares, dots, triangles),

3.  Add a Label to each point

4.  Activate the time feature and assign a specific time field (one set has a start and stop time, the rest are single time)

5.  Then create my spiffy report about the Hotdog guy and the counterfeit watch guys. (Not trying to automate this part.  I need this job)

 

So out of that list I have created a model that will do 2. Change the symbology.

I figured out how to move individual layers in the Contents pane but not how to move them into specific folders.

 

I know how to do each step manually but it is a huge effort every week.  Just trying to automate as much as possible.

Any help is greatly appreciated Who knew New York had so many hot dog guys???

 

Scott

 

 

0 Kudos
1 Reply
curtvprice
MVP Esteemed Contributor

I think I need to change the order to approach this:

In the Pro UI, create layer files one for each unique combination of symbol, labeling, and time setting, as these are all properties of a map layer.  The best way to do this is to export layer .lyrx files from existing points that are all set up. (This button is in the Share tab.)

Now add tools to import the geo-json using the tool that does that (sorry I have some ignorance here on the tool involved).

This is the most tricky part, as it involves arcpy.mp python code in Calculate Value tools. Write Python functions to create a Layer object using the appropriate (symbol, time, labeling setup) .lyrx files (with all their properties all set up), assign them to its source point feature class, and move your layers where you want to be within the Contents pane.  There are methods on the Layer class to do things like set up time and labeling but it is easier to set this up in your .lyrx files using the UI. Each python function goes into its respective Calculate Value tools, the functions would take a created point feature layer as input.

If anyone has better ideas, please chime in!

0 Kudos