internal HttpCoordinateSystemDefinition(CoordinateSystemCategory parent, XmlNode topnode) : base(parent) { foreach (XmlNode node in topnode.ChildNodes) { switch (node["Name"].InnerText.ToLower()) { case "code": m_code = node["Value"].InnerText; break; case "description": m_description = node["Value"].InnerText; break; case "projection": m_projection = node["Value"].InnerText; break; case "projection description": m_projectionDescription = node["Value"].InnerText; break; case "Datum": m_datum = node["Value"].InnerText; break; case "datum description": m_datumDescription = node["Value"].InnerText; break; case "ellipsoid": m_ellipsoid = node["Value"].InnerText; break; case "ellipsoid description": m_ellipsoidDescription = node["Value"].InnerText; break; } } }
public override CoordinateSystemDefinitionBase[] EnumerateCoordinateSystems(string category) { CoordinateSystemCategory cat = null; foreach (CoordinateSystemCategory csc in this.Categories) { if (csc.Name == category) { cat = csc; break; } } if (cat == null) { return(new CoordinateSystemDefinitionBase[0]); } MgBatchPropertyCollection bp = m_cf.EnumerateCoordinateSystems(category); List <CoordinateSystemDefinitionBase> lst = new List <CoordinateSystemDefinitionBase>(); for (int i = 0; i < bp.GetCount(); i++) { lst.Add(new LocalNativeCoordinateSystemDefinition(cat, bp.GetItem(i))); } return(lst.ToArray()); }
public override CoordinateSystemDefinitionBase[] EnumerateCoordinateSystems(string category) { CoordinateSystemCategory cat = null; foreach (CoordinateSystemCategory csc in this.Categories) { if (csc.Name == category) { cat = csc; break; } } if (cat == null) { return(new CoordinateSystemDefinitionBase[0]); } string req = this.RequestBuilder.EnumerateCoordinateSystems(category); XmlDocument doc = new XmlDocument(); doc.Load(m_con.OpenRead(req)); XmlNodeList lst = doc.SelectNodes("BatchPropertyCollection/PropertyCollection"); CoordinateSystemDefinitionBase[] data = new CoordinateSystemDefinitionBase[lst.Count]; for (int i = 0; i < lst.Count; i++) { data[i] = new HttpCoordinateSystemDefinition(cat, lst[i]); } return(data); }
private void LoadMinorCategories() { if (radProjected.Checked) { CoordinateSystemCategory c = KnownCoordinateSystems.Projected.GetCategory((string)cmbMajorCategory.SelectedItem); if (c == null) { return; } cmbMinorCategory.SuspendLayout(); cmbMinorCategory.Items.Clear(); string[] names = c.Names; foreach (string name in names) { cmbMinorCategory.Items.Add(name); } cmbMinorCategory.SelectedIndex = 0; _selectedCoordinateSystem = c.GetProjection(names[0]); cmbMinorCategory.ResumeLayout(); } else { CoordinateSystemCategory c = KnownCoordinateSystems.Geographic.GetCategory((string)cmbMajorCategory.SelectedItem); cmbMinorCategory.SuspendLayout(); cmbMinorCategory.Items.Clear(); string[] names = c.Names; foreach (string name in names) { cmbMinorCategory.Items.Add(name); } cmbMinorCategory.SelectedIndex = 0; _selectedCoordinateSystem = c.GetProjection(names[0]); cmbMinorCategory.ResumeLayout(); } }
private void cmbMinorCategory_SelectedIndexChanged(object sender, EventArgs e) { if (radProjected.Checked) { CoordinateSystemCategory c = KnownCoordinateSystems.Projected.GetCategory((string)cmbMajorCategory.SelectedItem); _selectedCoordinateSystem = c.GetProjection((string)cmbMinorCategory.SelectedItem); cmbMinorCategory.ResumeLayout(); } else { CoordinateSystemCategory c = KnownCoordinateSystems.Geographic.GetCategory((string)cmbMajorCategory.SelectedItem); _selectedCoordinateSystem = c.GetProjection((string)cmbMinorCategory.SelectedItem); cmbMinorCategory.ResumeLayout(); } }
internal LocalNativeCoordinateSystemDefinition(CoordinateSystemCategory parent, MgPropertyCollection props) : base(parent) { int pcount = props.GetCount(); for (int i = 0; i < pcount; i++) { var prop = props.GetItem(i); switch (prop.Name.ToLower()) { case "code": m_code = (prop as MgStringProperty).Value; break; case "description": m_description = (prop as MgStringProperty).Value; break; case "projection": m_projection = (prop as MgStringProperty).Value; break; case "projection description": m_projectionDescription = (prop as MgStringProperty).Value; break; case "Datum": m_datum = (prop as MgStringProperty).Value; break; case "datum description": m_datumDescription = (prop as MgStringProperty).Value; break; case "ellipsoid": m_ellipsoid = (prop as MgStringProperty).Value; break; case "ellipsoid description": m_ellipsoidDescription = (prop as MgStringProperty).Value; break; } } }
private void CoordinateCategory_SelectedIndexChanged(object sender, EventArgs e) { if (m_isUpdating) { return; } CoordinateSystem.Enabled = CoordinateSystemLabel.Enabled = CoordinateCategory.SelectedIndex >= 0; if (CoordinateCategory.SelectedIndex >= 0) { CoordinateSystemCategory cat = CoordinateCategory.SelectedItem as CoordinateSystemCategory; if (cat == null) { OKBtn.Enabled = false; return; } CoordinateSystem.Items.Clear(); CoordinateSystem.Items.AddRange(cat.Items); } }
/// <summary> /// Initializes a new instance of the <see cref="CoordinateSystemBase"/> class. /// </summary> /// <param name="parent">The parent.</param> protected CoordinateSystemDefinitionBase(CoordinateSystemCategory parent) { m_parent = parent; }
public static IEnumerable <ProjectionInfoDesc> GetForCoordinateSystemCategory(CoordinateSystemCategory category) { return(category.Names.Select(d => new ProjectionInfoDesc(d, category.GetProjection(d)))); }
public static IEnumerable<ProjectionInfoDesc> GetForCoordinateSystemCategory(CoordinateSystemCategory category) { return category.Names.Select(d => new ProjectionInfoDesc(d, category.GetProjection(d))); }