#include <iostream>

#include "qichecheng/MapInterface.hpp"

// #ifdef STANDALONE
int main(int argc, char **argv) {
    std::string prj = argv[1];
    std::string folder = argv[2];

    std::cout << "prj: " << prj << ", folder: " << folder << std::endl;
    jf::MapInterface mi(prj, folder);

    std::vector<jf::Point> points =  // mi.m_mlMapLib.m_hlHdLib.LoadGpses();
        {
            jf::Point(120.44124321, 31.59069762, 0),
        };
    int n = 0;
    for (auto ptInLoc : points) {
        double dCarAngle = 45;
        long lRoadId = 0;
        std::vector<long> vctlPLinkIds = {};
        std::vector<long> vctlNLinkIds = {};
        int nOutLaneCnt = 0;
        int nOutLaneNum = 0;
        jf::LaneType nOutLaneType = jf::LaneType::NotInvestigated;
        jf::EdgeCrossType nOutLeftEdgeCrossType = jf::EdgeCrossType::NotInvestigated;
        jf::EdgeCrossType nOutRightEdgeCrossType = jf::EdgeCrossType::NotInvestigated;
        int nOutSpeedLimit = 0;
        double dOutLaneAngle = 0;
        jf::Point ptOutFoot = {};
        bool ret = mi.GetMapData(ptInLoc, dCarAngle, lRoadId, vctlPLinkIds, vctlNLinkIds, nOutLaneCnt, nOutLaneNum, nOutLaneType, nOutLeftEdgeCrossType, nOutRightEdgeCrossType, nOutSpeedLimit, dOutLaneAngle, ptOutFoot);
        if (ret == false) {
            std::cout.precision(16);
            std::cout << ptInLoc.dLon << ", " << ptInLoc.dLat << ",,,,";
        }
    }

    return 0;
}
