helo evrybody
I would like to create an arc (a quarter of the circle to which I know the center, the radius, the angle of orientation (
α)
The arcgis.geometry.Polyline — arcgis 1.5.1 documentation references arcs/curves, but it doesn't follow through:
Polylinehttps://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geometry.html#polylineclassarcgis.geometry.Polyline(iterable=None, **kwargs)https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geometry.html#arcgis.geometry.PolylineA polyline contains an array of paths or curvePaths and a spatialReference. For polylines with curvePaths, see the sections on JSON curve object and Polyline with curve. Each path is represented as an array of points, and each point in the path is represented as an array of numbers. A polyline can also have boolean-valued hasM and hasZ fields. See the description of multipoints for details on how the point arrays are interpreted. An empty polyline is represented with an empty array for the paths field. Nulls and/or NaNs embedded in an otherwise defined coordinate stream for polylines/polygons is a syntax error.coordinates()
arcgis.geometry.
Polyline
A polyline contains an array of paths or curvePaths and a spatialReference. For polylines with curvePaths, see the sections on JSON curve object and Polyline with curve. Each path is represented as an array of points, and each point in the path is represented as an array of numbers. A polyline can also have boolean-valued hasM and hasZ fields. See the description of multipoints for details on how the point arrays are interpreted. An empty polyline is represented with an empty array for the paths field. Nulls and/or NaNs embedded in an otherwise defined coordinate stream for polylines/polygons is a syntax error.
coordinates
So where are the "sections on JSON curve object and Polyline with curve" that the documentation mentions? They are in the Geometry objects—Common Data Types | ArcGIS for Developers documentation:
JSON curve objectAt 10.3, a circular arc, an elliptical arc, and a Bézier curve can be represented as a JSON curve object. A curve object is a segment in a polyline or polygon. It cannot be used as a stand-alone object.A curve object is given in a compact "curve to" manner with the first element representing the "to" point or end point. The "from" point is derived from the previous segment or curve object.The supported curve objects are as follows:Circular Arc "c"Defined by an end point and an interior point{"c": [[x, y, <z>, <m>],[interior_x, interior_y]]}
At 10.3, a circular arc, an elliptical arc, and a Bézier curve can be represented as a JSON curve object. A curve object is a segment in a polyline or polygon. It cannot be used as a stand-alone object.
A curve object is given in a compact "curve to" manner with the first element representing the "to" point or end point. The "from" point is derived from the previous segment or curve object.
The supported curve objects are as follows:
and
Polyline with curvesA polyline with curves contains an array of curvePaths and an optional spatialReference. See the section on JSON curve object. If you need to interoperate with a new (10.3 or later) and an older server (prior to 10.3), you can pass two variants in the JSON object using curvePaths for the new server and paths for the old server, which are interpreted as line segments.Each curve path is represented as an array containing points and curve objects.{"curvePaths": [start point, next point or curve object, … ] }JSON examplesExample 1A polyline that is a circular arc from (0, 0) to (3, 3) through (1, 4).{"curvePaths": [[[0,0], {"c": [[3,3],[1,4]]} ]]}
A polyline with curves contains an array of curvePaths and an optional spatialReference. See the section on JSON curve object. If you need to interoperate with a new (10.3 or later) and an older server (prior to 10.3), you can pass two variants in the JSON object using curvePaths for the new server and paths for the old server, which are interpreted as line segments.
Each curve path is represented as an array containing points and curve objects.
{"curvePaths": [start point, next point or curve object, … ] }
A polyline that is a circular arc from (0, 0) to (3, 3) through (1, 4).
{"curvePaths": [[[0,0], {"c": [[3,3],[1,4]]} ]]}
Using Example 1 above:
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> <SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>geometry <SPAN class="keyword token">import</SPAN> Polyline <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> arc <SPAN class="operator token">=</SPAN> Polyline<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">"curvePaths"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="string token">"c"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> arc<SPAN class="punctuation token">.</SPAN>length <SPAN class="number token">7.777257539739537</SPAN> <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
arcgis.geometry module — arcgis 1.5.1 documentation none found
Create arc segments and curves—ArcGIS Pro | ArcGIS Desktop in Pro you can
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.