Saturday 14 May 2016

arcpy - Prompting for user input during ArcGIS Python script tool execution?


I want to prompt for user input after all parameters have been specified for the script tool. I've seen many forum posts and stackexchange questions about this, and they all conclude that it's unnecessary, but I think my case is an exception. I want to give the user an opportunity to confirm data, such as how many sets of GPS coordinates there are. They will be yes/no questions ("is this data obviously incorrect?"), and the script tool parameter input form doesn't seem like it'd work well for this.


I know Tkinter's event handler causes problems with ArcGIS, and other framworks have similar problems. One workaround I found is to have your script call another script that runs as a separate process, and display the GUI from the second process, but that seems a little too hackish.




Apparently wxPython does work, but it's not included with python. I need to be able to distribute these scripts without any extra requirements other than ArcGIS, so that wouldn't work for me.




To clarify, the most important use would be to prompt the user when my software validation checks can't validate the data. For example, I have a list of IDs that I want to validate, but the format isn't consistent. I want to be able to prompt the user with a yes/no dialog if I can't validate in software (eg. the ID doesn't match one of the common patterns). It's possible that new ID formats will be created without my knowledge.




Another example: I have a file that contains, among other things, a table of start & stop times. I want to validate each row of the table individually, and cramming all of that data, plus the other checks, into the warning window would get ugly fast.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...