public static VoTable LoadFromString(string data) { XmlDocumentParser xParser = new XmlDocumentParser(); XmlDocument doc = xParser.ParseFromString(data, "text/xml"); VoTable table = new VoTable(); table.LoadFromXML(doc); return(table); }
public static VoTable LoadFromUrl(string url, Action complete) { VoTable temp = new VoTable(); temp.onComplete = complete; temp.webFile = new WebFile(Util.GetProxiedUrl(url)); temp.webFile.OnStateChange = temp.LoadData; temp.webFile.Send(); return(temp); }
public static VoTable LoadFromUrl(string url, Action complete) { VoTable temp = new VoTable(); temp.onComplete = complete; temp.webFile = new WebFile(URLHelpers.singleton.rewrite(url, URLRewriteMode.OriginRelative)); temp.webFile.OnStateChange = temp.LoadData; temp.webFile.Send(); return(temp); }
private void OnPropertiesDownloadComplete() { if (webFile.State == StateType.Received) { ParseProperties(webFile.GetText()); if (Properties.ContainsKey("dataproduct_type") && Properties["dataproduct_type"].ToLowerCase() == "catalog") { catalogColumnInfo = VoTable.LoadFromUrl(url.Replace("/properties", "/metadata.xml"), OnCatalogMetadataDownloadComplete); } else { if (Properties.ContainsKey("hips_data_range")) { string hips_data_range = Properties["hips_data_range"]; this.dataset.FitsProperties.MinVal = Double.Parse(hips_data_range.Split(" ")[0]); this.dataset.FitsProperties.MaxVal = Double.Parse(hips_data_range.Split(" ")[1]); this.dataset.FitsProperties.LowerCut = this.dataset.FitsProperties.MinVal; this.dataset.FitsProperties.UpperCut = this.dataset.FitsProperties.MaxVal; } if (Properties.ContainsKey("hips_pixel_cut")) { string hips_pixel_cut = Properties["hips_pixel_cut"]; this.dataset.FitsProperties.LowerCut = Double.Parse(hips_pixel_cut.Split(" ")[0]); this.dataset.FitsProperties.UpperCut = Double.Parse(hips_pixel_cut.Split(" ")[1]); if (!Properties.ContainsKey("hips_data_range")) { this.dataset.FitsProperties.MinVal = this.dataset.FitsProperties.LowerCut; this.dataset.FitsProperties.MaxVal = this.dataset.FitsProperties.UpperCut; } } downloadComplete = true; if (onDownloadComplete != null) { onDownloadComplete.Invoke(); } } } }
// Call this to add a VOTable to layers public VoTableLayer AddVoTableLayer(VoTable table) { return(LayerManager.AddVoTableLayer(table, "Vo Table")); }
public VoRow(VoTable owner) { Owner = owner; }