MakePolys bug fixes and improvements #131
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes to MakePolys script that address bugs and improved error reporting for certain circumstances, where the tool did not work as intended but did not report errors. Addresses 1) null values in IsConcealed field in the CAF line data, 2) failure in reporting mode when no label points or existing map unit polygons are present, and 3) missing group layer file for reporting layers. I left a bunch of comments in the file, which can be removed after the changes are reviewed.
Original tried to query contacts and faults for IsConcealed values that are not "yes", but if a user did not have that field populated, no CAF lines were selected, so no polygons were created. The tool did not report an error - it ran successfully but did not create any map unit polygons. Change includes handling null values in the CAF IsConcealed field, and reports a Warning message if null values are included. It treats null values in IsConcealed as "not concealed" lines and will use them to create map unit polygons.
Original tool errored out when no map unit points are given, reporting mode is on, and there are not existing map unit polygons. A function in the reporting section tried to identify extra label points in polygons, using the identity tool with a variable called label_points as input. Without any label point source, and no existing "old" map unit polys from which to create label points, this variable (label_points) is never defined, thus the script fails on the identity tool. Change was made by putting this part of the code in a boolean so it doesn't run if label_points isn't defined.
Original When reporting mode is on, script looks for a .lyrx file in the /scripts folder that does not exist. This causes script to fail on addDataToPath().ete data described below. Change A grouplayer.lyrx file was added to the /scripts folder. Alternatively, a createGroupLayer method was used in the script to make the group layer in the map, instead of looking for saved layer file and adding it to the map. This is one line of code that replaces the other process. The grouplayer.lyrx is still included and the code to add it is commented out.