<?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 How to create Route Event Layer with Maps SDK for .NET? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-create-route-event-layer-with-maps-sdk-for/m-p/1309718#M11992</link>
    <description>&lt;P&gt;&lt;STRONG&gt;What I'm trying to solve:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the distance traversed along a line feature from a point that's on the line. The line features split and contain branches (think river stream) at irregular intervals. I want to solve this problem using .NET Maps SDK in .NET MAUI, using locally stored data from an MMPK. I have a network dataset that contains this data, so I can use the &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Tasks.NetworkAnalysis.html" target="_self"&gt;Network Analysis&lt;/A&gt; namespace.&lt;/P&gt;&lt;P&gt;Our client has a python script that uses arcpy to create a &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/linear-referencing/make-route-event-layer.htm" target="_self"&gt;route event layer&lt;/A&gt;&amp;nbsp;from a service area layer to perform this task. The route events that get created are the point locations that I'm trying to recreate in my .NET application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have tried so far:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this network dataset, I have point "facility" features and line "network" features. With this data, I have created &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Tasks.NetworkAnalysis.ServiceAreaTask.html" target="_self"&gt;ServiceAreaTask&lt;/A&gt; and I'm able to map ServiceAreaPolygons on the map. There is no equivalent of "Create Route Event Layer" in .NET Maps SDK, so I do a couple of things to achieve the same effect (or so I thought). First, I take the ServiceAreaPolygon, create a boundary around the polygon, and see where the line feature in question intersects with the polygon boundary. I figured that since the extent of the Service Area Polygon matches with the impedance cutoff, the boundary on the line should be where the event is.&lt;/P&gt;&lt;P&gt;Now, this works only ~ 50% of the time. ServiceAreaPolygons are created in what seems like, erratic and random places, in areas where there's no data. This gives me extra, incorrect point locations. In other cases, I also end up with less points than I should. Suffice it to say that what I am trying to mimic CreateRouteEventLayer does not work.&lt;/P&gt;&lt;P&gt;Anyone have any idea on what's really happening behind the scenes of CreateRouteEventsLayer that I can also de-construct and apply using .NET Maps SDK? I'm also looking into &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.GeometryEngine.CreatePointAlong.html#Esri_ArcGISRuntime_Geometry_GeometryEngine_CreatePointAlong_Esri_ArcGISRuntime_Geometry_Polyline_System_Double_" target="_self"&gt;CreatePointAlong()&lt;/A&gt; method in GeometryEngine, which would work in some cases, but not all, I think. Not sure how it can handle branch-offs and splits in a polyline.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2023 19:26:55 GMT</pubDate>
    <dc:creator>KevinCheriyan</dc:creator>
    <dc:date>2023-07-19T19:26:55Z</dc:date>
    <item>
      <title>How to create Route Event Layer with Maps SDK for .NET?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-create-route-event-layer-with-maps-sdk-for/m-p/1309718#M11992</link>
      <description>&lt;P&gt;&lt;STRONG&gt;What I'm trying to solve:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the distance traversed along a line feature from a point that's on the line. The line features split and contain branches (think river stream) at irregular intervals. I want to solve this problem using .NET Maps SDK in .NET MAUI, using locally stored data from an MMPK. I have a network dataset that contains this data, so I can use the &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Tasks.NetworkAnalysis.html" target="_self"&gt;Network Analysis&lt;/A&gt; namespace.&lt;/P&gt;&lt;P&gt;Our client has a python script that uses arcpy to create a &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/linear-referencing/make-route-event-layer.htm" target="_self"&gt;route event layer&lt;/A&gt;&amp;nbsp;from a service area layer to perform this task. The route events that get created are the point locations that I'm trying to recreate in my .NET application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have tried so far:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this network dataset, I have point "facility" features and line "network" features. With this data, I have created &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Tasks.NetworkAnalysis.ServiceAreaTask.html" target="_self"&gt;ServiceAreaTask&lt;/A&gt; and I'm able to map ServiceAreaPolygons on the map. There is no equivalent of "Create Route Event Layer" in .NET Maps SDK, so I do a couple of things to achieve the same effect (or so I thought). First, I take the ServiceAreaPolygon, create a boundary around the polygon, and see where the line feature in question intersects with the polygon boundary. I figured that since the extent of the Service Area Polygon matches with the impedance cutoff, the boundary on the line should be where the event is.&lt;/P&gt;&lt;P&gt;Now, this works only ~ 50% of the time. ServiceAreaPolygons are created in what seems like, erratic and random places, in areas where there's no data. This gives me extra, incorrect point locations. In other cases, I also end up with less points than I should. Suffice it to say that what I am trying to mimic CreateRouteEventLayer does not work.&lt;/P&gt;&lt;P&gt;Anyone have any idea on what's really happening behind the scenes of CreateRouteEventsLayer that I can also de-construct and apply using .NET Maps SDK? I'm also looking into &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.GeometryEngine.CreatePointAlong.html#Esri_ArcGISRuntime_Geometry_GeometryEngine_CreatePointAlong_Esri_ArcGISRuntime_Geometry_Polyline_System_Double_" target="_self"&gt;CreatePointAlong()&lt;/A&gt; method in GeometryEngine, which would work in some cases, but not all, I think. Not sure how it can handle branch-offs and splits in a polyline.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 19:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-create-route-event-layer-with-maps-sdk-for/m-p/1309718#M11992</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2023-07-19T19:26:55Z</dc:date>
    </item>
  </channel>
</rss>

