Is it possible to automate symbology in ArcGIS Online from a feature service that updates daily?

946
5
02-20-2017 12:10 PM
MichaelTorbett1
Occasional Contributor

I have a feature service on my server that will update its attribute data daily via  a python script and is published to AGOL. The Symbology is based on one field. is it possible to automate the symbology (even if its just random colors) as the attributes change? I'm using ArcGIS Server 10.2.2 with ArcGIS 10.5. 

Thanks,

Michael 

5 Replies
JordanBaumgardner
Occasional Contributor III

You could base your renderer on a field in your data that you changed when you made your update.

0 Kudos
Juan_ManuelAngel
Esri Contributor

You can do that  but you need to publish your services with the graduate color for example or Unique Values based in the attribute that you are using in your python script, if you can tell more about what you need to do in specific it would by very helpfull.

0 Kudos
MichaelTorbett1
Occasional Contributor

Jordan and Juan,

 Thank you for your replies.

I've created a  web map for my agency showing the counties in Georgia with the "Forester" assigned to that county in the attribute table. The Symbology is color coated  by "Forester". What I want is that when a new forester gets hired and put into the attribute table, the symbology automatically adjust for that. 

The setup is, newly hired forester gets added to a sql server table. Using model builder, I then take that table, join it to a  county feature class (that's stored on a GIS Server and published as a feature service) , and use 'field calculator' to add the foresters to that feature class. I plan to export this model as a script and schedule it to run once a day. 

I tried publishing the service with the unique values based on the attribute field. however AGOL is not automatically recognizing any changes through the symbology.

Any advice is greatly appreciated.

0 Kudos
JordanBaumgardner
Occasional Contributor III

Try it from the client:

geonet.esri.com/thread/183682-arcgis-javascript-how-to-layers-custom-field-value-rendering

// Key section of above link

var renderer = new ClassBreaksRenderer(null, "STATISTICS");
renderer.addBreak(0, 10, new SimpleFillSymbol().setColor(new Color([56, 168, 0, 0.5])));
renderer.addBreak(11, 30, new SimpleFillSymbol().setColor(new Color([139, 209, 0, 0.5])));
renderer.addBreak(31, 50, new SimpleFillSymbol().setColor(new Color([255, 255, 0, 0.5])));
renderer.addBreak(51, 90, new SimpleFillSymbol().setColor(new Color([255, 128, 0, 0.5])));
renderer.addBreak(91, Infinity, new SimpleFillSymbol().setColor(new Color([255, 0, 0, 0.5])));

layer.setRenderer(renderer);
layer.redraw();

MichaelTorbett1
Occasional Contributor

Unfortunately I don't know much when it comes to javascript, but I see what you're saying. I'm going to play around with this and see if I can get it work.

Thanks Jordan.

0 Kudos