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; } }
public SpeedRoadSection GetSection(long fid) { SpeedRoadSection result = null; if (map.ContainsKey(fid)) { result = map[fid]; } return(result); }
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); }