Find the symbol of a feature on screen

194
2
02-13-2024 07:17 AM
mody_buchbinder
Occasional Contributor III

I need to translate feature layer to some internal format.

The format include symbol for each feature (no renderer).

I can run a cursor on the layer to get feature geometry but finding the symbol is a problem.

I need to go to the renderer. If it is single symbol it is easy.

If unique value I need to find the field value for the feature and find the class in the renderer.

If there are other renderers I need to write more code (find between what classes the value is  in case of class break etc.).

Is there any other way?

0 Kudos
2 Replies
CharlesMacleod
Esri Regular Contributor

Mody, I think what you are after is "LookupSymbol" on FeatureLayer: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic26414.html

Also, on "CanLookupSymbol" https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic26409.html there is a list of supported renderers:

  • CIMSimpleRenderer
  • CIMUniqueValueRenderer
  • CIMClassbreaksRenderer
    • Graduated
    • Unclassed
  • CIMDictionaryRenderer
  • CIMProportionalRenderer

 

0 Kudos
mody_buchbinder
Occasional Contributor III

Hi Charlie

Good answer as usual, look promising I will test.

One more question on the same subject.

Since the internal format has very limited symbology I need to limit the symbology in Pro for layers that will be exported.

The way to do it is to create a style with supported symbols.

In the style I can give each symbol my name.

My idea is to create some kind of table that will have the symbol name in the style and the properties in the internal symbol format. For this my code need to understand what is the original name of the symbol in the style that the renderer uses.

Some kind of property for a symbol that keeps the connection to the style it came from.

Any idea how to do it?

0 Kudos