public ProjectionCoordSystem(NameMapItem name, NameValuePair[] parameters, AngularUnit unit) { _name = name; //if(name!=null) // _namedes = name.EsriName; _parameters = parameters; _unit = unit; }
private NameMapItem CreatNameMapItem(XElement prjParamter) { NameMapItem nameMapItem = new NameMapItem(prjParamter.Attribute(XName.Get("name")).Value, prjParamter.Attribute(XName.Get("esri")).Value, prjParamter.Attribute(XName.Get("wkt")).Value, prjParamter.Attribute(XName.Get("proj4")).Value, prjParamter.Attribute(XName.Get("epsg")).Value, prjParamter.Attribute(XName.Get("envi")).Value, prjParamter.Attribute(XName.Get("geotiff")).Value); return(nameMapItem); }
public object Clone() { NameMapItem v = new NameMapItem(); v.ENVIName = this.ENVIName; v.EPSGName = this.EPSGName; v.EsriName = this.EsriName; v.GeoTiffName = this.GeoTiffName; v.Name = this.Name; v.Proj4Name = this.Proj4Name; v.WktName = this.WktName; return(v); }
public List <NameMapItem> GetPrjParameterItems() { if (_prjParameterItems != null) { return(_prjParameterItems); } _prjParameterItems = new List <NameMapItem>(); IEnumerable <XElement> prjParamters = _root.Element(XName.Get("PrjParamters")).Elements(XName.Get("PrjParameter")); NameMapItem nameMapItem = null; foreach (XElement prjParamter in prjParamters) { nameMapItem = CreatNameMapItem(prjParamter); _prjParameterItems.Add(nameMapItem); } return(_prjParameterItems); }
public List <NameMapItem> GetPrjNameMapItems() { if (_prjNameMapItems != null) { return(_prjNameMapItems); } _prjNameMapItems = new List <NameMapItem>(); IEnumerable <XElement> projects = GetProjectNodes(); NameMapItem nameMapItem = null; foreach (XElement project in projects) { nameMapItem = CreatNameMapItem(project); _prjNameMapItems.Add(nameMapItem); } return(_prjNameMapItems); }
/* * PROJECTION["Mercator"], * PARAMETER["False_Easting",0.0], * PARAMETER["False_Northing",0.0], * PARAMETER["Central_Meridian",0.0], * PARAMETER["Standard_Parallel_1",0.0], * UNIT["Meter",1.0] */ protected override IProjectionCoordSystem ParseProjectionCoordSystem(WktItem wktItem) { if (wktItem == null)//Is Graphics Coordinate System { return(null); } string name = wktItem.Value.Split(',')[0].Replace("\"", string.Empty); NameMapItem prjName = GetPrjName(wktItem.GetWktItem("PROJECTION")); //5ms if (prjName == null) { throw new Exception("投影坐标系统\"" + name + "\"没有在系统中预先配置。"); } NameValuePair[] parameters = GetPrjParameters(wktItem.GetWktItems("PARAMETER")); AngularUnit unit = new AngularUnit(wktItem.GetWktItem("UNIT")); ProjectionCoordSystem prj = new ProjectionCoordSystem(prjName, parameters, unit); prj.NameDes = name; return(prj); }
private NameValuePair[] GetPrjParameters(WktItem[] wktItems) { List <NameValuePair> values = new List <NameValuePair>(); using (OGCWkt2Proj4Mapper map = new OGCWkt2Proj4Mapper()) { for (int i = 0; i < wktItems.Length; i++) { NameMapItem name = null; WktItem witem = wktItems[i]; string[] vs = witem.Value.Split(','); string pname = vs[0].Replace("\"", string.Empty); double pvalue = double.Parse(vs[1]); try { switch (_wktSource) { case enumWKTSource.EsriPrjFile: name = map.GetParameterFromEsriName(pname); break; case enumWKTSource.GDAL: name = map.GetParameterFromWKTName(pname); break; default: name = map.GetParameterFromWKTName(pname); break; } if (name != null) { values.Add(new NameValuePair(name, pvalue)); } } catch { continue; } } } return(values.Count > 0 ? values.ToArray() : null); }
public NameValuePair(NameMapItem name, double value) { Name = name; Value = value; }