Why, hello there!
I hope this message finds you well.
I have been having issues with the automatic publication of feature layers using Python's arcpy library, and would like to request your help.
To give you some context, I am responsible for the development of a situational reporting product, for the Copernicus Emergency Management Service - Rapid Mapping component. You can find one such example at: https://mapping.emergency.copernicus.eu/activations/EMSR848/reporting/. This responsibility also extends to the development of our internal Python toolkit for statistics and web layer generation.
These past months, due to our custom ArcGIS Pro environment, the publication of tile services has been broken. I initially went for tile services due to the complex symbology we have, and that needs to be honoured. Vector tiles were out of the question, due to the map legend being unsupported (would be great to support it), as well as feature layers due to limited symbology.
Considering the frequent breakage of tile service publication related to our custom environment, I have reconsidered the idea of using feature layers instead, by making slight changes to the symbology, in a way that still closely complies with our specifications. Manual publication works perfectly fine, be it for a web map that includes all our layers, or for layers taken one by one. You will find a screenshot below illustrating said symbology. The web map itself is available at: https://arcg.is/uHqbj0, with dummy geometries.
However, considering the amount of updates we can publish in a day, feature layers need to be automatically published, hence using arcpy. I have tried to get it to work, but every single time, the symbology gets lost, be it by publishing a single map with all the styles, or layer by layer.
More specifically, when building the Web Layer Sharing Draft, I make sure that:
sddraft.useCIMSymbols = TrueThis should enforce CIM symbols supported by newer ArcGIS / ESRI clients. This option unfortunately does not honour our styles. For testing purposes, the same goes when I try setting it to False. For reference, the documentation is available at: https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/featuresharingdraft-class.htm.
I was wondering whether you have an idea as to what could be the issue, and if you could provide assistance to help me troubleshoot it. Attached to this message, you will find an archive with the ArcGIS Pro project, as well as all the necessary SHP, GDB and LYRX files to reproduce the issue.
Thanks a lot for your attention and potential support!
Quentin
Hello! I am allowing myself a small bump.
Have a nice day 🙂
Hello - looks to me like everything is a vector style-type symbology in the webmap. Can you tell me what version of Pro you are on? Are these hosted feature layers in ArcGIS Online or Enterprise? If Enterprise, what version?
Finally, since you saying that once you use the ArcPy Feature sharing module to do sd overwrites - CreateDraft>Stage>UploadServiceDefinition - and that you do have "useCIMSymbols" set to True - do you have a stylex that you have shared as a webStyle in your org?
It may be that if you don't have a matching style in your org that may have some impact.
Hello - if you look at the help, you do have to have a matching stylex file that you have shared as a Web Style to your Online or Enterprise org. Otherwise you'll keep having this problem.