package com.tofly.analyse.util.analysis;

import com.supermap.analyst.networkanalyst.TransportationAnalyst;
import com.supermap.analyst.networkanalyst.TransportationAnalystParameter;
import com.supermap.analyst.networkanalyst.TransportationAnalystResult;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * 路径分析
 *
 * @author zhoux
 */
@Component
public class PathAnalysis {


    /// <summary>
    /// 路径分析
    /// </summary>
    /// <param name="node1"></param>
    /// <param name="node2"></param>
    /// <returns></returns>
    public TransportationAnalystResult PathAnalysis(TransportationAnalyst m_transAnalyst, List<Integer> param) {


        TransportationAnalystParameter __transParameter = new TransportationAnalystParameter();
        __transParameter.setNodes(param.stream().mapToInt(i->i).toArray());
        __transParameter.setRoutesReturn(true);
        __transParameter.setNodesReturn(true);
        __transParameter.setEdgesReturn(true);
        TransportationAnalystResult __taResult = m_transAnalyst.findPath(__transParameter, false);
        System.out.println(__taResult.getEdges());
        return __taResult;
    }





}
