POST
|
Didn't knowed this tool, if I run it with one empty field I want to delete I get something like this: Sorry it's in german ... I think the problem with this tool will be that it's some kind of chaotic data merge out of excel files in the fc. The fields to delete could contain Null values, "", "0", " " ... .
... View more
02-03-2023
01:46 AM
|
1
|
0
|
1352
|
POST
|
Hello, I want to delete all empty fields in a feature class (arcgis pro 3.0 - notebooks) - with no sucess. The following script doesn't work, it prints fields as count = 0 which have valid attributes. Any better ideas? fc = "Merge_1"
fields = [f.name for f in arcpy.ListFields(fc) if not f.required]
for field in fields:
count = 0
with arcpy.da.SearchCursor(fc, field) as cursor:
for row in cursor:
if row[0] is None or row[0] in ["", " ", "0"]:
count += 0
else:
count += 1
break
print(field, count)
... View more
02-02-2023
09:37 PM
|
0
|
4
|
1401
|
POST
|
Hello, I want to check if a field type is text to change this field to type double so that I can use it as input field into XYTableToPoint? This if statement in line 16 doesn't work (arcgis pro 3.0 notebook) Any ideas? Error message for line 41: ERROR 000308: Ungültiger Feldtyp for f in files_list:
print (f)
outTable = "tab_" + os.path.splitext(os.path.basename(f.replace("-", "_")))[0]
outXY = "s_" + os.path.splitext(os.path.basename(f.replace("-", "_")))[0]
arcpy.conversion.ExcelToTable(f, outTable)
x = "R_Wert"
y = "H_Wert"
fields = arcpy.ListFields(outTable)
field_names = []
for field in fields:
field_names.append(field.name)
if field.name == x and field.type == "TEXT":
print("Wrong type")
arcpy.management.AddField(outTable, "R_Wert_1", "DOUBLE")
arcpy.management.CalculateField(outTable, "R_Wert_1",
'!R_Wert!', "PYTHON3")
x = "R_Wert_1"
elif field.name == y and field.type == "TEXT":
print("Wrong Type")
arcpy.management.AddField(outTable, "HWert_1", "DOUBLE")
arcpy.management.CalculateField(outTable, "R_Wert_1",
'!H_Wert!', "PYTHON3")
y = "H_Wert_1"
else:
continue
if x in field_names and y in field_names:
print("Field names ok")
arcpy.management.XYTableToPoint(outTable, outXY,
x, y, "",
arcpy.SpatialReference("DHDN 3-Degree Gauss Zone 3"))# ('ETRS 1989 UTM Zone 32N'))
else:
print("Field names wrong")
continue
... View more
02-01-2023
11:39 PM
|
0
|
2
|
573
|
POST
|
Could it be a problem that the kml name starts with a number or the spaces in your pathnames? https://community.esri.com/t5/data-management-blog/how-to-name-things-in-arcgis/ba-p/897194
... View more
01-26-2023
11:37 PM
|
0
|
0
|
964
|
POST
|
Think it's possible: https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm
... View more
01-25-2023
06:26 AM
|
2
|
0
|
1708
|
POST
|
Don't know if it helps, but I tried to print the € in a field name like this? import arcpy
featureclass = r"YourPath2FC"
field_names = [f.name.encode("windows-1252") for f in arcpy.ListFields(featureclass)]
print (field_names)
for f in field_names:
print f.decode("windows-1252")
... View more
01-16-2023
05:07 AM
|
1
|
1
|
1302
|
POST
|
Hello there's a key: tunnel in the OpenStreetMap data: https://wiki.openstreetmap.org/wiki/DE:Key:tunnel Don't know if you can download this data through ESRI Sources ... ?
... View more
01-09-2023
09:44 PM
|
0
|
0
|
485
|
POST
|
could this help you: https://pro.arcgis.com/en/pro-app/latest/tool-reference/cartography/calculate-polygon-main-angle.htm
... View more
01-04-2023
11:23 PM
|
1
|
1
|
878
|
POST
|
I think you will need python to do this - someone posted a solution here: https://gis.stackexchange.com/questions/34647/creating-lines-from-points-pair-coordinates-with-arcpy I tried the code of Chad Cooper there with four points with the old cursors ... it seems to work. Here is the code I used: import arcpy
fieldnames = ['X1', 'Y1', 'X2', 'Y2']
# Needed input/ output files
inExcel = r"YOURPATH\Points.xlsx"
FGDB = r"YOURPATH\Points2Lines.gdb"
outTable = "Coords"
outLines = "Lines"
arcpy.env.workspace = FGDB
arcpy.env.overwriteOutput = True
# Change to your Sheet name!
arcpy.conversion.ExcelToTable(inExcel, outTable, "Test")
in_rows = arcpy.SearchCursor(outTable)
point = arcpy.Point()
array = arcpy.Array()
# Without Spatial Reference, please change!
arcpy.CreateFeatureclass_management(FGDB, outLines, "POLYLINE")
featureList = []
cursor = arcpy.InsertCursor(outLines)
feat = cursor.newRow()
for in_row in in_rows:
# Set X and Y for start and end points
# Change here to your field names
point.X = in_row.X1
point.Y = in_row.Y1
array.add(point)
point.X = in_row.X2
point.Y = in_row.Y2
array.add(point)
# Create a Polyline object based on the array of points
polyline = arcpy.Polyline(array)
# Clear the array for future use
array.removeAll()
# Append to the list of Polyline objects
featureList.append(polyline)
# Insert the feature
feat.shape = polyline
cursor.insertRow(feat)
del feat
del cursor
... View more
01-04-2023
11:00 PM
|
1
|
1
|
3310
|
POST
|
If you are not happy with the proposed solutions maybe there is a way to create a profile table with python? Don't know if you use python? Some years ago XanderBakker wrote a script for profile graphs, perhaps it's possible to use this script to export excel tables with the profile data with 1m spacing? The script is here: https://community.esri.com/t5/python-documents/using-python-and-matplotlib-to-create-profile/ta-p/914055
... View more
01-04-2023
02:25 AM
|
0
|
0
|
1533
|
POST
|
Maybe you could try the snap tool? https://pro.arcgis.com/de/pro-app/latest/tool-reference/editing/snap.htm
... View more
01-03-2023
10:09 PM
|
0
|
0
|
636
|
POST
|
Sorry I did overread that you need a table, I think you could use this tool: https://pro.arcgis.com/en/pro-app/latest/tool-reference/3d-analyst/stack-profile.htm
... View more
01-03-2023
04:05 AM
|
1
|
2
|
1568
|
POST
|
could this help you? https://pro.arcgis.com/en/pro-app/latest/help/analysis/3d-analyst/interactively-create-a-profile-graph-with-digitized-lines-on-a-surface.htm
... View more
01-03-2023
02:27 AM
|
0
|
4
|
1601
|
Title | Kudos | Posted |
---|---|---|
1 | a month ago | |
1 | 04-28-2025 03:40 AM | |
4 | 08-13-2024 10:49 PM | |
1 | 08-13-2024 09:52 PM | |
2 | 02-15-2024 07:44 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|