<?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: Geoprocessing using feature classes from two separate geodatabases in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/geoprocessing-using-feature-classes-from-two/m-p/508869#M39983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Todd,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this method using a python list to store the input feature class names:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Set you parameters (e.g. change to use tool inputs)
gdbInputs =&amp;nbsp; r"c:/temp/Inputs.gdb"
gdbRoutes =&amp;nbsp; r"c:/temp/Routes.gdb"

# Create inputs list
arcpy.env.workspace = gdbInputs
inputList = []
fcList1 = arcpy.ListFeatureClasses()

for fc in fcList1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; inputList.append("{0}/{1}".format(gdbInputs,fc));

# Switch workspace (if required)
arcpy.env.workspace = gdbRoutes

for inputFC in inputList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # find your second feature class based on the last 6 digits
&amp;nbsp;&amp;nbsp;&amp;nbsp; targetFC = "{0}/Route{1}".format(gdbRoutes,inputFC[-6:])&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # run your other processing with inputFC and targetFC
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Input FC: {0}".format(inputFC)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Target FC: {0}".format(targetFC)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au" target="_blank"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:17:59 GMT</pubDate>
    <dc:creator>OwenEarley</dc:creator>
    <dc:date>2021-12-11T22:17:59Z</dc:date>
    <item>
      <title>Geoprocessing using feature classes from two separate geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-using-feature-classes-from-two/m-p/508868#M39982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I seem to have hit a wall in my abilities once again. I have feature classes in two geodatabases. I am trying to iterate through the feature classes in the first geodatabase and based on the last 6 digits of the name find the matching feature class in the second geodatabase. Using the feature class from the first geodatabase in a for in loop and feature class in the second geodatabase that is located based on the last 6 digits of the feature class name, I would like to run the Locate Features Along Route tool using the first fc as the input and the second fc as the input route features. Is this possible? I'm not sure how to use ListFeatureClasses to list fc's in two separate geodatabases as it is environment dependent. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Any help is greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Todd Howell&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 19:53:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-using-feature-classes-from-two/m-p/508868#M39982</guid>
      <dc:creator>ToddHowell</dc:creator>
      <dc:date>2014-06-16T19:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing using feature classes from two separate geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-using-feature-classes-from-two/m-p/508869#M39983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Todd,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this method using a python list to store the input feature class names:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Set you parameters (e.g. change to use tool inputs)
gdbInputs =&amp;nbsp; r"c:/temp/Inputs.gdb"
gdbRoutes =&amp;nbsp; r"c:/temp/Routes.gdb"

# Create inputs list
arcpy.env.workspace = gdbInputs
inputList = []
fcList1 = arcpy.ListFeatureClasses()

for fc in fcList1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; inputList.append("{0}/{1}".format(gdbInputs,fc));

# Switch workspace (if required)
arcpy.env.workspace = gdbRoutes

for inputFC in inputList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # find your second feature class based on the last 6 digits
&amp;nbsp;&amp;nbsp;&amp;nbsp; targetFC = "{0}/Route{1}".format(gdbRoutes,inputFC[-6:])&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # run your other processing with inputFC and targetFC
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Input FC: {0}".format(inputFC)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Target FC: {0}".format(targetFC)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au" target="_blank"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:17:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-using-feature-classes-from-two/m-p/508869#M39983</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2021-12-11T22:17:59Z</dc:date>
    </item>
  </channel>
</rss>

