<?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: Select parcels (by county fips) from SDE layer into shapefile. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513050#M40306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kerry,&lt;BR /&gt;The information in the lookup table identifys all 87 unique fips codes for Minnesota but the feature class of parcel data includes other states so that's why there is a state field in the lookup table as well, all with MN as the attribute. So yes, every fips listed in one field and another field with state abbrev (MN), see attached table.&amp;nbsp; Each exported shapefile should correspond to a single fips code.&amp;nbsp; Also, the path to the SDE layer is as follows:&amp;nbsp; Database Connections\LAND_P.sde&lt;BR /&gt;The feature class is called:&amp;nbsp; PARCELS.PARCELS&lt;BR /&gt;&lt;BR /&gt;Hope this all helps!&lt;BR /&gt;&lt;BR /&gt;Jim&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh, I forgot the attributes of the PARCELS.PARCELS table.&amp;nbsp; They are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FIPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STATE_CODE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2014 18:33:29 GMT</pubDate>
    <dc:creator>JimFritz</dc:creator>
    <dc:date>2014-06-24T18:33:29Z</dc:date>
    <item>
      <title>Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513044#M40300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an SDE layer of parcel data from which I want to export out (by state code and county fips code) each county separately into it's own shapefile.&amp;nbsp; I have a list of state and fips codes in a separate dbf.&amp;nbsp; I suppose there is a way to pass values from the dbf listing to perform the exports.&amp;nbsp; Could someone help with providing a Python script to work with?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim F.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513044#M40300</guid>
      <dc:creator>JimFritz</dc:creator>
      <dc:date>2014-06-23T19:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513045#M40301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a little script that might help.&amp;nbsp; You would need to edit 4 lines (indicated with comments) to refer to your SDE data, though.&amp;nbsp; The script could be run from either the ArcMap Python window, or a Python IDE window.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to re-run the script, you'd have to delete the shapefiles manually because they can't be overwritten.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the fips code does not specify the state, you'd need to specify the state using an additional field... which would require about 4 more lines of code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

#Next 4 lines must be edited to correspond to your data and directories.
fc = r"Database Connections\GDB_HMS.sde\GDB_HMS.HMSADMIN.rdsmall_arc"&amp;nbsp;&amp;nbsp;&amp;nbsp; #original dataset path
shortName = "rdsmall_arc"&amp;nbsp;&amp;nbsp;&amp;nbsp; #a simplified dataset name (without "." characters found in our SDE dataset names)
fipsField = "FIPS"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #name of the field that is used to subdivide dataset
outputFolder = r"V:\Projects\Shared\kalley\Documentation\rdsmall"&amp;nbsp;&amp;nbsp;&amp;nbsp; #folder path where shape files should go

fipsList = sorted(set([code[0] for code in arcpy.da.SearchCursor(fc, fipsField)])) #creates a sorted list of unique fips codes in dataset

for fipsCode in fipsList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; outputName = "{0}_{1}".format(shortName, str(fipsCode)) #new filename will look like shortName_fipsCode.shp
&amp;nbsp;&amp;nbsp;&amp;nbsp; query = "{0} = {1}".format(fipsField, str(fipsCode)) #assumes fipsCode is an integer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion(fc, outputFolder, outputName, query)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Created {0}\n".format(outputName))

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513045#M40301</guid>
      <dc:creator>KerryAlley</dc:creator>
      <dc:date>2021-12-11T22:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513046#M40302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kerry,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the quick response.&amp;nbsp; Not being a Python script writer, I'll need some more code, please.&amp;nbsp; First, the fips code field in both the sde and related table is a string field.&amp;nbsp; I now have a "state" field (string) in the look-up table so I'll need those extra 4 lines of code you mentioned.&amp;nbsp;&amp;nbsp; For the connection to SDE, here is what the Instance field reads under Layer Properties, "sde:oracle$sde:oracle11g:LANDP.xcelenergy.com".&amp;nbsp; Looks different than yours.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any assistance would be appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 13:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513046#M40302</guid>
      <dc:creator>JimFritz</dc:creator>
      <dc:date>2014-06-24T13:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513047#M40303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Kerry,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response.&amp;nbsp; Not being a Python script writer, I'll need some more code, please.&amp;nbsp; First, the fips code field in both the sde and related table is a string field.&amp;nbsp; I now have a "state" field (string) in the look-up table so I'll need those extra 4 lines of code you mentioned.&amp;nbsp;&amp;nbsp; For the connection to SDE, here is what the Instance field reads under Layer Properties, "sde:oracle$sde:oracle11g:LANDP.xcelenergy.com".&amp;nbsp; Looks different than yours.&lt;BR /&gt;&lt;BR /&gt;Any assistance would be appreciated!&lt;BR /&gt;&lt;BR /&gt;Jim&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerry, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is some more info that may help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pathname to SDE layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Analysis\GIS_Data\LAND_P.sde\PARCELS.PARCELS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pathname to lookup table:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S:\General-Offices-GO-Trans\SLR-Mapping\GIS_Analysis\GIS_Data\County_Boundaries\Minnesota\mn\County_List_MN.dbf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 14:43:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513047#M40303</guid>
      <dc:creator>JimFritz</dc:creator>
      <dc:date>2014-06-24T14:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513048#M40304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The paths do help.&amp;nbsp; It isn't clear to me, however, exactly what information is in your lookup table or how you want to use it.&amp;nbsp; For example, does the lookup table identify which fips codes belong to which state?&amp;nbsp; If so, how?&amp;nbsp; Is every fips code listed in one field, with another field providing the name of the state the code belongs to?&amp;nbsp; Will each shape file correspond to a single or multiple fips codes?&amp;nbsp; I would need to understand these kinds of relationships between relevant fields, and to know the names of the fields, in order to incorporate the lookup table into the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerry&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 15:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513048#M40304</guid>
      <dc:creator>KerryAlley</dc:creator>
      <dc:date>2014-06-24T15:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513049#M40305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Jim,&lt;BR /&gt;&lt;BR /&gt;The paths do help.&amp;nbsp; It isn't clear to me, however, exactly what information is in your lookup table or how you want to use it.&amp;nbsp; For example, does the lookup table identify which fips codes belong to which state?&amp;nbsp; If so, how?&amp;nbsp; Is every fips code listed in one field, with another field providing the name of the state the code belongs to?&amp;nbsp; Will each shape file correspond to a single or multiple fips codes?&amp;nbsp; I would need to understand these kinds of relationships between relevant fields, and to know the names of the fields, in order to incorporate the lookup table into the script.&lt;BR /&gt;&lt;BR /&gt;Kerry&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerry,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The information in the lookup table identifys all 87 unique fips codes for Minnesota but the feature class of parcel data includes other states so that's why there is a state field in the lookup table as well, all with MN as the attribute. So yes, every fips listed in one field and another field with state abbrev (MN), see attached table.&amp;nbsp; Each exported shapefile should correspond to a single fips code.&amp;nbsp; Also, the path to the SDE layer is as follows:&amp;nbsp; Database Connections\LAND_P.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The feature class is called:&amp;nbsp; PARCELS.PARCELS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this all helps!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513049#M40305</guid>
      <dc:creator>JimFritz</dc:creator>
      <dc:date>2014-06-24T18:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select parcels (by county fips) from SDE layer into shapefile.</title>
      <link>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513050#M40306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kerry,&lt;BR /&gt;The information in the lookup table identifys all 87 unique fips codes for Minnesota but the feature class of parcel data includes other states so that's why there is a state field in the lookup table as well, all with MN as the attribute. So yes, every fips listed in one field and another field with state abbrev (MN), see attached table.&amp;nbsp; Each exported shapefile should correspond to a single fips code.&amp;nbsp; Also, the path to the SDE layer is as follows:&amp;nbsp; Database Connections\LAND_P.sde&lt;BR /&gt;The feature class is called:&amp;nbsp; PARCELS.PARCELS&lt;BR /&gt;&lt;BR /&gt;Hope this all helps!&lt;BR /&gt;&lt;BR /&gt;Jim&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh, I forgot the attributes of the PARCELS.PARCELS table.&amp;nbsp; They are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FIPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STATE_CODE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-parcels-by-county-fips-from-sde-layer-into/m-p/513050#M40306</guid>
      <dc:creator>JimFritz</dc:creator>
      <dc:date>2014-06-24T18:33:29Z</dc:date>
    </item>
  </channel>
</rss>

