|
POST
|
In my opinion you will have to loop the dictionary as well to find the right key? Maybe try something like this? with arcpy.da.UpdateCursor(keyRegion,["Region","ID"]) as cursor:
for row in cursor:
for key, value in Region_dic.iteritems():
if key == row[0]:
print key, value
row[1] = value
cursor.updateRow(row)
else:
print ("does not fit")
... View more
08-09-2021
04:42 AM
|
0
|
0
|
1981
|
|
POST
|
There exists some open source software, OpenDroneMap, to process drone data: https://github.com/OpenDroneMap/ODM Don't know this software, but perhaps it's worth testing?
... View more
07-27-2021
07:10 AM
|
0
|
0
|
2823
|
|
POST
|
Hello, I've problems with a Con command. In python there is only a empty result (no error message), but if I use Map Algebra - raster calculator in ArcMaP there is a result? Version ArcGIS Desktop 10.6.1 What's wrong with the Con : OutRas = Con((outClip > value2) & (outClip < value), outClip) value2 is 0.1 m less than value in a dgm. For example Value: 907.1346 m und Value2: 907.0346 m Any ideas? It's in line 64? def ExpandSperren_1(self, outFC):
myList = list()
# outFC = Sperren_3D
outLyr = "outLyr"
arcpy.MakeFeatureLayer_management(outFC, outLyr)
arcpy.AddField_management(outLyr, "POINT_Z_1", "DOUBLE") # , 10, 4)
with arcpy.da.UpdateCursor(outLyr, ["POINT_Z", "POINT_Z_1"]) as cursor:
for r in cursor:
value = round(r[0], 4)
print value
r[1] = value
cursor.updateRow(r)
d = {}
for r in arcpy.da.SearchCursor(outLyr, ["ORIG_FID", "POINT_Z_1"]):
print r[0]
d[r[0]] = r[1]
for key, value in d.iteritems():
# print value
sel = "{} = {}".format("ORIG_FID", key)
print sel
arcpy.SelectLayerByAttribute_management(outLyr, "NEW_SELECTION", sel)
result = arcpy.GetCount_management(outLyr)
count = int(result.getOutput(0))
print("Count is {}".format(count))
value2 = value - 0.1
print "Value: {} und Value2: {}".format(value, value2)
# Select Basin
BasinLyr = "BasinLyr"
arcpy.MakeFeatureLayer_management(self.outBasin, BasinLyr)
arcpy.SelectLayerByLocation_management(BasinLyr, 'intersect', outLyr)
strR = round(value, 4)
print strR
ReplaceRstrR = str(strR).replace(".", "_")
outClip = "clip_{}".format(ReplaceRstrR)
arcpy.Clip_management("SperrenDGM", "", outClip, BasinLyr, "#", "ClippingGeometry", "NO_MAINTAIN_EXTENT")
arcpy.CheckOutExtension("Spatial")
OutRas = Con((outClip > value2) & (outClip < value), outClip)
OutRas.save("OutRas_{}".format(ReplaceRstrR))
outFlood = value - OutRas
outFlutung = Con(outFlood > 0, outFlood)
outPut = "Zwischen_Height_{}".format(ReplaceRstrR)
outFlutung.save(outPut)
myList.append(outPut)
self.outFLRaster = "AAA_FlHoehe_Gesamt_Kaltenbronn"
arcpy.MosaicToNewRaster_management(myList, arcpy.env.workspace, \
self.outFLRaster, "",\
"32_BIT_FLOAT", "1", "1", "LAST","FIRST")
arcpy.CheckInExtension("Spatial")
... View more
06-14-2021
05:28 AM
|
0
|
2
|
1120
|
|
POST
|
Vielleicht geht es damit? https://desktop.arcgis.com/de/arcmap/10.3/tools/cartography-toolbox/collapse-dual-lines-to-centerline.htm#L_ Du brauchst allerdings eine Advanced Lizenz.
... View more
05-19-2021
02:05 AM
|
0
|
0
|
716
|
|
POST
|
Hello, I'm searching for the delineation of rewetting("flooding") areas in slightly inclined ground with a lot of small ditches with a lidar raster dem. In flat ground or near big rivers it is easy to calculate, but not in inclined areas with a lot of small ditches. If I define a flooding height in inclined ground it could be that in "highter" areas is looks quite well but in "lower" areas far away down the ditches the settlements are flooded. But it is unlikely that these areas would get in danger because of the seep away in the soil and the drain throught not closed ditches. What I tried is hot spot analysis of the height values in small parts using the cold spots - this gives me somehow an image of the slope of the small parts ... Next I used the block statistic to get raster cells under the mean value - but values under the mean are everywhere ... Do you have any other idea? Or is there a tool I don't know? I can use ArcMap 10.6 with spatial analyst, arcpy is possible?
... View more
05-18-2021
10:21 PM
|
0
|
0
|
602
|
|
POST
|
Hello, I would like to get the maximum hight of a line feature but it doesn't work with FeatureClassToNumPyArray? I tried the following code: def Sperren_interpShape(self):
arcpy.CheckOutExtension("3D")
desc = arcpy.Describe(inSperren)
outFC = "{0}_3D".format(desc.basename)
method = "BILINEAR"
# Execute InterpolateShape
arcpy.ddd.InterpolateShape(inHights, inSperren, outFC,
"", "", method, True)
arcpy.CheckInExtension("3D")
arcpy.MakeFeatureLayer_management(outFC, outLyr)
with arcpy.da.SearchCursor(outLyr, "OBJECTID") as cursor:
for row in cursor:
print row[0]
sel = "{} = {}".format("OBJECTID", row[0])
print sel
arcpy.SelectLayerByAttribute_management(outLyr, "NEW_SELECTION", sel)
arr = arcpy.da.FeatureClassToNumPyArray(outLyr, ["OBJECTID", 'SHAPE@Z'])
print arr
print np.amax(arr.astype(np.float)) but it only results in the following print statements: 1 OBJECTID = 1 [(1, nan)] 1.0 What does "nan" means? Are there better ways to get the maximum hight of a 3D line? Working in 10.6.1?
... View more
03-08-2021
03:03 AM
|
0
|
1
|
954
|
|
POST
|
Hello, the parameters are: backgrVal = "ZERO" dangleTolerance = 10 The cellsize is 1m, and yes it was a float raster converted to integer. I will try thin tool, thank you for your help. I try to detect small ditches in flat wetlands.
... View more
02-25-2021
03:06 AM
|
0
|
0
|
3035
|
|
POST
|
The raster to polyline tool creates squares even with the option "SIMPLIFY". Is there a tool to create one line out of it this squares? ArcGIS Desktop 10.6.1
... View more
02-24-2021
10:23 PM
|
0
|
2
|
3103
|
|
POST
|
Maybe this example could help you: https://pro.arcgis.com/de/pro-app/arcpy/mapping/layer-class.htm import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\Projects\YosemiteNP\Yosemite.aprx")
m = aprx.listMaps("Yosemite National Park")[0]
for lyr in m.listLayers():
if lyr.supports("DEFINITIONQUERY"):
lyr.definitionQuery = ""
if lyr.supports("SHOWLABELS"):
lyr.showLabels = False
aprx.save()
del aprx
... View more
12-16-2020
04:24 AM
|
1
|
2
|
2818
|
|
POST
|
Difficult to say without seeing your model. Maybe there is a "make feature layer" missing infront of the join?
... View more
12-14-2020
11:30 PM
|
0
|
1
|
1678
|
|
POST
|
Not tested but could work? It's from here: "https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy" import arcpy, os
from arcpy import env
arcpy.env.workspace = r"C:\"
for path, dirs, files in os.walk(arcpy.env.workspace):
for dir in dirs:
if ".gdb" in dir:
workspace = os.path.join(path, dir)
arcpy.Compact_management(workspace)
... View more
12-10-2020
06:17 AM
|
1
|
1
|
3880
|
|
POST
|
Could this help you? https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy
... View more
12-10-2020
06:02 AM
|
0
|
0
|
3879
|
|
POST
|
Maybe this could help you? https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy
... View more
12-10-2020
05:56 AM
|
0
|
0
|
3879
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-10-2025 08:08 AM | |
| 1 | 05-13-2025 05:05 AM | |
| 1 | 04-28-2025 03:40 AM | |
| 4 | 08-13-2024 10:49 PM | |
| 1 | 08-13-2024 09:52 PM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|