<?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: [Arcade] Splitting intersecting line with created point feature in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229981#M650</link>
    <description>&lt;P&gt;An older version of the rule did use cut, if you are interested in the logic, it pasted it below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;function cut_line_at_point_cutter(line_feature, point_geometry) {
    var search = Extent(Buffer(point_geometry, .1, "meter"));
    var geo = Geometry(line_feature);
    var segment = Clip(geo, search)["paths"][0];
    // Rotate logic - https://stackoverflow.com/questions/45701615/how-can-i-rotate-a-line-segment-around-its-center-by-90-degrees
    // Start and end points of the line
    var x1 = segment[0]['x']
    var y1 = segment[0]['y']
    var x2 = segment[-1]['x']
    var y2 = segment[-1]['y']
    //find the center
    var cx = (x1 + x2) / 2;
    var cy = (y1 + y2) / 2;
    //move the line to center on the origin
    x1 -= cx;
    y1 -= cy;
    x2 -= cx;
    y2 -= cy;
    //rotate both points
    var xtemp = x1;
    var ytemp = y1;
    x1 = -ytemp;
    y1 = xtemp;
    xtemp = x2;
    ytemp = y2;
    x2 = -ytemp;
    y2 = xtemp;
    //move the center point back to where it was
    x1 += cx;
    y1 += cy;
    x2 += cx;
    y2 += cy;
    var cutter = Polyline({
        "paths": [
            [
                [x1, y1],
                [x2, y2]
            ]
        ],
        "spatialReference": {
            "wkid": geo.spatialReference.wkid
        }
    });
    var new_lines = Cut(line_feature, cutter);
    var line_a = Dictionary(Text(new_lines[0]))
    var line_b = Dictionary(Text(new_lines[1]))
    line_a['paths'] = remove_vertex(line_a['paths'])
    line_b['paths'] = remove_vertex(line_b['paths'])
    return [Polyline(line_a), Polyline(line_b)]
}&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 09 Nov 2022 15:12:02 GMT</pubDate>
    <dc:creator>MikeMillerGIS</dc:creator>
    <dc:date>2022-11-09T15:12:02Z</dc:date>
    <item>
      <title>[Arcade] Splitting intersecting line with created point feature</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229951#M648</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I am currently trying to develop an attribute rule that allowes me to split an intersecting line when creating a point feature on that specific line. As I only found a cut function that allows to cut a polyline with another polyline, my initial guess was to just creat a dummy line at the position of the point feature that helps me splitting the line. However that seems quite complicated for a seemingly easy task. Has anybody another approach or idea how i could solve that problem? Perhaps even without using Attribute Rules?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Stefan!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 14:47:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229951#M648</guid>
      <dc:creator>StefanAngerer</dc:creator>
      <dc:date>2022-11-09T14:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: [Arcade] Splitting intersecting line with created point feature</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229979#M649</link>
      <description>&lt;P&gt;Check out this rule -&amp;nbsp;&lt;A href="https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/SplitIntersectingLine.md" target="_blank"&gt;https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/SplitIntersectingLine.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:10:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229979#M649</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2022-11-09T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: [Arcade] Splitting intersecting line with created point feature</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229981#M650</link>
      <description>&lt;P&gt;An older version of the rule did use cut, if you are interested in the logic, it pasted it below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;function cut_line_at_point_cutter(line_feature, point_geometry) {
    var search = Extent(Buffer(point_geometry, .1, "meter"));
    var geo = Geometry(line_feature);
    var segment = Clip(geo, search)["paths"][0];
    // Rotate logic - https://stackoverflow.com/questions/45701615/how-can-i-rotate-a-line-segment-around-its-center-by-90-degrees
    // Start and end points of the line
    var x1 = segment[0]['x']
    var y1 = segment[0]['y']
    var x2 = segment[-1]['x']
    var y2 = segment[-1]['y']
    //find the center
    var cx = (x1 + x2) / 2;
    var cy = (y1 + y2) / 2;
    //move the line to center on the origin
    x1 -= cx;
    y1 -= cy;
    x2 -= cx;
    y2 -= cy;
    //rotate both points
    var xtemp = x1;
    var ytemp = y1;
    x1 = -ytemp;
    y1 = xtemp;
    xtemp = x2;
    ytemp = y2;
    x2 = -ytemp;
    y2 = xtemp;
    //move the center point back to where it was
    x1 += cx;
    y1 += cy;
    x2 += cx;
    y2 += cy;
    var cutter = Polyline({
        "paths": [
            [
                [x1, y1],
                [x2, y2]
            ]
        ],
        "spatialReference": {
            "wkid": geo.spatialReference.wkid
        }
    });
    var new_lines = Cut(line_feature, cutter);
    var line_a = Dictionary(Text(new_lines[0]))
    var line_b = Dictionary(Text(new_lines[1]))
    line_a['paths'] = remove_vertex(line_a['paths'])
    line_b['paths'] = remove_vertex(line_b['paths'])
    return [Polyline(line_a), Polyline(line_b)]
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-splitting-intersecting-line-with-created/m-p/1229981#M650</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2022-11-09T15:12:02Z</dc:date>
    </item>
  </channel>
</rss>

