<?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: Create ellipse from json array. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546161#M50880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. This gives me a path to go down. The rotation part of the equation is crucial for this process.&lt;/P&gt;&lt;P&gt;Do you know if there is a supplemental process that can rotate the graphic after it is drawn based on that field? I'm sure i could convert the degrees to radians or change it from an azimuth if I had to. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jan 2016 19:49:21 GMT</pubDate>
    <dc:creator>JoshuaMcCurry</dc:creator>
    <dc:date>2016-01-14T19:49:21Z</dc:date>
    <item>
      <title>Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546157#M50876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;I’ve got an array of points that include location information, as well as information that defines a geographical ellipse.&amp;nbsp; Although I can plot the points via lat/lon, I’m not sure how to draw an ellipse with the data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;The data includes the following information, per point (which is the center of the ellipse):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Latitude&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Longitude&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Ellipse Bearing (bearing of the major axis of the ellipse from true north)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Major (width in meters of the ellipse along the major axis)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Minor (width in meters of the ellipse along the perpendicular axis)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Sample data set:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;[{“lat”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 33.678265&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “lon”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; -86.337571&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “bearing”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 76&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “major”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 465&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “minor”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 411&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;{“lat”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 33.6779101&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “lon”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; -86.3448787&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “bearing”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 130&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “major”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 599&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;, “minor”:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; 481&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;}]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;It would appear from what I’ve looked at online that there are two possible solutions…either calculate a polygon that emulates the ellipse, or to draw it with a library like DOJO.&amp;nbsp;&amp;nbsp; I’m not skilled at custom programming, and I’m wondering if someone could help me come up with a function that accomplishes either giving a polygon that I can add to the map to emulate the ellipse, or a function that utilizes DOJO to accurately draw the ellipse to scale on the map. Thank you for any suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 18:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546157#M50876</guid>
      <dc:creator>JoshuaMcCurry</dc:creator>
      <dc:date>2016-01-13T18:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546158#M50877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this will help or not, but &lt;A href="http://darrenwiens.net/paperjs_draw_ellipse.html"&gt;here &lt;/A&gt;is an example of drawing an ellipse given axis values (maxWidth &amp;amp; maxHeight). It uses paperjs but the math should be the same regardless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main meat of the code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (counter&amp;lt;885)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; t = (Math.sin(counter * (180/Math.PI)/10800) * Math.PI) + Math.PI;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = (maxWidth/2) + a * Math.cos(t);&lt;/P&gt;&lt;P&gt;&amp;nbsp; y = (maxHeight/2) + b * Math.sin(t);&lt;/P&gt;&lt;P&gt;&amp;nbsp; path.add(new Point(x,y));&lt;/P&gt;&lt;P&gt;&amp;nbsp; counter++;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I essentially stole the idea from &lt;A href="https://en.wikipedia.org/wiki/Ellipse"&gt;this Wikipedia page&lt;/A&gt;, which includes it and other methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit 2: I see you need to rotate the ellipse by a bearing. My example will not do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:20:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546158#M50877</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-01-13T19:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546159#M50878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;I think there are a few things to bear in mind:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;the center of the ellipse is in decimal degrees, probably WGS84, but the major and minor axis are most likely in other units. You will probably has to project the data, create the ellipse and project back to WGS to make it work&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;I think the snippet provided by Darren does not include rotation (bearing)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546159#M50878</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-01-13T19:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546160#M50879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the easiest way of doing this would be to create a simple geoprocessing service that takes the "table" with ellipse definitions and throws back the ellipses using the tool Table to Ellipse:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/168629_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;This tool takes into account that your XY may be specified as degrees and the definitions can be metric.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/168630_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;Is the bearing specified as geograhic rotation (clockwise starting North with 0°?)&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/168631_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;See: &lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/table-to-ellipse.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/table-to-ellipse.htm"&gt;Table To Ellipse—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 11:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546160#M50879</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-01-14T11:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546161#M50880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. This gives me a path to go down. The rotation part of the equation is crucial for this process.&lt;/P&gt;&lt;P&gt;Do you know if there is a supplemental process that can rotate the graphic after it is drawn based on that field? I'm sure i could convert the degrees to radians or change it from an azimuth if I had to. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 19:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546161#M50880</guid>
      <dc:creator>JoshuaMcCurry</dc:creator>
      <dc:date>2016-01-14T19:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546162#M50881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response. I left some of the background out of this adventure to keep from cluttering the original post. I have tried the "Table to Ellipse" tool and you are correct, It does exactly what I need it to do, BUT, by the time i turn it into a geoprocessing service and give it a production size dataset (thousands of points), the performance starts tanking. This is the reason I'm hoping the javascript/graphic approach (or anything else) is the way to go. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 20:02:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546162#M50881</guid>
      <dc:creator>JoshuaMcCurry</dc:creator>
      <dc:date>2016-01-14T20:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546163#M50882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having thousand of features can create problems for a web application. Do you want to create them as client side graphics? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did came across some Python code to generate the ellipse (using numpy), but I'm sure there are ways to do this in JavaScript too. The number of ellipses may need some reconsideration. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 20:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546163#M50882</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-01-14T20:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546164#M50883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think client side is the way to go. I imagine it working similar to the way the "Geodesic Buffers" sample works: &lt;A href="http://developers.arcgis.com/javascript/samples/ge_geodesic_buffers/"&gt;http://developers.arcgis.com/javascript/samples/ge_geodesic_buffers/&lt;/A&gt;.&amp;nbsp; I will test to see if I can throw a large number of points at this sample and see how performance is. Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 20:39:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546164#M50883</guid>
      <dc:creator>JoshuaMcCurry</dc:creator>
      <dc:date>2016-01-14T20:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546165#M50884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a Python implementation that should be mostly portable to JavaScript:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; h = 1000 # x coord of ellipse centre
... k = 100 # y coord of ellipse centre
... a = 5 # unrotated x axis
... b = 10 # unrotated y axis
... ang = math.radians(45) # rotation, counter-clockwise, from north
... points = []
... for i in range(360): # one point per degree, change if you wish
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t = math.radians(i) # ellipse math
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = a*math.cos(t) # ellipse math
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = b*math.sin(t) # ellipse math
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rot_x = h+(x*math.cos(ang))-(y*math.sin(ang)) # rotate/transpose ellipse
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rot_y = k+(y*math.cos(ang))+(x*math.sin(ang)) # rotate/transpose ellipse
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points.append(arcpy.PointGeometry(arcpy.Point(rot_x,rot_y))) # save points to list&amp;nbsp;&amp;nbsp; 
... arcpy.CopyFeatures_management(points,r'in_memory\points') # save points to disk&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="168936" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/168936_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;Helpful links:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.maa.org/external_archive/joma/Volume8/Kalman/General.html" title="http://www.maa.org/external_archive/joma/Volume8/Kalman/General.html" rel="nofollow noopener noreferrer" target="_blank"&gt;The Most Marvelous Theorem in Mathematics&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.mathopenref.com/coordparamellipse.html" title="http://www.mathopenref.com/coordparamellipse.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Parametric Equation of an Ellipse - Math Open Reference&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:38:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546165#M50884</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T23:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create ellipse from json array.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546166#M50885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to jump on the thread, but I'm having problems serving the TabletoEllipse tool as a GP service - however it seems like it's been successful for you (if slow!). My problem is that the distance parameters&amp;nbsp;seem to turn from string options (e.g. KILOMETERS, METERS) into integers (e.g. 9036) at the service publishing dialogue, which propogates to the service, so it won't run. I was wondering if there was something I was missing on the server side, seems like it's missing a domain lookup or something. Thanks for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 09:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-ellipse-from-json-array/m-p/546166#M50885</guid>
      <dc:creator>AnneleyMcMillan2</dc:creator>
      <dc:date>2016-09-22T09:10:52Z</dc:date>
    </item>
  </channel>
</rss>

