POST
|
I'm also getting this error. Was this problem ever answered?
... View more
02-25-2019
01:22 PM
|
0
|
0
|
2517
|
POST
|
Haha I like the title. I'll have to try that, it looks simpler. Thanks!
... View more
02-19-2019
03:22 PM
|
0
|
0
|
5853
|
POST
|
import arcpy
# Work Order Number
workOrder = "1103612"
# Name the Append and Target Layer (target layer is named in the ArcGIS Pro Map)
append_layer="T:/GIS/Projects/GIS/WorkOrderTools/MapDocuments/WorkOrderTesting/Default.gdb/WO"+workOrder+"/point"
target_layer="Consumer_SQL02"
fieldmappings = arcpy.FieldMappings()
# Like when you manually choose a layer in the toolbox and it adds the fields to grid
fieldmappings.addTable(target_layer)
fieldmappings.addTable(append_layer)
# Lets map fields that have different names!
list_of_fields_we_will_map = []
# list_of_fields_we_will_map.append(( append layer field name, target layer field name)
list_of_fields_we_will_map.append(('esMapName', 'WMMAPNAME'))
list_of_fields_we_will_map.append(('esPhasing', 'WMPHASING'))
list_of_fields_we_will_map.append(('esUplineFeeder', 'FEEDER'))
for field_map in list_of_fields_we_will_map:
# Find the fields index by name.
field_to_map_index = fieldmappings.findFieldMapIndex(field_map[0])
# Grab "A copy" of the current field map object for this particular field
field_to_map = fieldmappings.getFieldMap(field_to_map_index)
# Update its data source to add the input from the the append layer
field_to_map.addInputField(append_layer, field_map[1])
# We edited a copy, update our data grid object with it
fieldmappings.replaceFieldMap(field_to_map_index, field_to_map)
# Create a list of append datasets and run the the tool - the "1" at the end is for the subtype.
inData = [append_layer]
arcpy.Append_management(inData, target_layer, "NO_TEST", fieldmappings, "1") So, after changing my code completely, it turns out I had my field names reversed, needed to add "1" as subtype to the Append_management tool, then it worked! I also finally figured out how to post code using the advanced editor button.
... View more
02-19-2019
03:06 PM
|
2
|
1
|
5853
|
POST
|
Thanks! So is this a list of fields for the data being appended, or the data that's being added to? I found this, which looked easy to understand: Append Tool and Field Mapping ... Help? Examples? But my code is breaking when I go to field_to_map.addInputField(append_layer, field_map[1]) I think I'm pretty close...any ideas? # Delete this line
workOrder = "1103612"
append_layer="T:/GIS/Projects/GIS/WorkOrderTools/MapDocuments/WorkOrderTesting/Default.gdb/WO"+workOrder+"/point"
target_layer="T:/GIS/Projects/GIS/WorkOrderTools/MapDocuments/WorkOrderTesting/ElectricModel - azumwalt.sde/ElectricModel.DBO.UEC/ElectricModel.DBO.Consumer"
fieldmappings = arcpy.FieldMappings()
# Like when you manually choose a layer in the toolbox and it adds the fields to grid
fieldmappings.addTable(target_layer)
fieldmappings.addTable(append_layer)
# Lets map fields that have different names!
list_of_fields_we_will_map = []
# Lets chuck some tuples into the list we made
list_of_fields_we_will_map.append(('WMMAPNAME', 'esMapName'))
list_of_fields_we_will_map.append(('WMPHASING', 'esPhasing'))
list_of_fields_we_will_map.append(('FEEDER', 'esUplineFeeder'))
for field_map in list_of_fields_we_will_map:
# Find the fields index by name. e.g 'TaxPin'
field_to_map_index = fieldmappings.findFieldMapIndex(field_map[0])
# Grab "A copy" of the current field map object for this particular field
field_to_map = fieldmappings.getFieldMap(field_to_map_index)
# Update its data source to add the input from the the append layer
#(THIS IS WHERE MY CODE BREAKS RuntimeError: FieldMap: Error in adding input field to field map)
field_to_map.addInputField(append_layer, field_map[1])
# We edited a copy, update our data grid object with it
fieldmappings.replaceFieldMap(field_to_map_index, field_to_map)
# Create a list of append datasets and run the the tool
inData = [append_layer]
arcpy.Append_management(inData, target_layer, "NO_TEST", fieldmappings)
... View more
02-19-2019
11:02 AM
|
0
|
0
|
5853
|
POST
|
Thanks! Can you tell me what each field is for in this string? DXF_TEXT "DXF_TEXT" true true false 11 Text 0 0 ,First,#, {0}, DXF_TEXT,-1,-1;
... View more
02-18-2019
09:17 AM
|
0
|
2
|
5853
|
POST
|
Here is my code:
I keep getting the error: "FieldMap: Error in adding input field to field map." This is my first time using field mapping, and I'm a little confused.
point="T:/GIS/Projects/GIS/WorkOrderTools/MapDocuments/WorkOrderTesting/Default.gdb/WO"+workOrder+"/point"
consumer="C:/Users/azumwalt.UECOOP/AppData/Roaming/ESRI/Desktop10.4/ArcCatalog/ElectricModel - azumwalt.sde/consumer"
fm_mapname = arcpy.FieldMap()
fm_phasing = arcpy.FieldMap()
fms = arcpy.FieldMappings()
fm_mapname.addInputField(point, "WMMAPNAME")
fm_phasing.addInputField(point, "WMPHASING")
type_mapname = fm_mapname.outputField
type_mapname.name = "esMapName"
fm_mapname.outputField = type_mapname
type_phasing = fm_phasing.outputField
type_phasing.name = "esPhasing"
fm_phasing.outputField = type_phasing
fms.addFieldMap(fm_mapname)
fms.addFieldMap(fm_phasing)
arcpy.Append_management(point, consumer, "", fms, "1")
... View more
02-13-2019
03:56 PM
|
0
|
9
|
7458
|
POST
|
Turns out I needed Visual Studio Community 2017. New Project --> Open Visual Studio Installer --> Install Visual Studio Community 2017
... View more
02-12-2019
02:17 PM
|
0
|
0
|
1005
|
POST
|
I'm in Visual Studio and am searching for "ArcGIS Pro SDK for .NET" in the marketplace and nothing is coming up... how do I find it? Trying to use this guide: ProGuide Installation and Upgrade · Esri/arcgis-pro-sdk Wiki · GitHub
... View more
02-11-2019
11:16 AM
|
0
|
1
|
1361
|
BLOG
|
Thank you for this post! We were able to beautify our homepage as well last year and we couldn't have done it without your help.
... View more
01-10-2019
11:42 AM
|
5
|
0
|
14710
|
IDEA
|
Feature layer views for non-hosted data would save me a ton of time as well. I want to hide certain data from contractors without having to publish it twice.
... View more
12-10-2018
01:50 PM
|
1
|
0
|
5080
|
POST
|
Fantastic, we have signed up for beta. Looking forward to it!
... View more
10-29-2018
11:44 AM
|
0
|
0
|
1301
|
POST
|
Question - Are MMPK's coming to windows at all? Any way to consume these while NOT on a mobile device. We currently have an enterprise set-up. Unfortunately our network (in office) is excruciatingly slow. While I like having maps connected to our server, it's not ideal right now. We could go back to hosted maps, the problem is that we currently have to overwrite hosted layers in ArcMap (can't use Pro because we don't use Portal yet) anytime we want to update. While I could automate this, every time I overwrite I have to re-configure all my pop-ups (there are a lot). So.... I'm looking for a better solution. MMPK's are great on mobile devices and *should be* easy to automate replacing weekly. But what are my options for our desktop users? Any other ideas? Configuring Portal and upgrading our network is in our plan for 2019.
... View more
10-24-2018
12:04 PM
|
0
|
4
|
1913
|
IDEA
|
This would be helpful. It's a pain to only be able to turn ALL labels off or on when using the print widget in web app builder. It would be nice to be able to turn them on or off in the layers list like you can in web maps.
... View more
10-23-2018
03:45 PM
|
0
|
0
|
2633
|
Title | Kudos | Posted |
---|---|---|
1 | 08-08-2018 03:46 PM | |
2 | 02-19-2019 03:06 PM | |
1 | 10-03-2017 03:35 PM | |
1 | 08-20-2018 05:54 PM | |
1 | 12-10-2018 01:50 PM |
Online Status |
Offline
|
Date Last Visited |
02-11-2024
04:29 PM
|