<?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: arcpy fieldmappings Problem (spatial join) in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732421#M24142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;there is a huge problem with replaceFieldMap() and arcpy. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I struggled for quite some time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See the link &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/34881-replacefieldmap()-appears-broken-in-arcpy"&gt;http://forums.arcgis.com/threads/34881-replacefieldmap()-appears-broken-in-arcpy&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Susan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Jul 2011 03:16:02 GMT</pubDate>
    <dc:creator>SusanJones</dc:creator>
    <dc:date>2011-07-23T03:16:02Z</dc:date>
    <item>
      <title>arcpy fieldmappings Problem (spatial join)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732418#M24139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;SORRY! Found the error myself, immediately as I saw my post... wrong feature in the spatialjoin command...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So ignore this post, please!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: No delete option here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;##--------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi there, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do a spatial join with a polyline feature (target) and a point feature. In the new polyline-feature all fields of both features should appear. With the default values I only get the fields of the target-feature (correctly) and the ID field of the join-feature. So I tried fieldmapping and added the tables manually like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
fieldmappings = arcpy.FieldMappings()

fieldmappings.addTable(inputFC)

fieldmappings.addTable(PS_copy)

arcpy.SpatialJoin_analysis (inputFC, PS, outputFC, "#", "#", fieldmappings, "INTERSECT")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This results in a feature table with the right fields, but except of the ID field of the join-feature the other fields&amp;nbsp; have the value 0. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's wrong with my code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this is a stupid question, I'm sorry, I'm quite new to python-scripting...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Selda&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 09:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732418#M24139</guid>
      <dc:creator>SeldaSamiri</dc:creator>
      <dc:date>2010-11-03T09:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy fieldmappings Problem (spatial join)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732419#M24140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No there isnt a delete option so that problems, even if they are self resolved can help others. By the way if you arent making a change to your field map and just leaving it as the default, you could have just used "#" as that patameter. No need to create that object, add in two tables and then use the object as the parameter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 11:44:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732419#M24140</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-11-03T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy fieldmappings Problem (spatial join)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732420#M24141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes, thanx, if I use the correct feature it also works without the fieldmappings object &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 12:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732420#M24141</guid>
      <dc:creator>SeldaSamiri</dc:creator>
      <dc:date>2010-11-05T12:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy fieldmappings Problem (spatial join)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732421#M24142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;there is a huge problem with replaceFieldMap() and arcpy. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I struggled for quite some time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See the link &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/34881-replacefieldmap()-appears-broken-in-arcpy"&gt;http://forums.arcgis.com/threads/34881-replacefieldmap()-appears-broken-in-arcpy&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Susan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jul 2011 03:16:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-fieldmappings-problem-spatial-join/m-p/732421#M24142</guid>
      <dc:creator>SusanJones</dc:creator>
      <dc:date>2011-07-23T03:16:02Z</dc:date>
    </item>
  </channel>
</rss>

