0

I have a large JSON file which I download from ArcGIS Server REST (size is 140MB). When I try to execute the JSONToFeatures Geoprocessing tool on this file I get an error.

Code: (call below method with arguments toolName="JSONToFeatures", a path for input json and a path for output SHP file).

    private object RunTool(string toolName, object[] parameters) {
        IVariantArray gpParams = new VarArrayClass();
        IGeoProcessorResult gpResult = new GeoProcessorResult();
        foreach (object o in parameters)
            gpParams.Add(o);
        object rev = new object();
        try {
            gpResult = Geoprocessor.Execute(toolName, gpParams, null);
            return gpResult.ReturnValue;
        } 
        catch (COMException comEx) {
            throw new Exception(Geoprocessor.GetMessages(ref rev), comEx);
        } 
        finally {
            ReleaseObjects(new object[] { gpParams, gpResult });
        }
    }

When executed returns the following error: Executing: JSONToFeatures input_path output_path Start Time: Thu Jan 31 14:32:43 2019 ERROR 999998: Unexpected Error. Failed to execute (JSONToFeatures). Failed at Thu Jan 31 14:32:45 2019 (Elapsed Time: 1,48 seconds)

When I execute JSONToFeatures tool from within ArcDesktop ModelBuilder execution proceeds successfully.

Please note that on small files of size 1-10 MB (which is the normal size of files processed by the code above) there are no problems.

This error is very generic. How do I need to proceed?

  • Could you try this on a (much) smaller JSON file, and add the results to your question? – Berend Jan 31 at 13:28
  • Yes the code runs successfully on smaller files. In fact usually the files it handles are between 1 and 10 MB. This file is an exception. – Andreas Andreou Jan 31 at 13:30
  • What do you see if you register a geoprocessing event handler? gis.stackexchange.com/a/1683/59 – Kirk Kuykendall Feb 4 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.