public static ISpatialReference GetSpatialReferenceByWKT(string wkt, enumWKTSource source) { if (string.IsNullOrEmpty(wkt)) { return(null); } ISpatialReferenceStringParser[] ps = new ISpatialReferenceStringParser[] { new WktProjectionCommonParser(source) }; foreach (ISpatialReferenceStringParser p in ps) { ISpatialReference sref = null; try { sref = p.Parse(wkt); if (sref != null) { TrySetCoordinateDomain(sref); return(sref); } } catch (Exception ex) { Log.WriterException(ex); throw; } } return(null); }
static SpatialReferenceFactory() { PrjFileParser = new WktProjectionCommonParser(enumWKTSource.EsriPrjFile); }