|
POST
|
Thanks for the reply, Jeff. I could Add Fields, but I already have data formatted and indexed in a table. So, ideally I would just add the entire table/data/columns to an existing table. I can't do a join because the two datasets are not related in any way.
... View more
10-27-2017
07:58 AM
|
0
|
5
|
2487
|
|
POST
|
If you're just trying to add new line feautres to your Feature Class, you can use the 'Create Feautres' window. See below: Make sure the layer is turned on in the Table of Contents. Click the layer you're wanting to add features to in the 'Create Features' window. Then, just draw your new features
... View more
10-27-2017
07:55 AM
|
1
|
0
|
6775
|
|
POST
|
Is there a geoprocessing tool that literally appends one table (or columns) to the end of another? ESRI does something similar in their 'Symmetrical Difference' tool. See below for an example. I know I could do this with a Python for loop and the 'Add Field' function, but that seems costly. I was hoping there was a geoprocessing tool that could do it for me. Thanks for any help!
... View more
10-27-2017
06:54 AM
|
1
|
17
|
4196
|
|
POST
|
So there is no coordinate data (x,y)? What are you trying to map? What is the data (census data about income, locations of bathrooms, county boundaries, counts of serial killers by county, etc...)?
... View more
10-24-2017
10:49 AM
|
0
|
0
|
1729
|
|
POST
|
The merge tool will combine two datasets into a single output dataset. The tool contains a 'Field Mapping' option where the user can define which fields from the input datasets will be combined into the output table. The spatial join tool combines two datasets into a single joined dataset based on a spatial relationship. This tool has the same 'Field Mapping' option as the merge tool. The spatial join tool must be point, lines, or polygons (no tables) since the tool runs on spatial features. I normally use the merge tool to combine two like datasets (i.e. primary roads and secondary roads) and whose attribute table is similar. I normally use the spatial join tool to combine two datasets that have a spatial relationship in some way (i.e. traffic signs and roads). Or, this tool can help if I'm needing to analyze attributes from one dataset to another based on a spatial relationship. Please review the hyperlinks above. Both tools are handy and powerful, but they serve different purposes.
... View more
10-23-2017
07:14 AM
|
5
|
0
|
5588
|
|
POST
|
1.) Add brackets around your search cursor fields 2.) Remove the 'elif element is not None' from the elif statement since you're already checking if it's None in the above 'if' statement. 3.) Use the GeoNet Syntax Highlighter. nv.workspace = r"someSDEconnection.sde"
addModDate_featureList = arcpy.ListFeatureClasses("GEO*")
for addModDate_feature in addModDate_featureList:
fc_result = arcpy.GetCount_management(addModDate_feature)
fc_count = int(fc_result.getOutput(0))
if fc_count == 0:
print(addModDate_feature + " No Geometry Present")
else:
addModDate_field_names = [f.name for f in arcpy.ListFields(addModDate_feature)]
if "MOD_DATE" in addModDate_field_names:
#add [] around the fields you're searching
unique_addDate = set(row[0] for row in arcpy.da.SearchCursor(addModDate_feature, ["MOD_DATE"]))
outList = []
for element in unique_addDate:
if element is None:
pass
elif element not in outList: #leave out checking if None, since that happens in 'if' above
outList.append(element)
outList.sort(reverse=True)
outList_recent = outList[0]
print(addModDate_feature + " " + outList_recent)
... View more
10-20-2017
07:58 AM
|
0
|
1
|
1574
|
|
POST
|
You shouldn't loop over an insert cursor. Instead, set the cursor to a variable and pass each item of your list to the variable to execute. items = ['item1','item2','item3']
cursor = arcpy.da.InsertCursor(fc, ['fields'])
for item in items:
cursor.insertRow(item)
del cursor
... View more
10-19-2017
11:45 AM
|
0
|
0
|
2905
|
|
POST
|
Make sure there is actually data in the list you're running the insertCursor on. Also, make sure that the number of items in each element of the list match the fields listed in the insertCursor. Maybe try running on a File Geodatabase and see if you get any other results.
... View more
10-18-2017
09:18 AM
|
0
|
1
|
8575
|
|
POST
|
Okay... are you trying to insert OBJECTID values? The cursor has a field name of fid. Or is that just a text type field?
... View more
10-18-2017
08:41 AM
|
0
|
1
|
1619
|
|
POST
|
ObjectIDs will be automatically created when inserting rows into a table. I'm not sure exactly why the rows aren't inserting properly... I'd have to look at the schema and contents of the list. Try deleting the 'iCursor' object at the end of the script, and 'Reload Cache' on the SDE table. I'm also not sure about inserting rows into an SDE environment... are you trying this on a version or DEFAULT?
... View more
10-18-2017
08:28 AM
|
0
|
3
|
8575
|
|
POST
|
I think you need to insert actual coordinate values and not geometry objects.
... View more
10-18-2017
08:24 AM
|
0
|
3
|
1619
|
|
POST
|
I would have two separate cursors. Nested cursors are funky. Also, you shouldn't have to loop over an Insert Cursor... just create an object that's pointing to the cursor. NeedInsert = []
with arcpy.da.SearchCursor(InputFC, scFields) as sCursor: #Search cursor acts on shapefile
for row in sCursor:
rowList = list(row)
PatchID = '{' + str(uuid.uuid4()).upper() + '}'
ObserverID = None
rowList.insert(2, PatchID)
rowList.append(ObserverID)
NeedInsert.append[rowList] #append list to master list
del sCursor
iCursor = arcpy.da.InsertCursor(PatchesFC, icFields) #you don't need to loop over insert cursors
for x in NeedInsert:
iCursor.insertRow(x)
... View more
10-18-2017
07:50 AM
|
1
|
7
|
8575
|
|
POST
|
Can you send a screenshot of the contents of the lines list?
... View more
10-18-2017
06:32 AM
|
0
|
5
|
2905
|
|
POST
|
Try putting an 'r' in front of all paths. Check below #what you have
arcpy.MakeFeatureLayer_management("TC:\Temp\Test_Data.gdb\TOPOLOGY\ArcGIS_Errors_line","FEATURE_SELECTION")
#what I think it should be
arcpy.MakeFeatureLayer_management(r"C:\Temp\Test_Data.gdb\TOPOLOGY\ArcGIS_Errors_line","FEATURE_SELECTION")
... View more
10-17-2017
10:32 AM
|
1
|
0
|
1839
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-28-2024 11:43 AM | |
| 1 | 09-12-2025 07:32 AM | |
| 1 | 10-26-2018 06:50 AM | |
| 1 | 10-26-2018 08:43 AM | |
| 1 | 02-25-2016 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-02-2025
01:10 PM
|