GeoEvent: Support Assignment of Unique Layer IDs in Map Services

324
0
09-25-2019 10:20 AM
EricIronside
Esri Regular Contributor
2 0 324

Recently, a user asked if GeoEvent supports the "Allow assignment of unique IDs for map service publishing" feature in Map Services.  The short answer to this is YES, but there are some known limitations as described below. Note that these limitations only apply to Map Services and don’t apply to Feature Services.  Feature Services allow you to set unique Layer IDs, but will always present the layers in numerical ordering (ignoring the order you imposed when publishing).

NOTE: A workaround for Map Services you don't own/can't control at the bottom of this post.

Map Service Layer ID 0

In a map service, if you choose to assign Layer IDs to your layers, you should ensure one of the following:

  • Layer ID 0 IS ALWAYS the First Layer
    • If the first (topmost) layer has Layer ID 0, then the other layers can have any Layer ID as needed. 
    • If you need to re-order layers and the layer with Layer ID 0 is no longer first, it MUST be changed to something other than 0.
  • Do NOT use Layer ID 0 in your map.
    • If the Layer ID 0 is used in any location other than the first (topmost) layer, the GeoEvent Manager user interface may not interpret it correctly. 
    • For this reason, if you use the unique Layer ID feature, it is recommended that you avoid using the Layer ID 0 in your map services
    • If you think the order of your layers in a map may change, a best practice would be to avoid the use of Layer ID 0.

Changing a Layer’s Layer ID

GeoEvent manages its configuration based on the Layer ID. If you change a Map/Feature Service so that the layer’s Layer ID changes, you are responsible for updating your GeoEvent component to use the correct layer.  Some examples are provided below:

Example 1:

  • A Map Service that does NOT have Unique IDs enabled with two layers: Wells (0) and Trees (1).
  • A GeoEvent Input polls the map service for the Trees (1) layer.
  • The map service is updated with a new Signs layer added to the bottom of the layer list: Signs (2).
  • The GeoEvent Input does NOT need to be updated: it will continue to work as expected, polling layer Trees (1). There are no errors or issues because the Layer ID of the target layer has not changed.

 

Example 2:

  • A Map Service that does NOT have Unique IDs enabled with two layers: Wells (0) and Trees (1).
  • A GeoEvent Input polls the map service for the Trees (1) layer.
  • The map service is updated with a new Signs layer that is inserted at the top (so the layers are now: Signs (0), Wells (1), and Trees (2)).
  • The GeoEvent Input MUST be updated: it will look like it is working correctly, poll and create events, but it will be pulling data from the Wells (1) layer, which may or may not coincide with the expected GeoEvent Definitoin for Trees.

 

Example 3:

  • A Map Service that does have Unique IDs enabled with two layers: Wells (10) and Trees (20).
  • A GeoEvent Input polls the map service for the Trees (20) layer.
  • The map service is updated with a new Signs layer that is inserted at the top and a Layer ID of 5 is assigned (so the layers are now: Signs (5), Wells (10), and Trees (20)).
  • The GeoEvent Input does NOT need to be updated: it will continue to work as expected, polling layer Trees (20). There are no errors or issues because the Layer ID of the target layer has not changed.

 

Example 4:

  • A Map Service that does have Unique IDs enabled with two layers: Wells (1) and Trees (2).
  • A GeoEvent Input polls the map service for the Trees (2) layer.
  • The map service is updated to add a Signs layer with Layer ID 10, change the Layer ID of Wells to 20 and the Layer ID of Trees to 30 (so the layers are now: Signs (10), Wells (20), and Trees (30)).
  • The GeoEvent Input MUST be updated: it will continue to run without an error indication, polling for the layer Trees (2) but will not get any data. An inspection of the logs will indicate that the ArcGIS Server returned an error “Invalid Parameter”. This indicates the polling request provided an invalid Layer ID of 2, which no longer exists in the service.

 

Example 5:

  • A Map Service that does have Unique IDs enabled with two layers: Wells (1) and Trees (2).
  • A GeoEvent Input polls the map service for the Trees (2) layer.
  • The map service is updated to add a Signs layer with Layer ID 10, change the Layer ID of Wells to 20 and the Layer ID of Trees to 30 (so the layers are now: Signs (10), Wells (20), and Trees (30)).
  • In GeoEvent the Data Store connection hosting the map service is synchronized to update the service and layer information.
  • The GeoEvent Input MUST be updated: it will be in an error state “”. Since GeoEvent’s cache of the service and layer information has been updated, the input can no longer function properly since Layer ID 2 is not in the cache.

 

Example 6:

  • A Map Service that does have Unique IDs enabled with two layers: Wells (1) and Trees (2).
  • A GeoEvent Input polls the map service for the Trees (2) layer.
  • The map service is updated to add a Signs layer with Layer ID 10 at the top, without changing the LayerIDs of the other two layers (so the layers are now: Signs (10), Wells (1), and Trees (2)).
  • In GeoEvent the Data Store connection hosting the map service is synchronized to update the service and layer information.
  • The GeoEvent Input does NOT need to be updated: it will continue to work as expected, polling layer Trees (2). There are no errors or issues because the Layer ID of the target layer has not changed in the cache nor the service.

 

Example 7:

  • A Map Service that does have Unique IDs enabled with two layers (from top to bottom): Trees (1), and Signs (0).
  • A GeoEvent Input polls is configured to poll the map service for the Signs (0) layer. However the GeoEvent Manger user interface may not allow the user to select the Signs (0) layer (it will always select the Trees (1) layer).

Workaround

If you find a need to use a map service that has the Layer Id 0 in a location other than the first (topmost) spot, you can use the Poll an External Website for JSON input and hardcode the layer ID in the URL you provide.

About the Author
Esri Professional Services Real-Time GIS Team GeoEvent Sr. Product Enginner