<?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 Sequence contains no elements in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/sequence-contains-no-elements/m-p/112515#M1283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I developed custom arc with center, start and end point (code of arc) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.Geometry.PointCollection pcol = new Esri.ArcGISRuntime.Geometry.PointCollection(SpatialReferences.WebMercator);&lt;BR /&gt; SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.FromRgb(0x00, 0x00, 0x00), 1);&lt;BR /&gt; SimpleMarkerSymbol redCircleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.FromRgb(0xFF, 0x00, 0x00), 5);&lt;BR /&gt; if (points_Line.Count ==2)&lt;BR /&gt; {&lt;BR /&gt; //Create point collections&lt;BR /&gt; MapPoint point=new MapPoint(x, y,z, SpatialReferences.WebMercator);&lt;BR /&gt; double p1x = points_Line[1].X - points_Line[0].X;&lt;BR /&gt; double p1y = points_Line[1].Y - points_Line[0].Y;&lt;BR /&gt; double p2x = point.X - points_Line[0].X;&lt;BR /&gt; double p2y = point.Y - points_Line[0].Y;&lt;BR /&gt; double slice = 2 * Math.PI / 360;&lt;BR /&gt; CalculateAngle calculateAngle1 = new CalculateAngle(p1x, p1y);&lt;BR /&gt; CalculateAngle calculateAngle2 = new CalculateAngle(p2x, p2y);&lt;BR /&gt; double angle1 = calculateAngle1.Azimute();&lt;BR /&gt; double angle2 = calculateAngle2.Azimute();&lt;BR /&gt; double startAngle, endAngle, viewAngle;&lt;BR /&gt; Polyline polyline = new Polyline(points_Line);&lt;BR /&gt; double radius = Math.Round(GeometryEngine.LengthGeodetic(polyline, LinearUnits.Meters, GeodeticCurveType.Geodesic), 2);&lt;BR /&gt; Graphic graphicRad = new Graphic(polyline, lineSymbol);&lt;BR /&gt; _overlay_PolylineRevers.Graphics.Add(graphicRad);&lt;/P&gt;&lt;P&gt;if (angle1 &amp;gt;= angle2)&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle2;&lt;BR /&gt; endAngle = angle1;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = endAngle; i &amp;gt;= startAngle; i--)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, SpatialReferences.WebMercator)); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle1;&lt;BR /&gt; endAngle = angle2;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = startAngle; i &amp;lt;= endAngle; i++)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, SpatialReferences.WebMercator)); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; Polyline p = new Polyline(pcol);&lt;BR /&gt; // Create the graphic with polyline and symbol&lt;BR /&gt; Graphic graphicPoly = new Graphic(p, lineSymbol);&lt;/P&gt;&lt;P&gt;//Add atribute&lt;BR /&gt; string id = GlobalVar.CountGraphic.ToString();&lt;BR /&gt; graphicPoly.Attributes.Add("UID", id);&lt;BR /&gt; graphicPoly.Attributes.Add("Label", " ");&lt;BR /&gt; graphicPoly.Attributes.Add("Type", "arc");&lt;BR /&gt; _overlay_Polyline.Graphics.Add(graphicPoly);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When intersect this arc with rectangle (code of rectangle) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var rectangle = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appear next message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/430475_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solved this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2018 23:53:45 GMT</pubDate>
    <dc:creator>KiroAndreev1</dc:creator>
    <dc:date>2018-11-28T23:53:45Z</dc:date>
    <item>
      <title>Sequence contains no elements</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/sequence-contains-no-elements/m-p/112515#M1283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I developed custom arc with center, start and end point (code of arc) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.Geometry.PointCollection pcol = new Esri.ArcGISRuntime.Geometry.PointCollection(SpatialReferences.WebMercator);&lt;BR /&gt; SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.FromRgb(0x00, 0x00, 0x00), 1);&lt;BR /&gt; SimpleMarkerSymbol redCircleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.FromRgb(0xFF, 0x00, 0x00), 5);&lt;BR /&gt; if (points_Line.Count ==2)&lt;BR /&gt; {&lt;BR /&gt; //Create point collections&lt;BR /&gt; MapPoint point=new MapPoint(x, y,z, SpatialReferences.WebMercator);&lt;BR /&gt; double p1x = points_Line[1].X - points_Line[0].X;&lt;BR /&gt; double p1y = points_Line[1].Y - points_Line[0].Y;&lt;BR /&gt; double p2x = point.X - points_Line[0].X;&lt;BR /&gt; double p2y = point.Y - points_Line[0].Y;&lt;BR /&gt; double slice = 2 * Math.PI / 360;&lt;BR /&gt; CalculateAngle calculateAngle1 = new CalculateAngle(p1x, p1y);&lt;BR /&gt; CalculateAngle calculateAngle2 = new CalculateAngle(p2x, p2y);&lt;BR /&gt; double angle1 = calculateAngle1.Azimute();&lt;BR /&gt; double angle2 = calculateAngle2.Azimute();&lt;BR /&gt; double startAngle, endAngle, viewAngle;&lt;BR /&gt; Polyline polyline = new Polyline(points_Line);&lt;BR /&gt; double radius = Math.Round(GeometryEngine.LengthGeodetic(polyline, LinearUnits.Meters, GeodeticCurveType.Geodesic), 2);&lt;BR /&gt; Graphic graphicRad = new Graphic(polyline, lineSymbol);&lt;BR /&gt; _overlay_PolylineRevers.Graphics.Add(graphicRad);&lt;/P&gt;&lt;P&gt;if (angle1 &amp;gt;= angle2)&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle2;&lt;BR /&gt; endAngle = angle1;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = endAngle; i &amp;gt;= startAngle; i--)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, SpatialReferences.WebMercator)); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle1;&lt;BR /&gt; endAngle = angle2;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = startAngle; i &amp;lt;= endAngle; i++)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, SpatialReferences.WebMercator)); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; Polyline p = new Polyline(pcol);&lt;BR /&gt; // Create the graphic with polyline and symbol&lt;BR /&gt; Graphic graphicPoly = new Graphic(p, lineSymbol);&lt;/P&gt;&lt;P&gt;//Add atribute&lt;BR /&gt; string id = GlobalVar.CountGraphic.ToString();&lt;BR /&gt; graphicPoly.Attributes.Add("UID", id);&lt;BR /&gt; graphicPoly.Attributes.Add("Label", " ");&lt;BR /&gt; graphicPoly.Attributes.Add("Type", "arc");&lt;BR /&gt; _overlay_Polyline.Graphics.Add(graphicPoly);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When intersect this arc with rectangle (code of rectangle) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var rectangle = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appear next message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/430475_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solved this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 23:53:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/sequence-contains-no-elements/m-p/112515#M1283</guid>
      <dc:creator>KiroAndreev1</dc:creator>
      <dc:date>2018-11-28T23:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sequence contains no elements</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/sequence-contains-no-elements/m-p/112516#M1284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this error occur in GeometryEngine.Intersects call? If yes, can you share the arc geometry input? You can send its JSON. Although, I'm not sure if deserializing geometry back will fix the issue.&amp;nbsp; Maybe inspect the part and points properties of this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2018 21:23:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/sequence-contains-no-elements/m-p/112516#M1284</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2018-11-30T21:23:32Z</dc:date>
    </item>
  </channel>
</rss>

