<?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 Attribute Rule Snaping to closest point makes layer not show in Field Maps and QC in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-snaping-to-closest-point-makes/m-p/1559069#M1624</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We hav a workflow where we use QC to collect data points when inspecting streetlighting. After when they have made the monthly inspection. They do a satus change in field maps when they are fixing the found issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To help to transfer over data from streetlighting and snapping QC point to closest pole. We have an attribute rule&amp;nbsp;that calculates and snaps attributes and geometry from another layer in same referenced service in enterprise. It works in Arcgis Pro, Mapviver and webbaps and collector for Windows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the layer won't load in Fela maps and not show in mapwiev in Quick capture.&lt;/P&gt;&lt;P&gt;Says in Fieald maps gets this error&amp;nbsp;ARCGIS_RUNTIME&lt;BR /&gt;&lt;BR /&gt;Kod:&lt;BR /&gt;7018&lt;BR /&gt;&lt;BR /&gt;Beskrivning:&lt;BR /&gt;Arcade expression is invalid.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Arcade expression:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;function closest_feature(felkoder_stolpe, Stolpe) {
  // returns the feature of compare_feature_set that is closest to test_feature
  var min_distance = 9999999
  var closest_feature = null
  for(var f in stolpe) {
    var d = Distance(felkoder_stolpe, f)
    if(d &amp;lt; min_distance) {
      min_distance = d
      closest_feature = f
    }
  }
  return closest_feature
}
// load the other featureset
var fs = FeatureSetByName($datastore, "Stolpe")
// get the feature that is closest to the current $feature
fs = Intersects(fs, Buffer($feature, 100))  // only analyze close-ish features
var f = closest_feature($feature, fs)
// abort if we didn't find something
if(f == null) { return }

// return the intersecting feature's value and snap the point to the found feature
return {
    result: {
        geometry: NearestCoordinate(f, $feature).coordinate,
attributes: {name: f.Name ,overordnad: f.__verordnad, anlaggningsnamn: f.anlaggningsnamn}
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i do this in an other way? Or is Field maps incompatible. I can still collect data points in Quic Capture and int works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 06:41:32 GMT</pubDate>
    <dc:creator>StefanBjörnvad2</dc:creator>
    <dc:date>2024-11-15T06:41:32Z</dc:date>
    <item>
      <title>Attribute Rule Snaping to closest point makes layer not show in Field Maps and QC</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-snaping-to-closest-point-makes/m-p/1559069#M1624</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We hav a workflow where we use QC to collect data points when inspecting streetlighting. After when they have made the monthly inspection. They do a satus change in field maps when they are fixing the found issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To help to transfer over data from streetlighting and snapping QC point to closest pole. We have an attribute rule&amp;nbsp;that calculates and snaps attributes and geometry from another layer in same referenced service in enterprise. It works in Arcgis Pro, Mapviver and webbaps and collector for Windows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the layer won't load in Fela maps and not show in mapwiev in Quick capture.&lt;/P&gt;&lt;P&gt;Says in Fieald maps gets this error&amp;nbsp;ARCGIS_RUNTIME&lt;BR /&gt;&lt;BR /&gt;Kod:&lt;BR /&gt;7018&lt;BR /&gt;&lt;BR /&gt;Beskrivning:&lt;BR /&gt;Arcade expression is invalid.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Arcade expression:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;function closest_feature(felkoder_stolpe, Stolpe) {
  // returns the feature of compare_feature_set that is closest to test_feature
  var min_distance = 9999999
  var closest_feature = null
  for(var f in stolpe) {
    var d = Distance(felkoder_stolpe, f)
    if(d &amp;lt; min_distance) {
      min_distance = d
      closest_feature = f
    }
  }
  return closest_feature
}
// load the other featureset
var fs = FeatureSetByName($datastore, "Stolpe")
// get the feature that is closest to the current $feature
fs = Intersects(fs, Buffer($feature, 100))  // only analyze close-ish features
var f = closest_feature($feature, fs)
// abort if we didn't find something
if(f == null) { return }

// return the intersecting feature's value and snap the point to the found feature
return {
    result: {
        geometry: NearestCoordinate(f, $feature).coordinate,
attributes: {name: f.Name ,overordnad: f.__verordnad, anlaggningsnamn: f.anlaggningsnamn}
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i do this in an other way? Or is Field maps incompatible. I can still collect data points in Quic Capture and int works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 06:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-snaping-to-closest-point-makes/m-p/1559069#M1624</guid>
      <dc:creator>StefanBjörnvad2</dc:creator>
      <dc:date>2024-11-15T06:41:32Z</dc:date>
    </item>
  </channel>
</rss>

