POST
|
I want to create landslide susceptibility maps using Random Forest, ANN, Logistic Regression, SVM, DT, KNN, NB in ArcGIS. I have the training and testing data sets and landslide conditioning factors (such as elevation, slope, geology, lulc, twi, spi etc). I have extracted the values of these factors using the training data set. Now I want to derive weights for the landslide conditioning factors using these algorithms to generate susceptibility maps. How to find out the weight of the landslide conditioning factors using these algorithms? Are there tutorials?
... View more
07-11-202212:17 PM
|
1
|
0
|
246
|
POST
|
No.
... View more
07-09-202108:20 AM
|
0
|
0
|
343
|
POST
|
I have a point shapefile that contains five fields including the Id field. Now, I want to find the max value across the rows and populate another row with the field name having the maximum value. How to do this using python? The table looks like this Id X1 X2 X3 X4 MaxValue 1 105 15 11 66 2 62 30 56 25 3 84 22 28 24 4 93 27 89 36 5 71 33 35 77 6 56 54 68 39 7 22 56 71 72 8 81 52 49 41 9 79 29 33 32 10 37 20 73 51
... View more
07-08-202108:25 PM
|
0
|
4
|
490
|
POST
|
Sir, I don't find any option to delete the post. please guide me.
... View more
06-27-202111:32 AM
|
0
|
2
|
399
|
POST
|
Sir, please see the attached figure.
... View more
06-27-202111:19 AM
|
0
|
1
|
1103
|
POST
|
Sorry to say! But your script populates the MaxElv field only with the value of Elevation with which it strikes first for the same Ids.
... View more
06-27-202110:28 AM
|
0
|
3
|
1121
|
POST
|
Sir, I have edited the post. Please see.
... View more
06-27-202109:46 AM
|
0
|
0
|
1135
|
POST
|
我想填充字段(MaxElv)选择highest value from another field (Elevation) based on the Id field (Id). The data looks like this: Id Elevation MaxElv 1 50 1 72 1 83 1 66 2 105 3 27 3 24 2 98 1 46 3 22 2 96 3 26 2 99 4 25 4 21 4 22 3 28 1 52 I have develop the following code: >>> import arcpy ... fc = 'Country' ... CountryList = [] ... with arcpy.da.SearchCursor(fc, ["Id"]) as cur1: ... for row1 in cur1: ... if row1[0] not in CountryList: ... CountryList.append(row1[0]) ... ... for i in CountryList: ... ElevList = [] ... where = """{} = {}""".format("Id", i) ... with arcpy.da.SearchCursor(fc, ["Elevation"], where) as cur2: ... for row2 in cur2: ... if row2[0] not in ElevList: ... ElevList.append(row2[0]) ... ElevList.sort() ... max_Elev= ElevList[-1] ... where2 = """{} = '{}' AND {} = {}""".format("Id", i, "Elevation", max_Elev) ... with arcpy.da.UpdateCursor(fc, ["MaxElv"], where2) as cur3: ... for row3 in cur3: ... row3[0] = 1 ... cur3.updateRow(row3) But it gives the following error Runtime error >>> import arcpy ... fc = 'Country' ... CountryList = [] ... with arcpy.da.SearchCursor(fc, ["Id"]) as cur1: ... for row1 in cur1: ... if row1[0] not in CountryList: ... CountryList.append(row1[0]) ... ... for i in CountryList: ... ElevList = [] ... where = """{} = {}""".format("Id", i) ... with arcpy.da.SearchCursor(fc, ["Elevation"], where) as cur2: ... for row2 in cur2: ... if row2[0] not in ElevList: ... ElevList.append(row2[0]) ... ElevList.sort() ... max_Elev= ElevList[-1] ... where2 = """{} = '{}' AND {} = {}""".format("Id", i, "Elevation", max_Elev) ... with arcpy.da.UpdateCursor(fc, ["MaxElv"], where2) as cur3: ... for row3 in cur3: ... row3[0] = 1 ... cur3.updateRow(row3) But it gives the following error Runtime error Traceback (most recent call last): File "
06-27-202108:28 AM
|
0
|
13
|
1563
|
POST
|
我想填充字段(MaxElv)选择highest value from another field (Elevation) based on the Id field (Id). The data looks like this: Id Elevation MaxElv 1 50 1 72 1 83 1 66 2 105 3 27 3 24 2 98 1 46 3 22 2 96 3 26 2 99 4 25 4 21 4 22 3 28 1 52 I have develop the following code: >>> import arcpy ... fc = 'Country' ... CountryList = [] ... with arcpy.da.SearchCursor(fc, ["Id"]) as cur1: ... for row1 in cur1: ... if row1[0] not in CountryList: ... CountryList.append(row1[0]) ... ... for i in CountryList: ... ElevList = [] ... where = """{} = {}""".format("Id", i) ... with arcpy.da.SearchCursor(fc, ["Elevation"], where) as cur2: ... for row2 in cur2: ... if row2[0] not in ElevList: ... ElevList.append(row2[0]) ... ElevList.sort() ... max_Elev= ElevList[-1] ... where2 = """{} = '{}' AND {} = {}""".format("Id", i, "Elevation", max_Elev) ... with arcpy.da.UpdateCursor(fc, ["MaxElv"], where2) as cur3: ... for row3 in cur3: ... row3[0] = 1 ... cur3.updateRow(row3) But it gives the following error Runtime error Traceback (most recent call last): File "
06-27-202108:22 AM
|
0
|
4
|
1164
|
POST
|
I have got an error when running the Longest Flowpath for Watershed under the Watershed processing of ArcHydro Tool. After the creation of the Longest Flowpath for few watersheds, the tool failed and displayed an error that failed to open the raster dataset. Please find the attachment for details of the error message.
... View more
05-30-202109:14 AM
|
0
|
0
|
384
|
POST
|
My apologies. I had done a horrible mistake in posting the 2nd code (actually I posted the same code in both places). Please consider the following: workspace= arcpy.GetParameterAsText(1) workspace + "/Data.shp" workspace + "/Stat.dbf" is working fine. Tool fails to execute when I allow users to save the files using the GetParameterAsText: Output_Data_shp = arcpy.GetParameterAsText(1) Output_Table_dbf = arcpy.GetParameterAsText(2) I have defined workspace as workspace data type.
... View more
05-16-202108:42 PM
|
0
|
1
|
1149
|
POST
|
My apologies. I had done a horrible mistake in posting the 2nd code (actually I posted the same code in both places). Please consider the following: workspace= arcpy.GetParameterAsText(1) workspace + "/Data.shp" workspace + "/Stat.dbf" is working fine. Tool fails to execute when I allow users to save the files using the GetParameterAsText: Output_Data_shp = arcpy.GetParameterAsText(1) Output_Table_dbf = arcpy.GetParameterAsText(2)
... View more
05-16-202108:40 PM
|
0
|
0
|
1150
|
POST
|
My apologies. I had done a horrible mistake in posting the 2nd code (actually I posted the same code in both places). Please consider the following: workspace= arcpy.GetParameterAsText(1) workspace + "/Data.shp" workspace + "/Stat.dbf" is working fine. Tool fails to execute when I allow users to save the files using the GetParameterAsText: Output_Data_shp = arcpy.GetParameterAsText(1) Output_Table_dbf = arcpy.GetParameterAsText(2) I have defined workspace as workspace data type.
... View more
05-16-202108:40 PM
|
0
|
0
|
1150
|
POST
|
我已经pythan worksp脚本工具ace + "/Data.shp" is sucessfully saving the files as here: >>> import arcpy ... import os ... import sys ... from arcpy import env ... arcpy.env.overwriteOutput = True ########################################### ... InFc = arcpy.GetParameterAsText(0) ... workspace= arcpy.GetParameterAsText(1) ... Output_Data_shp = workspace + "/Data.shp" ... Output_Table_dbf = workspace + "/Table.dbf" ... # Process: Table Select ... arcpy.TableSelect_analysis(InFc, Output_Table_dbf, "") ... # Process: Dissolve ... arcpy.Dissolve_management(InFc, Output_Data_shp, "", "", "MULTI_PART", "DISSOLVE_LINES") But when I allow users to define the path, the tools fails to execute. For this I used following code: >>> import arcpy ... import os ... import sys ... from arcpy import env ... arcpy.env.overwriteOutput = True ########################################### ... InFc = arcpy.GetParameterAsText(0) ... Output_Data_shp = arcpy.GetParameterAsText(1) ... Output_Table_dbf = arcpy.GetParameterAsText(2) ... # Process: Table Select ... arcpy.TableSelect_analysis(InFc, Output_Table_dbf, "") ... # Process: Dissolve ... arcpy.Dissolve_management(InFc, Output_Data_shp, "", "", "MULTI_PART", "DISSOLVE_LINES") For information, I am running the Python script inside a normal toolbox (i.e. not inside a python toolbox). I have defined the data types correctly under the Parameters tab of the script. Although python is quite new to me and I am not trained enough to implement codes into the script to detect errors, I think the GetParametersAsText defines the directory with Single Backslash (/) which hinders the tool to execute. Any suggestions to solve the issue? Thanks in advance.
... View more
05-16-202112:26 PM
|
0
|
7
|
1242
|
POST
|
As a Python script tool.
... View more
05-14-202102:14 PM
|
0
|
1
|
451
|
Title | Kudos | Posted |
---|---|---|
1 | 07-11-202212:17 PM |
Online Status |
Offline
|
Date Last Visited |
07-28-202208:25 PM
|