POST
|
Thanks Gina! This does make total sense. Consider it user error - I was misunderstanding how the No Data areas would be treated in the outputs. Initially I was expecting there to be "no data" pixels in the outputs as well as the predicted 0 and 1 classes, which in hindsight doesn't make sense, so your explanation set me straight. Thank you!
... View more
02-14-2023
08:54 AM
|
0
|
0
|
941
|
POST
|
Hi @GinaO_Neil and WIM users! I'm using the latest version of the archydro (3.0.50) WIM tools on groundtruth data that is multi-classed. When running the Preprocess Ground Truth Data, I'm checking that "features represent more than one target class" option and I'm unchecking the "class of areas outside of the ground truth features is known" option. The processed wetlands show up as expected with data classes of 0 and 1 and showing no data for the areas outside of my groundtruth data. This is the groundtruth wetlands features (symbolized by class) This is what they look like after preprocessing The training raster looks good as well I run into problems later in the workflow though - it seems like the 0 class of the raster gets merged with the no data section of the extents so my final predictions have 0 and 1 classes but the 0 class seems to reflect both the actual 0 class of data AND the no data areas. Once I've trained the model and built my composite raster here's what my prediction looks like It predicts what I'd expect the 1 class to look like but the 0 class locations seem to merge with the no data areas from the groundtruth. Am I missing a setting somewhere or skipping a step? Thanks!
... View more
02-13-2023
10:51 AM
|
0
|
3
|
996
|
POST
|
Sure thing! Code is below, it's part of a larger python toolbox I'm building. We'll be iterating through different geographic areas and running the tools, so the class dictionary just allows for flexibility in how many classes there might be in a raster. If you had just a single location or a consistent set of classes you could hard code a single sampling percentage string and cut out everything above line 21 # build class dictionary for sampling percents
class_dict = {}
class_dict[9] = "0 25;1 50;2 50;3 50;4 50;5 50;6 50;7 50;8 50;9 50"
class_dict[8] = "0 25;1 50;2 50;3 50;4 50;5 50;6 50;7 50;8 50"
class_dict[7] = "0 25;1 50;2 50;3 50;4 50;5 50;6 50;7 50"
class_dict[6] = "0 25;1 50;2 50;3 50;4 50;5 50;6 50"
class_dict[5] = "0 25;1 50;2 50;3 50;4 50;5 50"
class_dict[4] = "0 25;1 50;2 50;3 50;4 50"
class_dict[3] = "0 25;1 50;2 50;3 50"
class_dict[2] = "0 25;1 50;2 50"
class_dict[1] = "0 25;1 50"
# determine how many classes are present in raster
ds = gdal.Open(wetland_path)
arcpy.AddMessage(ds)
band = ds.GetRasterBand(1)
arcpy.AddMessage(band)
max_val = band.GetMaximum()
arcpy.AddMessage(max_val)
if max_val in class_dict:
sample_pct = class_dict[max_val]
arcpy.AddMessage(f'{wetland_name} has {max_val} wetland classes - sampling perentages {sample_pct}')
# train test split
arcpy.AddMessage(f'Building train and test split for grid {pagenum}...')
train_name = f'grid_{pagenum}_train.tif'
test_name = f'grid_{pagenum}_test.tif'
train_path = os.path.join(model_folder_path, train_name)
test_path = os.path.join(model_folder_path, test_name)
p_traintest = traintestsplit.TrainTestSplit()
ret_traintest = p_traintest.executeAH(in_gt_ras=wetland_path,
out_train=train_path,
out_test=test_path,
in_class_sampling_percent=sample_pct)
else:
arcpy.AddError(f'Sampling percentages not found for {max_val} class raster. Exiting.')
... View more
11-15-2022
10:24 AM
|
1
|
0
|
1335
|
POST
|
Thanks so much Gina! I ended up finding a workaround - I'm working on a standalone python script that predicts wetlands (using the WIM tools) and calculates impacted wetland areas for project locations. And I was able to call the Train Test Split tool successfully from my standalone python script to generate the train and test rasters without getting the error message. I'll definitely keep an eye out for the upgrade in the next few weeks, thanks again for your help!
... View more
10-26-2022
07:34 AM
|
0
|
2
|
1390
|
POST
|
I've been using the WIM toolset for wetland identification successfully for a few months now, but I tried to open the "Train Test Split" tool yesterday and I'm now getting the error "Error HRESULT E_FAIL has been returned from a call to a COM component." The error shows up instead of the usual tool parameter options, so many of the recommended problem solver suggestions for the "HRESULT" errors don't apply in that I can't modify geoprocessing extent or the location of data, etc since I can't even get to the parameters for the tool in the first place. The rest of the tools in the WIM set all open the parameter options and everything I've spot-checked in Archydro also works as expected. My inclination is that it's related somehow to the archydro tools themselves or scikit-learn python package since it's bombing as soon as I try to open it and not showing any parameters. If I try to "edit" the Train Test Split tool from catalog, it says the script is empty but if I navigate manually to the traintestsplit.py file the script opens and looks as expected. I'm currently running ArcGIS Pro 2.9.3, ArcHydro tools 2.9.59, so the versions should be aligned. I've tried the doable recommended ArcHydro problem solvers to no avail (restarts, new mxd, clearing temp folder). Anyone experienced something similar or have any ideas? ( @GinaO_Neil I'm hoping you have some magic up your sleeve! 🤞) Thanks!
... View more
10-22-2022
10:35 PM
|
0
|
13
|
2068
|
POST
|
Hey Gina - thanks for the reply! It turned out to just be user error with the projection on one of the input rasters. All the raster tifs aligned almost by definition since I'm using the same small grid square to clip all of them down to the same cell size/extent. And I'd checked all of the projections to make sure they were they same but managed to overlook that one of the rasters was a very similar projection but not actually the same. I only caught it when I was going through all the "checks" again and was comparing the WKID numbers and noticed it was 1 off from the rest. Once I got that sorted out it runs as expected (still with the extents warning message) and successfully assigns band variable importances and generates outputs I'd expect!
... View more
09-19-2022
08:01 AM
|
0
|
1
|
774
|
POST
|
Hey all - I'm running the ArcHydro tools in Pro (2.9.3) and using the wetland identification toolset. I'm getting stuck at the Train Random Trees tool using DTW, Curvature, and TWI as predictor inputs - the predictor input rasters have the expected value ranges and look how I'd expect them to. The tool runs "successfully" but I get a warning that says "Extents between the training raster and predictor variable raster do not match. The predictor variable(s) will be clipped to the training raster extents temporarily. Only cells overlapping the cells in the training raster can be used to train the model." But the extents of the predictor variables all appear to be the same (and are all built using the other WIM tools that derive these predictor inputs from the same origin DEM file.) In the variable importance txt file, all the band importances are 0.0, and the bands listed for the raster in pro are labeled as are 1, 2, and 1 (instead of the expected 1, 2, and 3). I've tried creating a fresh APRX with no improvement and I'm not sure what else I can try to get it working. Any ideas what might be causing this? Thanks!
... View more
09-01-2022
09:38 PM
|
0
|
3
|
850
|
POST
|
For anyone still having issues with the second example where an apostrophe causes the custom URL to break and stop auto-populating subsequent fields - Lance Cole provided a great workaround. You can read his full response here Custom URL from Collector Passing Attribute Values with Special Characters to Survey123.
... View more
06-18-2019
12:14 PM
|
1
|
0
|
1636
|
POST
|
Lance Cole- this worked! I had to tweak the arcade expression just a bit, the expression I ended up using is below Var t = $feature["Trail_Name"]
IIf (Find("'", t)>0, Replace(t, "'", "%27"), t) And a couple Esri quirks I found as well - when using the custom URL link from a web map, the link attempts to encode the % sign that I'm manually inserting above, adding some extra unexpected characters to the Survey123 form, BUT when the link is clicked from Collector, it works exactly as expected. I also found that this is currently only supported in Collector for iOS devices. For android devices, the Collector app doesn't honor the arcade expression being sent through (yet) and that field just shows up as a blank line. However, the Beta version of Collector for android (also available in the Google Play Store) does support the arcade expression, so the link and resulting population in Survey123 shows the expected result. Thanks again for all of your help! Mallory
... View more
06-18-2019
11:46 AM
|
0
|
0
|
2433
|
POST
|
Lance Colethis looks like exactly what I need - thank you!! I'll give this a go later this week Thanks for all of your help! Mallory
... View more
06-18-2019
09:39 AM
|
0
|
0
|
2433
|
POST
|
Hey Lance Cole - I had the same thought, but we're passing through a field name rather than a specific value for the field. So the URL reads arcgis-survey123://?itemID=abcdefghijklmnopqrstuvwxyz&field:TrailName={trail_name} rather than arcgis-survey123://?itemID=abcdefghijklmnopqrstuvwxyz&field:TrailName="Mary's Rock". I couldn't think of any way to add this encoding on a conditional basis anytime an apostrophe comes up in the passed field's value. But I'm definitely open to any ideas or possible workarounds I've missed! Thanks for your help! Mallory
... View more
06-18-2019
08:02 AM
|
0
|
3
|
2433
|
POST
|
I have a web map for use in Collector that has a custom URL in the pop-up to launch a Survey123 form. One of the fields that is passed through the custom URL tends to have a lot of values with apostrophes. In the Survey123 form, all the fields populate via the custom URL as expected until a value with an apostrophe is passed through, then the apostrophe does not appear and nothing after that auto-populates. An example is below: Field One: Compton Peak Field Two: Mary <<< This should read "Mary's Rock" Field Three: <<< This should read "Rock Castle Gorge" This behavior only appears on the iPad and Android mobile devices. When tested in the Windows version of the Survey123 application, all the values come through as expected.
... View more
06-17-2019
08:08 AM
|
0
|
7
|
2856
|
POST
|
Has there been any resolution to the second behavior in the original post? I'm having the same issue in a Survey123 Form - where an apostrophe is passed through as an attribute value by the URL parameters and the Survey 123 form stops populating anything else after that. This behavior doesn't show up in the windows version of the Survey123, but does on the iPad and android devices we've tested.
... View more
06-17-2019
07:23 AM
|
0
|
0
|
1636
|
POST
|
I'm working on a Python toolbox and the function to get the geoprocessing messages doesn't seem to work as documented. I'm just using the arcpy.GetMessages() function arcpy.AddMessage(arcpy.GetMessages()) and the result is Start Time: Thursday, January 10, 2019 3:21:16 PM
Succeeded at Thursday, January 10, 2019 3:21:29 PM (Elapsed Time: 12.40 seconds) If I use the arcpy.GetMessageCount() function, it likewise returns 2 as the result. This page of message documentation says that when using the GetMessages function "the first message gives the tool executed, and the last message gives the ending and elapsed time for the tool's execution. The tool's second and last messages always give the start and end time, respectively, for the tool's execution." The part that I need, the name of the tool executed, isn't coming through. Even if I use the GetMessage function and specify the 0 index position, it still returns the start time. What am I missing?
... View more
01-10-2019
01:03 PM
|
0
|
2
|
2985
|
Title | Kudos | Posted |
---|---|---|
1 | 12-06-2022 10:47 AM | |
1 | 11-15-2022 10:24 AM | |
1 | 06-18-2019 12:14 PM |
Online Status |
Offline
|
Date Last Visited |
06-14-2023
12:16 AM
|