Unexpected error 999998 when using the DensifySamplingNetwork_ga arcpy function

01-07-2019 12:08 PM
New Contributor III

Hello, I have a Kriging layer file, and on this file I tried to use the DensifySamplingNetwork_ga function in Arcpy. But I got an error:


Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>   File "d:\arcgis 10.4.1\desktop10.4\arcpy\arcpy\ga.py", line 888, in DensifySamplingNetwork     raise e ExecuteError: ERROR 999998: Unexpected Error. Failed to execute (DensifySamplingNetwork).


I just ran the following commands:

import arcpy


arcpy.DensifySamplingNetwork_ga("D:\Kriging\KrigingLayer.lyr", 1, "D:\Kriging\Densify_1_200", "QUARTILE_THRESHOLD_UPPER", 200)


I can succeed on Windows 8 with ArcGIS 10.4.1, but the above error occurs on Windows 7 and 10 with ArcGIS 10.4.1 and 10.6.1, which is confusing. I'm attaching my Kriging layer file below.


Could someone please help me with this issue? Thank you!

Problem solved: it's because the layer file is storing an absolute path to the data. So I cannot directly densify this Kriging layer on another computer. Thanks everyone for replying!

0 Kudos
12 Replies
Esri Regular Contributor

When creating the geostatistical layer, I would suggest that you use a shapefile or a  file geodatabase rather than an XY layer. I.e. use the CopyFeatures tool.

And because you are using a non-projected coordinate system means that EBK will use chordal distances.

New Contributor III

I don't think it has to do with the source file of the .lyr file, because this densify function can succeed on one computer, meaning the .lyr file is correct and can be accepted.

0 Kudos
Esri Regular Contributor

Because you can repro the problem and we can't we need to try a few things on your side if possible. A geostatistical layer, is basically a set a parameters and a pointer to the input data. It is dynamic in nature and without the data it is broken.

Some questions;

  1. does it succeed only on the machine where the layer was created (i.e. Win8 machine)?
  2. is the layer saved using the gp SaveToLayerFile tool and the "Store Relative Path" is checked?
  3. is the directory structure the same on Win7/10 as on Win8?
  4. does the source data (points) exist on the Win7/10 machines?
  5. on the machines where it fails (Win7 and Win10), does GA Layer to Contour geoprocessing tool succeed?