<?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 Converting Polyline into evenly spaced MapPoints in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592494#M7268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently trying convert a Polyline into evenly spaced MapPoints. For instance if I have Polyline of two points such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var builder = new PolylineBuilder(SpatialReference.Wgs84);&lt;/P&gt;&lt;P&gt;var part = new List&amp;lt;MapPoint&amp;gt;();&lt;/P&gt;&lt;P&gt;part.Add(new MapPoint(x1, y1);&lt;/P&gt;&lt;P&gt;part.Add(new MapPoint(x2,y2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;builder.AddPart(part);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var polyLine = builder.ToGeometry();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to specify a certain spacing e.g. 10 meters, and then generate n different MapPoints along the Polyline. For example, if the total distance (L2) between the vertices(x1,y1), (x2,y2) on the Polyline is 95 meters then I would generate 9 MapPoints that are 10 meters spaced apart (the remaining 5 meters would be disregarded).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify a little more, the distance between the two Polyline vertices will not be significantly large (they definitely will be in the same UTM zone) so it is safe to assume the line will not be curved, and is straight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2020 20:23:19 GMT</pubDate>
    <dc:creator>DanSepeda</dc:creator>
    <dc:date>2020-09-15T20:23:19Z</dc:date>
    <item>
      <title>Converting Polyline into evenly spaced MapPoints</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592494#M7268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently trying convert a Polyline into evenly spaced MapPoints. For instance if I have Polyline of two points such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var builder = new PolylineBuilder(SpatialReference.Wgs84);&lt;/P&gt;&lt;P&gt;var part = new List&amp;lt;MapPoint&amp;gt;();&lt;/P&gt;&lt;P&gt;part.Add(new MapPoint(x1, y1);&lt;/P&gt;&lt;P&gt;part.Add(new MapPoint(x2,y2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;builder.AddPart(part);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var polyLine = builder.ToGeometry();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to specify a certain spacing e.g. 10 meters, and then generate n different MapPoints along the Polyline. For example, if the total distance (L2) between the vertices(x1,y1), (x2,y2) on the Polyline is 95 meters then I would generate 9 MapPoints that are 10 meters spaced apart (the remaining 5 meters would be disregarded).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify a little more, the distance between the two Polyline vertices will not be significantly large (they definitely will be in the same UTM zone) so it is safe to assume the line will not be curved, and is straight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 20:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592494#M7268</guid>
      <dc:creator>DanSepeda</dc:creator>
      <dc:date>2020-09-15T20:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Polyline into evenly spaced MapPoints</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592495#M7269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I realized I could convert from lat/lon points &amp;lt;---&amp;gt; UTM coordinates using CoordinateFormatter.ToUTM() &amp;lt;---&amp;gt; CoordinateFormatter.FromUTM(). If I convert into UTM coordinates then I should be able to find the angle between the two vertices using arctan2() and then recursively add points using ynew = r * sin(angle) + yprev, xnew = r * cos(angle) + xprev. Then convert back to lat/lon points and generate the mapPoints that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if this is the most effecient way, but it's the first thing that came to my mind. I would still appreciate suggestions/responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 20:52:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592495#M7269</guid>
      <dc:creator>DanSepeda</dc:creator>
      <dc:date>2020-09-15T20:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Polyline into evenly spaced MapPoints</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592496#M7270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan. You should use the&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/latest/wpf/api-reference/html/M_Esri_ArcGISRuntime_Geometry_GeometryEngine_DensifyGeodetic.htm"&gt;DensifyGeodetic method&lt;/A&gt;&amp;nbsp;in GeometryEngine. This method does what you describe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example code would look like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Polyline densifiedLine = (Polyline)GeometryEngine.DensifyGeodetic(polyLine, 10, LinearUnits.Meters, GeodeticCurveType.Geodesic);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can get all of the map points from the resulting&amp;nbsp;Polyline.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var points = densifiedLine.Parts.SelectMany(part =&amp;gt; part.Points);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;We have a &lt;A href="https://developers.arcgis.com/net/latest/wpf/sample-code/densify-and-generalize/"&gt;sample for densified and generalized geometry.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 22:56:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592496#M7270</guid>
      <dc:creator>ZackAllen</dc:creator>
      <dc:date>2020-09-15T22:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Polyline into evenly spaced MapPoints</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592497#M7271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks nice simple and exactly what I was looking for. Thanks Zack!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 23:20:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-polyline-into-evenly-spaced-mappoints/m-p/592497#M7271</guid>
      <dc:creator>DanSepeda</dc:creator>
      <dc:date>2020-09-15T23:20:46Z</dc:date>
    </item>
  </channel>
</rss>

