Exemplo n.º 1
0
    public void LoadFile(string fname, Transform par)
    {
        parent = par;
        DataSource ds = Ogr.Open(fname, 0);

        Assert.IsNotNull(ds);
        Assert.IsTrue(ds.GetLayerCount() > 0);

        Layer layer = ds.GetLayerByIndex(0);

        layer.ResetReading();
        Feature feat;

        while ((feat = layer.GetNextFeature()) != null)
        {
//             if (feat.GetFID() != 46)
//             {
//                 continue;
//             }
            GameObject feaObj = GameObject.Instantiate(SpeedRoad.prefab);
            feaObj.transform.parent = parent;
            SpeedRoadSection sec = new SpeedRoadSection(ref feaObj, feat);
            map[sec.Fid] = sec;
        }
    }
Exemplo n.º 2
0
    public SpeedRoadSection GetSection(long fid)
    {
        SpeedRoadSection result = null;

        if (map.ContainsKey(fid))
        {
            result = map[fid];
        }
        return(result);
    }
Exemplo n.º 3
0
    public List <Vector3> GetSectionFrom2Corssing(long start, long end)
    {
        SpeedRoadCrossing s      = GetCrossing(start);
        bool             forward = true;
        SpeedRoadSection sec     = s.GetTargetSection(end, ref forward);

        Assert.IsNotNull(sec);
        var path = sec.GetPath(forward);

        return(path);
    }