Arcade Intersect Function - October 2021

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 7

  • @myahannan4778
    @myahannan4778 Місяць тому

    I would love your help with a snippet of code in arcade format to calculate a field for the following intersect scenario:
    There are 6 points WITHIN a polygon. The polygon page number is 11.
    I’d like 11 to be inputted into the point field name.
    Basically wanting to use an intersect function to take a polygon attribute to a point attribute.
    Polygon Layer name - “Polygon Boundary”
    Polygon field name - “Polygon Page Number”
    Point layer name - “Circle Callouts”
    Point field name - “Polygon Page Number”
    I’d like to calculate the Point field name WITH the polygon field name based on what points are within a said polygon.
    I hope this makes sense! Thank you so much!

  • @iamzer0xx
    @iamzer0xx 10 місяців тому

    Hello. What would be the basic code for points intersecting polygons? For example, if I wanted to capture City ID/Name for points within City Boundaries? I am fairly new to Arcade, any suggestions would be greatly appreciated.

    • @PandaConsulting
      @PandaConsulting  10 місяців тому

      You might try something similar to this:
      // Get Sub Name from Subdivisions polygon layer
      var fsMapIndex = FeatureSetByName($datastore,"Subdivisions",["Name"])
      var fsIntersectMap = within(fsMapIndex,centroid($feature))
      var MapIndex = first(fsIntersectMap)
      if (MapIndex == null) return {"errorMessage": "No Feature Found"}
      if (MapIndex.Name == null) return {"errorMessage": "Field is empty"}
      return MapIndex.Name
      Good luck.

  • @crosseneric
    @crosseneric Рік тому

    If the drawn polygon intersects two or more subdivisions. How does it choose which one to return? Is it possible to set up a way to choose the greatest overlap?

    • @PandaConsulting
      @PandaConsulting  Рік тому

      While one can evaluate the sequencing of the objectID and find the latest polygon, at the moment, we have not implemented this function in the code. It is definitely possible.

  • @ryanphanson
    @ryanphanson Рік тому

    Is there a way to pull the m values from the intersected feature?

    • @PandaConsulting
      @PandaConsulting  Рік тому

      Good question - While the Arcade intersect allows one to capture the attributes of features, I am not sure of whether one can capture M-Values. You should check with Esri.