[GIS] How to auto-add new values to unique values classification values range

arcgis-desktoparcgis-javascript-apiarcgis-servergeoprocessingsymbology

I am using ArcGIS Desktop 10.1, ArcGIS Server 10.1 & SQL Server 2008 software.

I am adding the query layer and directly publishing to ArcGIS Server and accessing the map in a JavaScript application. The database is auto-updating in every 2 hour.

I am changing the layer properties (Symbol —-category —-unique values) of the layer but it is not auto-updating in ArcMap for new records and in the REST service.

What I tried:

  1. I have tried using geo-processing task but not successful.
  2. Auto-rendering option in ArcGIS JavaScript API

So is there any workaround for this? (Should I need to reset the parameters in Geo-processing task?)

enter image description here

Best Answer

From looking at the samples, this is what I would do. There might be better ways, but this should get you going:

  1. Add the data to ArcMap using a simple renderer (no classification)
  2. Publish as a dynamic map service, but enable dynamic layers.
  3. Consume the dynamic map service within an app built in the Esri JS API.
  4. Make use of GenerateRenderer to update the renderer on the service.
    You have the option to draw this either server side or within a feature layer. I would recommend doing it server side if lots of features or complex geometries involved.
  5. Within this you can make use of a UniqueValueRenderer to get all the current values from the field that you want to symbolise by.

I have done something similar for symbolising a live feed and it works fast and has been stable for awhile now.

The downside of this, is that this functionality is being done by the Javascript application and not by ArcGIS Server on its own. If you need to serve this symbology up to a number of different client applications (which you indicate is not the case), then you would need to look at an automated publishing workflow using the ArcGIS Server Admin API.

I would encourage you to work through some of the samples and read the help topics around this area.. Take a look at the latest (at time of writing) 3.3 JS API from Esri. If your data was changing more frequently, I would suggest taking a look at how you can generate a renderer using a function.

Related Question