<?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: Creating Lines of Graticule in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244797#M19008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's exactly&amp;nbsp;what I need! Formatting the "For Loop" was confusing me. Like you mentioned in the previous response I would have gone the route of using AGOL to query the data but for&amp;nbsp;scripting purposes, I needed to make the code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 Mar 2017 17:04:15 GMT</pubDate>
    <dc:creator>EricShreve1</dc:creator>
    <dc:date>2017-03-26T17:04:15Z</dc:date>
    <item>
      <title>Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244792#M19003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am stuck with what step I need to take to create a loop statement to automate the process of creating lines of graticule in python/arcpy. What the end result is to create a shapefile that draws a polyline every 10 degrees for lines of latitude/longitude. An example would be the first line drawing at (-90,180), (90,180) and second line drawing at (-90,170), (90,170) until it gets to -180. Here's my current status of my code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;# Import ArcPy
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;import &lt;/SPAN&gt;&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;# Create empty shapefile
&lt;/SPAN&gt;&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.CreateFeatureclass_management(&lt;SPAN style="color: #a5c261;"&gt;'C:/Python_Testing/Week5/Week5/Data'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'line1.shp'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'POLYLINE'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;spatial_reference&lt;/SPAN&gt;=&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.SpatialReference(&lt;SPAN style="color: #6897bb;"&gt;4326&lt;/SPAN&gt;))
&lt;SPAN style="color: #808080;"&gt;# Create cursor to insert data
&lt;/SPAN&gt;cursor = &lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.da.InsertCursor(&lt;SPAN style="color: #a5c261;"&gt;'C:/Python_Testing/Week5/Week5/Data/line1.shp'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;[&lt;SPAN style="color: #a5c261;"&gt;"SHAPE@"&lt;/SPAN&gt;])

&lt;SPAN style="color: #808080;"&gt;# Writing a multipart feature from an array of points from the same cursor
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;firstPart = &lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Array([&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Point(&lt;SPAN style="color: #6897bb;"&gt;180&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;-&lt;SPAN style="color: #6897bb;"&gt;90&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Point(-&lt;SPAN style="color: #6897bb;"&gt;180&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;-&lt;SPAN style="color: #6897bb;"&gt;90&lt;/SPAN&gt;)])
secondPart = &lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Array([&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Point(&lt;SPAN style="color: #6897bb;"&gt;180&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;-&lt;SPAN style="color: #6897bb;"&gt;90&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Point(&lt;SPAN style="color: #6897bb;"&gt;180&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;90&lt;/SPAN&gt;)])

array = &lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Array([firstPart&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;secondPart])

polyline = &lt;SPAN style="background-color: #344134;"&gt;arcpy&lt;/SPAN&gt;.Polyline(array)
cursor.insertRow([polyline])&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:12:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244792#M19003</guid>
      <dc:creator>EricShreve1</dc:creator>
      <dc:date>2021-12-11T12:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244793#M19004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not just use Create Fishnet to do this?&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/create-fishnet.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/create-fishnet.htm"&gt;Create Fishnet—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2017 12:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244793#M19004</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2017-03-26T12:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244794#M19005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the class I am taking requires submiting a python document.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2017 15:30:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244794#M19005</guid>
      <dc:creator>EricShreve1</dc:creator>
      <dc:date>2017-03-26T15:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244795#M19006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason you have to generate your own?&amp;nbsp; You could just download &lt;A href="https://www.arcgis.com/home/item.html?id=f11bcdc5d484400fa926dcce68de3df7"&gt;World Latitude and Longitude Grids&lt;/A&gt; from ArcGIS Online and use a definition query to select the 10 degree increments you are interested in using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say for whatever reason you want or need to create your own and from scratch using ArcPy.&amp;nbsp; One of the biggest problems you will run into with your current approach is that your lines will not project properly in most world projections.&amp;nbsp; There are a few world projections, like Web Mercator, where the lines you create will line up nicely with actual latitude and longitude, but for most that won't be the case because you haven't created a curve but a straight line with only two points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several ways to address the projection issue.&amp;nbsp; One is to create densified lines instead of a line with only two points.&amp;nbsp; You can either densify the line when constructing it or make the lines and then run &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/geodetic-densify.htm"&gt;Geodetic Densify&lt;/A&gt; on the final feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach would be to build true curved lines.&amp;nbsp; This is a bit tricky because you would have to use Esri JSON to define the lines since ArcPy Geometry constructors don't work with curves.&amp;nbsp; You would also need to make some decisions on whether to use simple circular arcs as approximations or elliptical arcs.&amp;nbsp; If the latter, you would need to make assumptions about major and minor axis.&amp;nbsp; Although I would try the true curves for kicks, creating the lines and densifying is much more straightforward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding existing geoprocessing tools, I have found &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/create-fishnet.htm"&gt;Create Fishnet&lt;/A&gt; to be clunky when working with hemispheric, and especially global, grids.&amp;nbsp; There is also the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/cartography-toolbox/make-grids-and-graticules-layer.htm"&gt;Make Grids and Graticules &lt;/A&gt;tool, but that has a bit of a learning curve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data team at Esri has already makes some of these choices and done the work for folks, I encourage you to think about downloading and using the data I referenced above if possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2017 15:50:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244795#M19006</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-26T15:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244796#M19007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since this is for a class, I will demonstrate creating the longitude lines and you can modify the code to generate latitude lines:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;SR &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

long_lines &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; x &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; xrange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;190&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; line &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;90&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; y&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10.0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; y &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; xrange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; long_lines&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polyline&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;coords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; coords &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; line&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SR
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;long_lines&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"in_memory/long_lines"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code above creates longitude lines every 10 degrees.&amp;nbsp; Instead of densifying afterwards, the code creates lines that are densified at 0.1 degree increments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244796#M19007</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T12:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244797#M19008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's exactly&amp;nbsp;what I need! Formatting the "For Loop" was confusing me. Like you mentioned in the previous response I would have gone the route of using AGOL to query the data but for&amp;nbsp;scripting purposes, I needed to make the code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2017 17:04:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244797#M19008</guid>
      <dc:creator>EricShreve1</dc:creator>
      <dc:date>2017-03-26T17:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Lines of Graticule in Python</title>
      <link>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244798#M19009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem Eric.&amp;nbsp; As much as grabbing a standard Esri data set from AGOL makes sense in most cases, there is also value in learning to gin up the data yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Line 8 above, or what looks like Line 7.5 in my browser, I pass a generator expression to ArcPy Array to build the polyline.&amp;nbsp; If you are learning Python, I strongly encourage you to read up on comprehensions (list, dictionary, set) and generator expressions.&amp;nbsp; Comprehensions are typically some of the most performant ways to generate lists, dicts, etc...., and I think most people find them very readable as long as the logic doesn't get too complex in them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example, my original code can be re-written using a list comprehension:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;SR &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

long_lines &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polyline&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;90&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; y&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; y &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; xrange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SR
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; x &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; xrange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;190&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;long_lines&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"in_memory/long_lines"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether the list comprehension is more readable than my original code is arguable.&amp;nbsp; For me, I find working and reading comprehensions very natural, but I have been working with the language for years.&amp;nbsp; I think for people new to Python, they take some getting used to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:13:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-lines-of-graticule-in-python/m-p/244798#M19009</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T12:13:03Z</dc:date>
    </item>
  </channel>
</rss>

