PSU-CSAR / vb-bagis-p

VB .NET source code for ArcMap BAGIS Parameters add-in
1 stars 1 forks source link

Export tool unable to compress the resampled DEM and HRU ASCII files to the output #27

Closed jdduh closed 8 years ago

jdduh commented 8 years ago

The error message says that "An error occurred when package the HRU zones and DEM for eWSF. They are not included in the zip file." This occurred on both Gus and Dave's computers (running 10.2.2). When I copied their AOIs to my computer, the export succeeded without any error. What triggered the error message? I suspect that it's related to the temp output folder (or the temp files were removed before the compression was finished). Any thought? The meeting went well today.

lbross commented 8 years ago

What resolution did you resample to?

lbross commented 8 years ago

Given the error message, the error likely occurred in the AddZonesToZipFolder function in FrmExportParametersEwsf. If you send me the AOIs, I can try to replicate the error but if it succeeded for you, I don't know how productive this would be.

Does the error occur when they do not resample the HRU? If not, then we know the problem is in the resample code.

The temporary zip folder is created as a subfolder in the output path. If they don't have permissions to create a folder here, the code would fail. It's also possible that the length of the path to the temporary zip folder is too long. We only write the .asc file to this folder but it may have the same limitations as the GRID format.

The rest of the intermediate steps are all written to the hru.gdb so they would already have to have permissions there.

If none of this helps, I can create a debug version with MessageBoxes so we can pinpoint exactly where the error is occurring. Glad things went well on Monday.

Sample file paths: zipFolder: "C:\Docs\Lesley\NRCS_Code_Migration\BAGIS_P\BagisZip" hruGdbName: "C:\Docs\Lesley\ochoco_FGDB\zones\hru_ca\hru_ca.gdb" outputFileBase: "C:\Docs\Lesley\ochoco_FGDB\zones\hru_ca\hru_ca.gdb\grid" hruClipPath: "C:\Docs\Lesley\ochoco_FGDB\zones\hru_ca\hru_ca.gdb\tmpResample" outputRaster: "C:\Docs\Lesley\ochoco_FGDB\zones\hru_ca\hru_ca.gdb\tmpResample"

jdduh commented 8 years ago

Gus told me that he exported the file(s) to a path (i.e., his desktop) that he used before. The previous export didn't have any error. Dave and Gus both resampled the rasters to 100 meters resolution. They are willing to help with the debugging if you need them to install a new addin that could generate more specific error messages.

Dave's AOI can be downloaded from ftp://basins.geog.pdx.edu/BAGIS/BAGIS_aois/. The AOI is Sprague_R_nr_Chiloquin_06072013. The file size is about 200 MB. There is only one HRU in the AOI. I ran the export tool on this AOI on my desktop computer successfully.

jdduh commented 8 years ago

I saw a log file (automatically generated by ArcMap?) on my output folder. Do you think the file might be useful? I can ask Gus or Dave to find this file. Here is the content of the log file.

201512221256 0 0 0jduh E:\NRCS\AOIs\Sprague_R_nr_Chiloquin_06072013\BagisZip\clipDem = SELECTMASK(E:\NRCS\AOIs\Sprague_R_nr_Chiloquin_06072013\BagisZip\reDem, E:\NRCS\AOIs\Sprague_R_nr_Chiloquin_06072013\zones\hru2_e5_3_recond\hru2_e5_3_recond.gdb\tmpResample) 201512221256 0 1 0jduh E:\NRCS\AOIs\SPRAGU~1\BagisZip\test_dem.asc = GRIDASCII ( E:\NRCS\AOIs\SPRAGU~1\BagisZip\clipDem )

lbross commented 8 years ago

Sure. If they can find the log file, that might help answer some questions. Also, could you ask them to try again without resampling to see if that works? If they can't find the log file, can you ask for the name of the output path? That is the basis of the ascii file name and I wonder if there is something in the name that is messing things up?

jdduh commented 8 years ago

Just to confirm that, despite the error message, the export was successful. The parameter file and the zip file were created, but without the two resampled ASCII files.

jdduh commented 8 years ago

After recalculating the parameters, Dave was able to export the parameters and resampled ASCII files without any error. Maybe the "bug" was related to the addin installation process. Both Dave and Gus performed the export right after they installed the addin. Dave will keep us posted if the same error occurs. I will close this issue for now.

lbross commented 8 years ago

Good news! Just so you know, the code worked as designed. If the resampling/ascii file conversion fails, the parameter export still completes and is added to the .zip file. Hopefully this is okay.

On Wed, Dec 23, 2015 at 11:50 AM, jdduh notifications@github.com wrote:

After recalculating the parameters, Dave was able to export the parameters and resampled ASCII files without any error. Maybe the "bug" was related to the addin installation process. Both Dave and Gus performed the export right after they installed the addin. Dave will keep us posted if the same error occurs. I will close this issue for now.

— Reply to this email directly or view it on GitHub https://github.com/PSU-CSAR/vb-bagis-p/issues/27#issuecomment-166979080.