Select to view content in your preferred language

Add support for Shape_Length and Shape_Area labelling when publishing to AGOL and Enterprise

1388
4
02-23-2023 03:39 AM
Status: Open
Labels (1)
David_Brooks
MVP Regular Contributor

Currently, you can label features in ArcGIS Online based on the Shape_Length and Shape_Area fields.

You can also do this in ArcGIS Pro.

However, you cannot publish a feature service with these labels, instead you get these errors.

David_Brooks_0-1677152271968.png

So both environments support it, but the sharing process doesn't. 

Simple fix?

Please all upvote.

4 Comments
Bud
by

Disregard.


I don't have much experience with AGOL or Enterprise, but this might be a viable workaround for Enterprise:

For Enterprise, you might be able to create a database view or a query layer that has a calculated field for LENGTH.

For example, in Oracle, it would be:

SELECT 
SDE.ST_LENGTH(SHAPE) AS SHAPE
--other fields
FROM
MY_FC

The same would apply for AREA: SDE.ST_AREA(SHAPE).

I imagine you could publish the query to Enterprise and label based on that calculated field.

Notes:

  • If using a database view, you might need to register the view with the geodatabase.
  • The problem with using a view or a query layer might be: neither is editable.
  • If you want to edit the layer in Enterprise, then maybe an attribute rule could be used instead to populate a LENGTH field in the actual feature class.

Just thinking out loud as a non-expert. I agree that out-of-the-box functionality would be better. 

 

Edit:

After re-reading your question, I see that you specifically want to publish a feature service, likely for editing. So the idea above for creating a query won't work. Please disregard.

Can you create dynamic joins in Enterprise? For example, could you create a view or query layer that has a calculated LENGTH field, then create a dynamic join from the FC to the query, allowing you to still edit the FC in the feature service, but also letting you label using the joined query's LENGTH field?

TanuHoque

@David_Brooks 

are you publishing the feature service on your on-premises enterprise server/portal (by ref)? or as a host feature service in agol?

if it is enterprise server, did you try publishing as a map service w/o enabling feature service? did that work?

David_Brooks

This is for a hosted feature service in AGOL, nothing in Enterprise. Otherwise I wouldn't have written this as an Idea. Some good suggestions if it was Enterprise though.

CascadeHampton

Best idea I've read all day @David_Brooks and it would really help when building basemaps in ArcPro and publishing them to AGOL. Curious if you've found a quick solution?