/// <summary>Enumerates all SRID's in the SRID.csv file.</summary> /// <returns>Enumerator</returns> public static IEnumerable <WKTstring> GetSRIDs() { string[] srids = Resources.SRID.Split('\n'); foreach (string srid in srids) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(srid.Split(';')[0]); wkt.WKT = srid.Split(';')[1]; yield return(wkt); } }
/// <summary>Enumerates all SRID's in the SRID.csv file.</summary> /// <returns>Enumerator</returns> public static IEnumerable<WKTstring> GetSRIDs() { string[] srids = Resources.SRID.Split('\n'); foreach (string srid in srids) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(srid.Split(';')[0]); wkt.WKT = srid.Split(';')[1]; yield return wkt; } }
/// <summary> /// 获得SRID.csv中的坐标列表 /// </summary> /// <returns>Enumerator</returns> public static IEnumerable <WKTstring> GetSRIDs() { using (StreamReader sr = File.OpenText(Path.Combine(Application.StartupPath, filename))) { while (!sr.EndOfStream)//逐条获取并构造WKTstring返回 { string line = sr.ReadLine(); int split = line.IndexOf(';'); if (split > -1) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(line.Substring(0, split)); wkt.WKT = line.Substring(split + 1); yield return(wkt); } } sr.Close(); } }
/// <summary> /// Enumerates all SRID's in the SRID.csv file. /// </summary> /// <returns>Enumerator</returns> public static IEnumerable<WKTstring> GetSRIDs() { using (System.IO.StreamReader sr = System.IO.File.OpenText(filename)) { while (!sr.EndOfStream) { string line = sr.ReadLine(); int split = line.IndexOf(';'); if (split > -1) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(line.Substring(0, split)); wkt.WKT = line.Substring(split + 1); yield return wkt; } } sr.Close(); } }
/// <summary> /// Enumerates all SRID's in the SRID.csv file. /// </summary> /// <returns>Enumerator</returns> public static IEnumerable <WKTstring> GetSRIDs() { using (System.IO.StreamReader sr = System.IO.File.OpenText(filename)) { while (!sr.EndOfStream) { string line = sr.ReadLine(); int split = line.IndexOf(';'); if (split > -1) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(line.Substring(0, split)); wkt.WKT = line.Substring(split + 1); yield return(wkt); } } sr.Close(); } }
/// <summary> /// Enumerates all SRID's in the SRID.csv file. /// </summary> /// <returns>Enumerator</returns> public static IEnumerable<WKTstring> GetSRIDs() { TextAsset filecontent = Resources.Load(filename) as TextAsset; using (System.IO.StringReader sr = new System.IO.StringReader(filecontent.text)) { string line = sr.ReadLine(); while (line != null) { int split = line.IndexOf(';'); if (split > -1) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(line.Substring(0, split)); wkt.WKT = line.Substring(split + 1); yield return wkt; } line = sr.ReadLine(); } sr.Close(); } }
private IEnumerable <WKTstring> GetSRIDs() { using (var sr = File.OpenText(DbPath)) { while (!sr.EndOfStream) { var line = sr.ReadLine(); int split = line.IndexOf(';'); if (split > -1) { var wkt = new WKTstring { WKID = int.Parse(line.Substring(0, split)), WKT = line.Substring(split + 1) }; yield return(wkt); } } sr.Close(); } }
/// <summary> /// Enumerates all SRID's in the SRID.csv file. /// </summary> /// <returns>Enumerator</returns> public static IEnumerable <WKTstring> GetSRIDs() { using (MemoryStream memStream = new MemoryStream(Resources.SRID)) { using (StreamReader sr = new StreamReader(memStream)) { while (!sr.EndOfStream) { string line = sr.ReadLine(); int split = line.IndexOf(';'); if (split > -1) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(line.Substring(0, split)); wkt.WKT = line.Substring(split + 1); yield return(wkt); } } sr.Close(); } } }
/// <summary> /// Enumerates all SRID's in the SRID.csv file. /// </summary> /// <returns>Enumerator</returns> public static IEnumerable <WKTstring> GetSRIDs() { TextAsset filecontent = Resources.Load(filename) as TextAsset; using (System.IO.StringReader sr = new System.IO.StringReader(filecontent.text)) { string line = sr.ReadLine(); while (line != null) { int split = line.IndexOf(';'); if (split > -1) { WKTstring wkt = new WKTstring(); wkt.WKID = int.Parse(line.Substring(0, split)); wkt.WKT = line.Substring(split + 1); yield return(wkt); } line = sr.ReadLine(); } sr.Close(); } }