Select to view content in your preferred language

New Feature-Linked Annotations with existing SQL Queries

168
3
a week ago
Jar
by
Emerging Contributor

I have point features related to a feature-linked annotation feature class that are generated based on specific SQL query parameters. When I add a band new feature to my feature class, a feature-linked annotation is not automatically generated because the new feature does not meet the parameters of the labeling SQL query at the time of creation. When I modify the attributes of the feature after it has been created to satisfy the SQL query an annotation is still not created.

Based on a thread that I've found online, created feature needs to satisfy the SQL query when it gets created. This was confirmed when I copied existing features that meet the SQL query parameters and annotations were created automatically. Is there a work around for new features that may not meet the SQL query parameters right away? The forum links to a geonet.esri.com solution that is no longer accessible.

 

Original GIS StackExchange Post (From 8 years ago):
https://gis.stackexchange.com/questions/216107/feature-linked-annotation-not-added-when-new-features...

Feature linked annotation not added when new features are drawn

I created feature linked annotation for a line feature class. Both the feature and the annotation are feature classes stored within the same feature dataset on an SQL Server Geodatabase.

The initial labeling made use of a simple SQL query which may or may not be relevant. The annotation was created successfully but I'm having a hard time maintaining it due to the following:

  • When I create a new feature that matches the filtering requirements of my feature linked annotation, the annotation is not created automatically. Instead I have to select the feature and then click Selection > Annotate selected features. It's my understanding from reading through ESRI's help that the annotation should be created automatically for any newly added features. These new features DO match the sql query I initially made use of.

Answer:

I have ran into this problem before and this seemed to work for me.
https://geonet.esri.com/thread/52888

The SQL Query is exactly what's stopping the annotation from getting created.

The composite relationship class allows for new annotation to get created as soon as a new feature in the related feature class is created. This process only happens at the exact moment that the new feature is committed to the database (before you ever modify attribute information). When a SQL Query is being used to limit the annotation that is seen in a particular anno class, the value(s) which match the SQL query must be present at the time the feature is created for the related anno to get created as well. In your case, they're not.

 

0 Kudos
3 Replies
JMutunga
Esri Contributor

@Jar  Could you please provide clear steps (especially where the 'SQL Query' is applied) to reproduce the behavior?




0 Kudos
Jar
by
Emerging Contributor

For sure!

I have a point feature class in a file geodatabase with labeling turned on. My labels have 8 Annotation Classes with different SQL expressions used to determine which labels/formatting to apply to the points.

For example:

One Annotation Class SQL expressions could be:
Street_Number IS NOT NULL and Level_Apartment IS NULL

Another Annotation Class SQL expression could be:
Street_Number IS NOT NULL and Level_Apartment IS NOT NULL

A Feature-Linked Annotation Feature Class is created using "Convert Labels to Annotation" with "Create feature-linked annotation", "Create annotation when new features are added", and "Update annotation when feature's shape is modified" all checked.

The issue is when a new point feature is created using "Create Feature", Street_Number will be NULL by default when the feature is created, which doesn't satisfy the SQL query used to generate a new feature-linked annotation and it doesn't get labeled. Changing Street_Number to a value after being created also does not result in a new annotation being created.

I can only get a new annotation to be created when the new feature already has Street_Number populated at the time of being created via a copy/paste because Street_Number IS NOT NULL when the point is created.

0 Kudos
JMutunga
Esri Contributor

Thanks for the detailed response. 

If you select the newly created feature(s) and run the Annotate Selected Features geoprocessing tool, does the correct annotation get updated (and displayed on the map)?

 Changing Street_Number to a value after being created also does not result in a new annotation being created.

 

0 Kudos