<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Label duplicated points with the maximum value of one of them. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176850#M55485</link>
    <description>&lt;P&gt;Unfortunately, you really won't be able to do this with the built-in labelling tools. The labelling profile of Arcade does&amp;nbsp;&lt;EM&gt;not&amp;nbsp;&lt;/EM&gt;have access to the various&amp;nbsp;&lt;STRONG&gt;FeatureSetBy...&lt;/STRONG&gt; functions. In other words, the label of an individual feature cannot "see" the values of other features in the same layer.&lt;/P&gt;&lt;P&gt;You could get closer to this idea with a text marker in the layer's symbology, but you'd need some way of overriding the feature drawing order with an attribute, which is currently not possible in Pro.&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 15:12:56 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-05-24T15:12:56Z</dc:date>
    <item>
      <title>Label duplicated points with the maximum value of one of them.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176845#M55482</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I got a case where I have 3 points with the same coordinates (duplicated, but need to be). Each has an attribute (numeric) with different values:&lt;/P&gt;&lt;P&gt;e.g&lt;/P&gt;&lt;P&gt;point,value&lt;/P&gt;&lt;P&gt;1,55&lt;/P&gt;&lt;P&gt;1,44&lt;/P&gt;&lt;P&gt;1,456&lt;/P&gt;&lt;P&gt;2,33&lt;/P&gt;&lt;P&gt;2,34&lt;/P&gt;&lt;P&gt;2,67&lt;/P&gt;&lt;P&gt;3,45&lt;/P&gt;&lt;P&gt;3,65&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to to label these points on the map, but only showing the highest value for each of them. So only one label for point 1 showing 456 etc.&lt;/P&gt;&lt;P&gt;Any ideas how to do so?&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 14:57:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176845#M55482</guid>
      <dc:creator>VaL</dc:creator>
      <dc:date>2022-05-24T14:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Label duplicated points with the maximum value of one of them.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176850#M55485</link>
      <description>&lt;P&gt;Unfortunately, you really won't be able to do this with the built-in labelling tools. The labelling profile of Arcade does&amp;nbsp;&lt;EM&gt;not&amp;nbsp;&lt;/EM&gt;have access to the various&amp;nbsp;&lt;STRONG&gt;FeatureSetBy...&lt;/STRONG&gt; functions. In other words, the label of an individual feature cannot "see" the values of other features in the same layer.&lt;/P&gt;&lt;P&gt;You could get closer to this idea with a text marker in the layer's symbology, but you'd need some way of overriding the feature drawing order with an attribute, which is currently not possible in Pro.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 15:12:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176850#M55485</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-05-24T15:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Label duplicated points with the maximum value of one of them.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176874#M55487</link>
      <description>&lt;P&gt;Doing this on the original data is going to be hard or impossible.&lt;/P&gt;&lt;P&gt;The two possibilities I see:&lt;/P&gt;&lt;P&gt;&lt;U&gt;Use SQL&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Create a &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/make-query-layer.htm" target="_blank" rel="noopener"&gt;Query Layer&lt;/A&gt; or &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/create-database-view.htm" target="_blank" rel="noopener"&gt;Database View&lt;/A&gt;. In a very basic form:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SELECT PointName, Max(Value) AS "MaxValue"
FROM Featureclass
GROUP BY PointName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Use Attribute Rules&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Create a new point feature class. Needs a value field.&lt;/P&gt;&lt;P&gt;On your original point feature class, create an Attribute Rule that edits the newly created fc, something like this (untested):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule on original point fc
// field: empty
// triggers: insert, update, delete

// load the label point fc
var labels = FeatureSetByName($datastore, "LabelPoints", ["OBJECTID", "Value"], false)

// intersect the label fc with the active $feature
var label = First(Intersects(labels, $feature))

// create empty arrays to hold commands to add, update, or delete features in the label fc
var adds = []
var updates = []
var deletes = []

// if we're inserting or updating a point and there is no label point there, add it
if($editcontext.editType != "DELETE" &amp;amp;&amp;amp; label == null) {
    var new_label = {
        "geometry": Geometry($feature),
        "attributes": {"Value": $feature.Value}
    }
    Push(adds, new_label)
}

// if we're inserting or updating and there already is a label point there, update its value
if($editcontext.editType != "DELETE" &amp;amp;&amp;amp; label != null) {
    var updated_label = {
        "objectID": label.OBJECTID,
        "attributes": {"Value": Max(label.Value, $feature.Value)}
    }
    Push(updates, updated_label)
}

// if we're deleting a point and there are no other points in that location, delete the label
if($editcontext.editType == "DELETE" &amp;amp;&amp;amp; label != null) {
    // load the point fc
    var points = FeatureSetByName($datastore, "Points", ["OBJECTID"], false)
    // intersect with label
    var points_at_location = Intersects(label, points)
    if(Count(points) == 1) {  // only the current $feature, no other points
        var deleted_label = {"objectID": label.OBJECTID}
        Push(deletes, deleted_label)
    }
}

// return, this instructs the gdb to insert, update, or delete a feature in the label fc
return {
    "edit": [{
        "className": "LabelPoints",
        "adds": adds,
        "updates": updates,
        "deletes": deletes
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 15:45:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-duplicated-points-with-the-maximum-value-of/m-p/1176874#M55487</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-24T15:45:04Z</dc:date>
    </item>
  </channel>
</rss>

