Beispiel #1
0
        private void uxAttributesGrid_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (uxAttributesGrid.SelectedRows.Count >= 1)
            {
                geographicField        = uxAttributesGrid.SelectedRows[0].Cells["Name"].Value.ToString();
                uxGeographicField.Text = "Geographic field: " + geographicField;
                wfsClient.Geometry     = WFSClient.IsGeographicFieldValid(uxAttributesGrid.SelectedRows[0].Cells["Type"].Value.ToString()) ? geographicField : null;
                if (wfsClient.Geometry == null)
                {
                    MessageBox.Show("Please select a geographic field valid");
                    uxOpen.Enabled = false;
                    return;
                }

                wfsClient.TypeName = uxLayer.Text;
                uxOpen.Enabled     = true;
            }
        }
        private void uxGetCapabilities_Click(object sender, EventArgs e)
        {
            uxGroupWPS.Enabled = true;
            uxOpen.Enabled = false;
            uxLayersList.DataSource = null;
            uxAttributesGrid.DataSource = null;
            var serverUrl = uxServer.Text;

             wfsClient = new WFSClient();
            wfsClient.ReadCapabilities(serverUrl);
            uxInfo.Text = "";
            if (wfsClient.wfs.ServiceProvider != null)
            {
                uxInfo.Text += "Provider Name: " + wfsClient.wfs.ServiceProvider.ProviderName + Environment.NewLine;
                uxInfo.Text += "Provider Site: " + wfsClient.wfs.ServiceProvider.ProviderSite + Environment.NewLine;
                uxInfo.Text += "Provider Contact: " + wfsClient.wfs.ServiceProvider.ServiceContact.IndividualName.ToString() + Environment.NewLine;
              
            }
            uxVersion.Text = "Server type: " + wfsClient.wfs.Version;
            DataGridViewRow newRow = new DataGridViewRow();
            DataTable table= new DataTable();
            DataColumn dLayer = new DataColumn("Layer");
            DataColumn dGeom = new DataColumn("Geometry");
            table.Columns.Add(dLayer);
            table.Columns.Add(dGeom);
            foreach(var feature in wfsClient.wfs.FeatureTypeList.FeatureTypes)
            {
                DataRow dr = table.NewRow();
                dr["Layer"] = feature.Name.Name;

                foreach (var f in feature.WGS84BoundingBoxes)
                {
                    dr["Geometry"] = f.LowerCorner + " " + f.UpperCorner;
                }

                dr["Geometry"] = feature.WGS84BoundingBoxes.Count;
                table.Rows.Add(dr);
             }

            uxLayersList.DataSource = table;
            uxGroupWPS.Enabled = true;
            uxRequest.Text = wfsClient.uri.AbsoluteUri;
        }
Beispiel #3
0
        private void uxGetCapabilities_Click(object sender, EventArgs e)
        {
            uxGroupWPS.Enabled          = true;
            uxOpen.Enabled              = false;
            uxLayersList.DataSource     = null;
            uxAttributesGrid.DataSource = null;
            var serverUrl = uxServer.Text;

            wfsClient = new WFSClient();
            wfsClient.ReadCapabilities(serverUrl);
            uxInfo.Text = "";
            if (wfsClient.wfs.ServiceProvider != null)
            {
                uxInfo.Text += "Provider Name: " + wfsClient.wfs.ServiceProvider.ProviderName + Environment.NewLine;
                uxInfo.Text += "Provider Site: " + wfsClient.wfs.ServiceProvider.ProviderSite + Environment.NewLine;
                uxInfo.Text += "Provider Contact: " + wfsClient.wfs.ServiceProvider.ServiceContact.IndividualName.ToString() + Environment.NewLine;
            }
            uxVersion.Text = "Server type: " + wfsClient.wfs.Version;
            DataGridViewRow newRow = new DataGridViewRow();
            DataTable       table  = new DataTable();
            DataColumn      dLayer = new DataColumn("Layer");
            DataColumn      dGeom  = new DataColumn("Geometry");

            table.Columns.Add(dLayer);
            table.Columns.Add(dGeom);
            foreach (var feature in wfsClient.wfs.FeatureTypeList.FeatureTypes)
            {
                DataRow dr = table.NewRow();
                dr["Layer"] = feature.Name.Name;

                foreach (var f in feature.WGS84BoundingBoxes)
                {
                    dr["Geometry"] = f.LowerCorner + " " + f.UpperCorner;
                }

                dr["Geometry"] = feature.WGS84BoundingBoxes.Count;
                table.Rows.Add(dr);
            }

            uxLayersList.DataSource = table;
            uxGroupWPS.Enabled      = true;
            uxRequest.Text          = wfsClient.uri.AbsoluteUri;
        }