I thought it would be really cool to symbolize data from GPS tracks as a tapered line/polygon based on their attributes (I've set my sights on polygon geometry so I could eventually fill said polygons with a gradient fill thereby tying them together). I imagine this to look slighty accordian in nature with fluctuating polygon width as an attribute such as speed changes along some track (see concept image below). It's conceptually similar to the 'Tapered Line' symbol effect in ArcGIS Pro but allows for the ability to fill the polygon and vary the taper by attribute. This would allow me to do some of the data visualisation that would typically occur in graphic design software.

As it stands, the code I've written to achieve this 'nearly' work which is why I'm posting here. I've been able to create the polygons, and modify the taper but there are two main issues I've identified.

- The taper doesn't seem to always respect the attribute value that determines the width (note data points that have speed label of 17 - Center left of image, are more narrow than those that are 10, 11, 12 - Upper left of image). I suspect somethign is wonky with my equations where I calculate the offsets used to "stretch" the polygon width.
- In addition, for a reason that I cannot pin down, there are some polygons that get turned into "bowties" and become multi-part polygons when they should be quadrilaterals (from troubleshooting it seems like my Insert cursor inserted the 4th coordinate pair before the 3rd?)
If anyone has some tips, suggestions, thoughts, or if this code already exists somewhere. I'd be more than grateful to listen and learn.
Warren
Here's my code as it stands now, I've written it to run from a script tool in ArcGIS Pro (I've also attached the script and toolbox).
<SPAN class="comment token"># Move bank data source (albatross GPS tracks)</SPAN>
<SPAN class="comment token"># Dodge S, Bohrer G, Weinzierl R, Davidson SC, Kays R, Douglas D, Cruz S, Han J, Brandes D, Wikelski M (2013)</SPAN>
<SPAN class="comment token"># The Environmental-Data Automated Track Annotation (Env-DATA) System—linking animal tracks with environmental data.</SPAN>
<SPAN class="comment token"># Movement Ecology 1:3. doi:10.1186/2051-3933-1-3</SPAN>
<SPAN class="comment token"># Cruz S, Proaño CB, Anderson D, Huyvaert K, Wikelski M (2013) Data from:</SPAN>
<SPAN class="comment token"># The Environmental-Data Automated Track Annotation (Env-DATA)</SPAN>
<SPAN class="comment token"># System: Linking animal tracks with environmental data. Movebank Data Repository. doi:10.5441/001/1.3hp3s250</SPAN>
<SPAN class="comment token"># imports</SPAN>
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">from</SPAN> math <SPAN class="keyword token">import</SPAN> sqrt
<SPAN class="keyword token">import</SPAN> sys
<SPAN class="keyword token">from</SPAN> math <SPAN class="keyword token">import</SPAN> cos
<SPAN class="comment token"># overwrite the outputs</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="comment token"># Get parameters from dialog</SPAN>
<SPAN class="comment token"># input points</SPAN>
source_points <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># variable parameters</SPAN>
primary_param <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># Parameter to classify and use to "stretch" geometry width</SPAN>
secondary_param <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># Parameter that we'll carry over for symbology purposes</SPAN>
num_breaks <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># Number of classes to break the primary attribute values into</SPAN>
min_width <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># minimum width (metres) that a polygon should be at an end</SPAN>
max_width <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">5</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># maximum width (metres) that a polygon should be at an end</SPAN>
break_dictionary <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token"># output polygons</SPAN>
output_polygons <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">6</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># output location file gdb</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">msg</SPAN><SPAN class="punctuation token">(</SPAN>text<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN>text<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>text<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">width_factor</SPAN><SPAN class="punctuation token">(</SPAN>attribute_value<SPAN class="punctuation token">,</SPAN> dictionary<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> k<SPAN class="punctuation token">,</SPAN> v <SPAN class="keyword token">in</SPAN> dictionary<SPAN class="punctuation token">.</SPAN>items<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> attribute_value <SPAN class="operator token"><=</SPAN> dictionary<SPAN class="punctuation token">[</SPAN>k<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">:</SPAN>
attribute <SPAN class="operator token">=</SPAN> k
<SPAN class="keyword token">break</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
attribute <SPAN class="operator token">=</SPAN> num_breaks
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'assigned: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>attribute<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN> attribute
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">offset_calc</SPAN><SPAN class="punctuation token">(</SPAN>distance<SPAN class="punctuation token">,</SPAN> plane<SPAN class="punctuation token">,</SPAN> latitude<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token"><SPAN># </SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgis.stackexchange.com%2Fquestions%2F2951%2Falgorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters" target="_blank">https://gis.stackexchange.com/questions/2951/algorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters</A></SPAN>
<SPAN class="keyword token">if</SPAN> plane <SPAN class="operator token">==</SPAN> <SPAN class="string token">'y'</SPAN><SPAN class="punctuation token">:</SPAN>
offset <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>distance<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">/</SPAN><SPAN class="number token">111111</SPAN>
offset <SPAN class="operator token">/=</SPAN> <SPAN class="number token">2</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
offset <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>distance<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">/</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">111111</SPAN> <SPAN class="operator token">*</SPAN> cos<SPAN class="punctuation token">(</SPAN>latitude<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
offset <SPAN class="operator token">/=</SPAN> <SPAN class="number token">2</SPAN>
<SPAN class="keyword token">return</SPAN> offset
<SPAN class="comment token"># Understand Attribute Parameter</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Understanding attribute parameter...'</SPAN><SPAN class="punctuation token">)</SPAN>
value_list <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>in_table<SPAN class="operator token">=</SPAN>source_points<SPAN class="punctuation token">,</SPAN> field_names<SPAN class="operator token">=</SPAN>primary_param<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> parameter_cursor<SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Scanning attribute values...'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> parameter_cursor<SPAN class="punctuation token">:</SPAN>
value_list<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Scan complete.\n\n'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Assign min/max values</SPAN>
min_attribute <SPAN class="operator token">=</SPAN> min<SPAN class="punctuation token">(</SPAN>value_list<SPAN class="punctuation token">)</SPAN>
max_attribute <SPAN class="operator token">=</SPAN> max<SPAN class="punctuation token">(</SPAN>value_list<SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Minimum and maximum values assigned: Min({0}), Max({1})'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>min_attribute<SPAN class="punctuation token">,</SPAN> max_attribute<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
range_attribute <SPAN class="operator token">=</SPAN> max_attribute <SPAN class="operator token">-</SPAN> min_attribute
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Range identified: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>range_attribute<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
step <SPAN class="operator token">=</SPAN> range_attribute<SPAN class="operator token">/</SPAN>float<SPAN class="punctuation token">(</SPAN>num_breaks<SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Range step identified: {0}\n'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>step<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Assign polygon width values</SPAN>
width_range <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>max_width<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> float<SPAN class="punctuation token">(</SPAN>min_width<SPAN class="punctuation token">)</SPAN>
width_step <SPAN class="operator token">=</SPAN> width_range<SPAN class="operator token">/</SPAN>float<SPAN class="punctuation token">(</SPAN>num_breaks<SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Assigned width step: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>width_step<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Create dictionary of break values [attribute, width]</SPAN>
<SPAN class="keyword token">for</SPAN> i <SPAN class="keyword token">in</SPAN> range<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> int<SPAN class="punctuation token">(</SPAN>num_breaks<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
break_value <SPAN class="operator token">=</SPAN> i <SPAN class="operator token">*</SPAN> step <SPAN class="operator token">+</SPAN> min_attribute
width_value <SPAN class="operator token">=</SPAN> i <SPAN class="operator token">*</SPAN> width_step <SPAN class="operator token">+</SPAN> float<SPAN class="punctuation token">(</SPAN>min_width<SPAN class="punctuation token">)</SPAN>
break_dictionary<SPAN class="punctuation token">[</SPAN>i<SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>break_value<SPAN class="punctuation token">,</SPAN> width_value<SPAN class="punctuation token">]</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Assigned dictionary break value {0}: {1}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>i<SPAN class="punctuation token">,</SPAN> break_dictionary<SPAN class="punctuation token">[</SPAN>i<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN>break_dictionary<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Create output feature class</SPAN>
workspace_index <SPAN class="operator token">=</SPAN> output_polygons<SPAN class="punctuation token">.</SPAN>rfind<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'\\'</SPAN><SPAN class="punctuation token">)</SPAN>
workspace <SPAN class="operator token">=</SPAN> output_polygons<SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">:</SPAN>workspace_index<SPAN class="punctuation token">]</SPAN>
output_name <SPAN class="operator token">=</SPAN> output_polygons<SPAN class="punctuation token">[</SPAN>workspace_index <SPAN class="operator token">+</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token"># Set spatial reference to match input</SPAN>
sr <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Describe<SPAN class="punctuation token">(</SPAN>source_points<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>spatialReference
msg<SPAN class="punctuation token">(</SPAN>str<SPAN class="punctuation token">(</SPAN>sr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Creating "{0}" feature class to store outputs.'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>output_name<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CreateFeatureclass_management<SPAN class="punctuation token">(</SPAN>out_path<SPAN class="operator token">=</SPAN>workspace<SPAN class="punctuation token">,</SPAN> out_name<SPAN class="operator token">=</SPAN>output_name<SPAN class="punctuation token">,</SPAN> geometry_type<SPAN class="operator token">=</SPAN><SPAN class="string token">"POLYGON"</SPAN><SPAN class="punctuation token">,</SPAN> spatial_reference<SPAN class="operator token">=</SPAN>sr<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Add schema</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Adding standard fields.'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Need to have field type detection eventually</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddFields_management<SPAN class="punctuation token">(</SPAN>in_table<SPAN class="operator token">=</SPAN>output_polygons<SPAN class="punctuation token">,</SPAN> field_description<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'LINE_FID'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SHORT'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'PRIMARY_VALUE'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'DOUBLE'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'PRIMARY_CLASSED'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SHORT'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'SECONDARY_VALUE'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'DOUBLE'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Output feature class created.'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Open search cursor on points in order to gather geometry</SPAN>
index <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
feature_dictionary <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>in_table<SPAN class="operator token">=</SPAN>source_points<SPAN class="punctuation token">,</SPAN> field_names<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'OBJECTID'</SPAN><SPAN class="punctuation token">,</SPAN> primary_param<SPAN class="punctuation token">,</SPAN> secondary_param<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SHAPE@X'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SHAPE@Y'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> s_cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> s_cursor<SPAN class="punctuation token">:</SPAN>
feature_dictionary<SPAN class="punctuation token">[</SPAN>index<SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">]</SPAN>
index <SPAN class="operator token">+=</SPAN> <SPAN class="number token">1</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Point features consumed.'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># msg(str(feature_dictionary))</SPAN>
<SPAN class="comment token"># Puke up features from dictionary</SPAN>
<SPAN class="comment token"># msg('LAST ITEM: {0}'.format(list(feature_dictionary.keys())[-1]))</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>InsertCursor<SPAN class="punctuation token">(</SPAN>in_table<SPAN class="operator token">=</SPAN>output_polygons<SPAN class="punctuation token">,</SPAN> field_names<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'LINE_FID'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'PRIMARY_VALUE'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'PRIMARY_CLASSED'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SECONDARY_VALUE'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SHAPE@'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> i_cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> key<SPAN class="punctuation token">,</SPAN> value <SPAN class="keyword token">in</SPAN> feature_dictionary<SPAN class="punctuation token">.</SPAN>items<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'KEY: {0}, INDEX: {1}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>key<SPAN class="punctuation token">,</SPAN> index<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> key <SPAN class="operator token">==</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Process as first point (triangle)'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">pass</SPAN>
<SPAN class="keyword token">elif</SPAN> index <SPAN class="operator token">==</SPAN> int<SPAN class="punctuation token">(</SPAN>key <SPAN class="operator token">+</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Process as second last point (triangle)'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">pass</SPAN>
<SPAN class="keyword token">elif</SPAN> index <SPAN class="operator token">==</SPAN> int<SPAN class="punctuation token">(</SPAN>key <SPAN class="operator token">+</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Process as last point, therefore skip'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">pass</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Processing as normal point'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"><SPAN># </SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F133897%2Fhow-do-you-find-a-point-at-a-given-perpendicular-distance-from-a-line" target="_blank">https://stackoverflow.com/questions/133897/how-do-you-find-a-point-at-a-given-perpendicular-distance-from-a-line</A></SPAN>
<SPAN class="comment token"># msg(str(feature_dictionary[key]))</SPAN>
<SPAN class="comment token"># Process as usual</SPAN>
<SPAN class="comment token"># POINT 1</SPAN>
<SPAN class="comment token"># Get difference of x between prior point and subsequent</SPAN>
<SPAN class="comment token"># dx = x1 - x2</SPAN>
dx <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="number token">-1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Get difference of y between prior point and subsequent</SPAN>
<SPAN class="comment token"># dy = y1 - y2</SPAN>
dy <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="number token">-1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># dist = sqrt(dx*dx + dy*dy)</SPAN>
dist <SPAN class="operator token">=</SPAN> sqrt<SPAN class="punctuation token">(</SPAN>dx <SPAN class="operator token">*</SPAN> dx <SPAN class="operator token">+</SPAN> dy <SPAN class="operator token">*</SPAN> dy<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Reassign dx and dy</SPAN>
<SPAN class="keyword token">if</SPAN> dx <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
dx <SPAN class="operator token">/=</SPAN> dist
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
dx <SPAN class="operator token">=</SPAN> dx
<SPAN class="keyword token">if</SPAN> dy <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
dy <SPAN class="operator token">/=</SPAN> dist
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
dy <SPAN class="operator token">=</SPAN> dy
<SPAN class="comment token"># Get coordinates for starting vertices (counter-clockwise starting top left)</SPAN>
<SPAN class="comment token"># x3 = x1 + (N/2)*dy</SPAN>
<SPAN class="comment token"># FACTORED</SPAN>
<SPAN class="comment token"># Bookmark primary attribute value</SPAN>
wf <SPAN class="operator token">=</SPAN> width_factor<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> break_dictionary<SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'WF: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>wf<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Bookmark break value</SPAN>
bv <SPAN class="operator token">=</SPAN> break_dictionary<SPAN class="punctuation token">[</SPAN>wf<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'BV: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
x1 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dy
y1 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dx
x2 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dy
y2 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dx
<SPAN class="comment token"># Get difference of x between prior point and subsequent</SPAN>
dx2 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Get difference of y between prior point and subsequent</SPAN>
dy2 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
dist2 <SPAN class="operator token">=</SPAN> sqrt<SPAN class="punctuation token">(</SPAN>dx2 <SPAN class="operator token">*</SPAN> dx2 <SPAN class="operator token">+</SPAN> dy2 <SPAN class="operator token">*</SPAN> dy2<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Reassign dx and dy</SPAN>
<SPAN class="keyword token">if</SPAN> dx2 <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
dx2 <SPAN class="operator token">/=</SPAN> dist2
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
dx2 <SPAN class="operator token">=</SPAN> dx2
<SPAN class="keyword token">if</SPAN> dy2 <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
dy2 <SPAN class="operator token">/=</SPAN> dist2
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
dy2 <SPAN class="operator token">=</SPAN> dy2
<SPAN class="comment token"># Get coordinates for second pair</SPAN>
<SPAN class="comment token"># FACTORED</SPAN>
wf <SPAN class="operator token">=</SPAN> width_factor<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> break_dictionary<SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'WF2: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>wf<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
bv <SPAN class="operator token">=</SPAN> break_dictionary<SPAN class="punctuation token">[</SPAN>wf<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'BV2: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
x3 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dy2
y3 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dx2
x4 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dy2
y4 <SPAN class="operator token">=</SPAN> float<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> offset_calc<SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>bv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">*</SPAN> dx2
<SPAN class="comment token"># Create feature</SPAN>
coordinates <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>x1<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> float<SPAN class="punctuation token">(</SPAN>y1<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>x2<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> float<SPAN class="punctuation token">(</SPAN>y2<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>x4<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> float<SPAN class="punctuation token">(</SPAN>y4<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">(</SPAN>float<SPAN class="punctuation token">(</SPAN>x3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> float<SPAN class="punctuation token">(</SPAN>y3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Attempting insert'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># 'OBJECTID', primary_param, secondary_param, 'SHAPE@X', 'SHAPE@Y'</SPAN>
<SPAN class="comment token"># 'LINE_FID', 'PRIMARY_VALUE', 'PRIMARY_CLASSED', 'SECONDARY_VALUE', 'SHAPE@'</SPAN>
data <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> width_factor<SPAN class="punctuation token">(</SPAN>feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> break_dictionary<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> feature_dictionary<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> coordinates<SPAN class="punctuation token">]</SPAN>
msg<SPAN class="punctuation token">(</SPAN>data<SPAN class="punctuation token">)</SPAN>
i_cursor<SPAN class="punctuation token">.</SPAN>insertRow<SPAN class="punctuation token">(</SPAN>data<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN><SPAN class="punctuation token">:</SPAN>
e <SPAN class="operator token">=</SPAN> sys<SPAN class="punctuation token">.</SPAN>exc_info<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>
msg<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Insert failed: {0}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">.</SPAN>args<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="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>