<?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 Feature to Line on feature selections with ArcPy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746987#M57739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to collapse parallel polylines (dual carriageways in a shapefile of roads) to single centrelines. I'm aware of cartography's dual lines to centerline tool, but I find Feature To Line (Data Management) slightly more reliable. The challenge is that whichever function is used requires a large tolerance (e.g. 10m+) so must be applied to custom selections of data in order to avoid creating new artifacts between unrelated pairs - hence the need for custom selections, which as far as I can tell these functions can't handle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Grateful for any advice from high ArcPy wizards on how best to approach this. I'm pretty new to ArcPy so any advice on e.g. creating temporary layers to work with would be very helpful. As a starting point please just assume a polylines shapefile. The planned workflow is to rejoin these with the other road data once they've been collapsed. Many thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 May 2013 08:39:20 GMT</pubDate>
    <dc:creator>RobinEdwards</dc:creator>
    <dc:date>2013-05-24T08:39:20Z</dc:date>
    <item>
      <title>Feature to Line on feature selections with ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746987#M57739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to collapse parallel polylines (dual carriageways in a shapefile of roads) to single centrelines. I'm aware of cartography's dual lines to centerline tool, but I find Feature To Line (Data Management) slightly more reliable. The challenge is that whichever function is used requires a large tolerance (e.g. 10m+) so must be applied to custom selections of data in order to avoid creating new artifacts between unrelated pairs - hence the need for custom selections, which as far as I can tell these functions can't handle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Grateful for any advice from high ArcPy wizards on how best to approach this. I'm pretty new to ArcPy so any advice on e.g. creating temporary layers to work with would be very helpful. As a starting point please just assume a polylines shapefile. The planned workflow is to rejoin these with the other road data once they've been collapsed. Many thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 08:39:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746987#M57739</guid>
      <dc:creator>RobinEdwards</dc:creator>
      <dc:date>2013-05-24T08:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Feature to Line on feature selections with ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746988#M57740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your answer is mentioned in your post. Passing a layer created with a definition query will provide subsets of the source data. You can then merge the outputs from each itteration. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make the subsets&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Attribute your source data with an id indicating which subset it should be processed in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using, say, a field called FIELD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and identifing features in, say, four groups identifed by letters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;theList = ['a', 'b', 'c', 'd'] for each in theList: &amp;nbsp;&amp;nbsp;&amp;nbsp; defQuery = "\"FIELD\" = '%s'" % (each) &amp;nbsp;&amp;nbsp;&amp;nbsp; print defQuery&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;continue the loop by&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;passing the defQuery to CreateFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;then pass the feature layer to the tool you want (Feature To Line, it seems).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;then delete the layer and continue by looping to the next letter in for loop.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 11:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746988#M57740</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2013-05-24T11:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Feature to Line on feature selections with ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746989#M57741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Spot on! Thank you Mark.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 13:42:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-to-line-on-feature-selections-with-arcpy/m-p/746989#M57741</guid>
      <dc:creator>RobinEdwards</dc:creator>
      <dc:date>2013-05-24T13:42:35Z</dc:date>
    </item>
  </channel>
</rss>

