POST
|
I am having an issue with the Append tool. I am trying to append address fields to a new point feature class that will contain the same information. The append tool appears to stop when I try to append the address number field. Both the output field and input field are text fields. Here are the images. Does any one have any suggestions on how to fix this issue?
... View more
06-23-2020
11:27 AM
|
0
|
0
|
603
|
POST
|
I am trying to select road center lines from a boundary layer using the select by attribute and select by location tools in model builder. First I select the boundary using select by attribute and then use select by location to select the road center lines based upon the initially selected boundary layer. It works correctly when using the tools from arcmap, but in model builder it is not working properly. When I set up the tool for select by location, I use the sub selection as my selection type because I want it to be based upon the previous selection which is the boundary, but I get no in the Get county tool. Does any one know what I need to do to get to work properly.
... View more
06-08-2020
02:55 PM
|
0
|
3
|
716
|
POST
|
I am trying to calculate the parity left and parity right for my road center lines, but I do not know how to accomplish that in the field calculator. I was wondering if anyone had some prelogic python code that I could use to accomplish this. For example my parity left needs to be based upon the from and to fields for the left side of the road center line. Is it possible for me to use update cursor in the prelogic window in a field calculator?
... View more
06-05-2020
07:30 AM
|
0
|
1
|
1523
|
POST
|
The code worked. I will use the same syntax for the road types and post directional. Thank you very much. If you have any alternative solutions that achieve the same result, please let me know. I am always looking for ways to improve my python code.
... View more
06-01-2020
11:05 AM
|
0
|
0
|
689
|
POST
|
I am trying to replace the values in my predirection field in ArcMap using the field calculator. Here is my sample code. def predir(field): if "S" in fields: return field.replace("S","South") elif "E" in fields: return field.replace("E","EAST") elif "W" in fields: return field.replace("W", "WEST") elif "N" in fields: return field.replace("N", "NORTH") elif "NE" in fields: return field.replace("NE", "NORTHEAST") elif "NW" in fields: return field.replace("NW", "NORTHWEST") elif "SE" in fields: return field.replace("SE", "SOUTHEAST") elif "SW" in fields: return field.replace("SW", "SOUTHWEST") else: return field I am getting the following error: Failed to execute. Parameters are not valid Error 000989: Python syntax error: Parsing error SyntaxError:Invalid syntax(line18) Failed to execute (Calculate Field). There are Null values in the field, but they need to be there for NextGen 911 purposes. Any suggestions? I was thinking of using a similar syntax for replacing my post direction and street type values as well. Eventually I will need to put a script together that does all this for my street center lines and structures.
... View more
06-01-2020
07:03 AM
|
0
|
3
|
749
|
POST
|
Thank you very much. I did the try/except block and it works for everything. I really appreciate all the help you gave to me.
... View more
05-01-2020
06:44 AM
|
0
|
1
|
564
|
POST
|
I used the second suggested Add field for Date and I am running into a overwrite error for one of my fields. I set the overwrite environment so that it can overwrite fields. What do you recommend? I am writing this code as a practice run before I actually touch the true polygon feature classes. Traceback (most recent call last): File "C:/Users/folder/Desktop/AddField5.py", line 20, in <module> arcpy.AddField_management(fc, "effectiveDate", "DATE", "#", "#", "#", "#", "NULLABLE", "NON_REQUIRED", "") File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\management.py", line 3435, in AddField raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000012: effectiveDate already exists Failed to execute (AddField).
... View more
04-30-2020
12:38 PM
|
0
|
3
|
2593
|
POST
|
The reason that the field alias is absent is because for NEXTGen911, field aliases are not allowed for data upload.
... View more
04-30-2020
12:26 PM
|
0
|
0
|
2593
|
POST
|
I have also restored replaced the True with NULLABLE and I am still getting the same error.
... View more
04-30-2020
12:00 PM
|
0
|
0
|
2593
|
POST
|
I am still getting the same error even though I have removed the spaces from the field name and the value from the field length for my date fields.
... View more
04-30-2020
11:57 AM
|
0
|
1
|
2593
|
POST
|
I am having trouble trying to add multiple fields to polygon feature classes into a file geodatabase. Here is the python script I am working with. import arcpy arcpy.env.overwriteOutput = True #set the environment settings arcpy.env.workspace = "Z:\\folder\\folder\\Practice\\Practice.gdb" #Set local variables fc = arcpy.ListFeatureClasses("Polygon") #Main Loop to add fields to all Polygon feature classes in file geodatabase for fc in arcpy.ListFeatureClasses(): arcpy.AddField_management(fc, "sourceOFData", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "Source Last Edit Date", "DATE", "", "", "75", "True", "NON_REQUIRED", "") arcpy.AddField_management(fc, "uploadAuthority", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "effectiveDate", "DATE", "","", "75", "", "True", "NON_REQUIRED", "") arcpy.AddField_management(fc, "expirationDate", "DATE", "", "", "75", "", "True", "NON_REQUIRED", "") if fc == "DaviePSAP": arcpy.AddField_management(fc, "sourcePSAPUnqID", "TEXT", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") elif fc in arcpy.ListFeatureClasses(): arcpy.AddField_management(fc, "sourceUnqID", "TEXT", "", "", "254","", "NULLABLE", "NON_REQUIRED", "") elif fc in arcpy.ListFeatureClasses(): arcpy.AddField_management(fc, "county", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "state", "TEXT", "", "", "2", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "country", "TEXT", "", "", "2", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "agencyID", "TEXT", "", "", "100", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "serviceURI", "TEXT", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "serviceURN", "TEXT", "", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "serviceNumber", "TEXT", "", "", "15", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "agencyVCardURI", "TEXT", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "displayName", "TEXT", "", "", "60", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "comments", "TEXT", "", "", "100", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "gcLabel", "TEXT", "", "", "150", "", "NULLABLE", "NON_REQUIRED", "") print "Fields have been added to all tables. Good Job!" I am getting the following error: Traceback (most recent call last): File "C:/Users/Desktop/AddField5.py", line 17, in <module> arcpy.AddField_management(fc, "Source Last Edit Date", "DATE", "", "", "75", "True", "NON_REQUIRED", "") File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\management.py", line 3435, in AddField raise e ExecuteError: ERROR 000622: Failed to execute (Add Field). Parameters are not valid. ERROR 000800: The value is not a member of NULLABLE | NON_NULLABLE. I believe the issue is related to the parameters that I have used for the "Date" fields I am attempting to create. The current syntax works fine for fields that are just "TEXT" types. Example import arcpy arcpy.env.overwriteOutput = True #set the environment settings arcpy.env.workspace = "Z:\\folder\\folder\\Practice\\Practice.gdb" #Set local variables fc = arcpy.ListFeatureClasses("Polygon") #Main Loop to add fields to all Polygon feature classes in file geodatabase for fc in arcpy.ListFeatureClasses(): arcpy.AddField_management(fc, "sourceOFData", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "") #arcpy.AddField_management(fc, "Source Last Edit Date", "DATE", "", "", "75", "True", "NON_REQUIRED", "") arcpy.AddField_management(fc, "uploadAuthority", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "") #arcpy.AddField_management(fc, "effectiveDate", "DATE", "","", "75", "", "True", "NON_REQUIRED", "") #arcpy.AddField_management(fc, "expirationDate", "DATE", "", "", "75", "", "True", "NON_REQUIRED", "") if fc == "DaviePSAP": arcpy.AddField_management(fc, "sourcePSAPUnqID", "TEXT", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") elif fc in arcpy.ListFeatureClasses(): arcpy.AddField_management(fc, "sourceUnqID", "TEXT", "", "", "254","", "NULLABLE", "NON_REQUIRED", "") elif fc in arcpy.ListFeatureClasses(): arcpy.AddField_management(fc, "county", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "state", "TEXT", "", "", "2", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "country", "TEXT", "", "", "2", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "agencyID", "TEXT", "", "", "100", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "serviceURI", "TEXT", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "serviceURN", "TEXT", "", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "serviceNumber", "TEXT", "", "", "15", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "agencyVCardURI", "TEXT", "", "", "254", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "displayName", "TEXT", "", "", "60", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "comments", "TEXT", "", "", "100", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "gcLabel", "TEXT", "", "", "150", "", "NULLABLE", "NON_REQUIRED", "") This code works this way but I really need the date field arguments to work in conjunction with the added text fields. Any suggestions? FYI: Still a novice when it comes to Python scripting.
... View more
04-30-2020
11:37 AM
|
0
|
12
|
3270
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|