/// <summary> /// Searches for the coordinate system /// </summary> private ICoordinateSystem GetCoordinateSystemCore(ISpatialReference proj) { string name = proj.Name.ToLower(); if (proj.IsEmpty) { return(null); } var projEsri = proj.MorphToEsri(); string esriName = projEsri != null?projEsri.Name.ToLower() : string.Empty; int epsg; if (proj.TryAutoDetectEpsg(out epsg)) { return(GetCoordinateSystem(epsg)); } if (proj.IsGeographic) { return(GetCoordinateSystemCore(_listGcs, name, esriName)); } if (proj.IsProjected) { return(GetCoordinateSystemCore(_listPcs, name, esriName)); } return(null); }