public static void addJsonToGrid (
            OutputStream outputStream,
            AccessibilityResult accessibilityResult,
            List<TaskError> scenarioApplicationWarnings,
            List<TaskError> scenarioApplicationInfo,
            PathResult pathResult
    ) throws IOException {
        var jsonBlock = new GridJsonBlock();
        jsonBlock.scenarioApplicationInfo = scenarioApplicationInfo;
        jsonBlock.scenarioApplicationWarnings = scenarioApplicationWarnings;
        if (accessibilityResult != null) {
            // Due to the application of distance decay functions, we may want to make the shift to non-integer
            // accessibility values (especially for cases where there are relatively few opportunities across the whole
            // study area). But we'd need to control the number of decimal places serialized into the JSON.
            jsonBlock.accessibility = accessibilityResult.getIntValues();
        }
        jsonBlock.pathSummaries = pathResult == null ? Collections.EMPTY_LIST : pathResult.getPathIterationsForDestination();
        LOG.debug("Travel time surface written, appending {}.", jsonBlock);
        // We could do this when setting up the Spark handler, supplying writeValue as the response transformer
        // But then you also have to handle the case where you are returning raw bytes.
        JsonUtilities.objectMapper.writeValue(outputStream, jsonBlock);
        LOG.debug("Done writing");
    }
public static void addJsonToGrid (
            OutputStream outputStream,
            AccessibilityResult accessibilityResult,
            List<TaskError> scenarioApplicationWarnings,
            List<TaskError> scenarioApplicationInfo,
            PathResult pathResult
    ) throws IOException {
        var jsonBlock = new GridJsonBlock();
        jsonBlock.scenarioApplicationInfo = scenarioApplicationInfo;
        jsonBlock.scenarioApplicationWarnings = scenarioApplicationWarnings;
        if (accessibilityResult != null) {
           
           
           
            jsonBlock.accessibility = accessibilityResult.getIntValues();
        }
        jsonBlock.pathSummaries = pathResult == null ? Collections.EMPTY_LIST : pathResult.getPathIterationsForDestination();
        LOG.debug("Travel time surface written, appending {}.", jsonBlock);
       
       
        JsonUtilities.objectMapper.writeValue(outputStream, jsonBlock);
        LOG.debug("Done writing");
    }
public static void addjsontogrid ( outputstream outputstream, accessibilityresult accessibilityresult, list<taskerror> scenarioapplicationwarnings, list<taskerror> scenarioapplicationinfo, pathresult pathresult ) throws ioexception { var jsonblock = new gridjsonblock(); jsonblock.scenarioapplicationinfo = scenarioapplicationinfo; jsonblock.scenarioapplicationwarnings = scenarioapplicationwarnings; if (accessibilityresult != null) { jsonblock.accessibility = accessibilityresult.getintvalues(); } jsonblock.pathsummaries = pathresult == null ? collections.empty_list : pathresult.getpathiterationsfordestination(); log.debug("travel time surface written, appending {}.", jsonblock); jsonutilities.objectmapper.writevalue(outputstream, jsonblock); log.debug("done writing"); }