Exemple #1
0
 public string RasterCalculatorNKS(string nN, string nP, string Y, string S, string gS)
 {
     try
     {
         ESRI.ArcGIS.SpatialAnalystTools.RasterCalculator rasterCalculator = new ESRI.ArcGIS.SpatialAnalystTools.RasterCalculator();
         if (nP == "12")
         {
             rasterCalculator.expression = "('" + Y + "' * '" + nN + "' * 12) / ('" + S + "' * '" + gS + "' + 15 )";
         }
         else
         {
             rasterCalculator.expression = "('" + Y + "' * '" + nN + "' * '" + nP + "') / ('" + S + "' * '" + gS + "' + 15)";
         }
         ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
         rasterCalculator.output_raster = AppSingleton.Instance().WorkspacePath + "\\nks";
         gp.AddOutputsToMap             = AppSingleton.Instance().AralariEkle;
         gp.OverwriteOutput             = true;
         gp.Execute(rasterCalculator, null);
         return(rasterCalculator.output_raster.ToString());
     }
     catch (Exception ex)
     {
         return(string.Empty);
     }
 }
        private void AddToDictionaryAndWizardPages(DataGridViewRow item)
        {
            EnterpoleGrid    fieldGrid        = new EnterpoleGrid();
            FieldLayerObject fieldLayerObject = new FieldLayerObject();

            foreach (EnterpoleField layerField in AppSingleton.Instance().EnterpoleFieldListesi)
            {
                if (layerField.LayerObject.layer.Name == item.Cells[0].Value.ToString())
                {
                    fieldLayerObject.LayerObject = layerField.LayerObject;
                    fieldGrid.FieldLayerObject   = fieldLayerObject;
                    fieldGrid.FieldName          = layerField.FieldName;
                    fieldGrid.EnterpoleMethod    = layerField.EnterpoleMetodu;
                    fieldGrid.Hedef = layerField.Hedef;
                    break;
                }
            }
            int itemCount = AppSingleton.Instance().EnterpoleItemCount + 1;

            fieldGrid.GridID = itemCount;
            AppSingleton.Instance().EnterpoleItemCount = itemCount;

            IFeatureLayer fLayer = fieldGrid.FieldLayerObject.LayerObject.layer as IFeatureLayer;

            AppSingleton.Instance().EnterpoleGridDict.Add(fLayer.Name, fieldGrid);
            UpdateFieldList(fieldGrid.Hedef, fLayer.Name);//UtilMethods.CountUniques((ITable)fLayer.FeatureClass, fieldGrid.FieldName);
            fieldGrid.SetLabel(fLayer.Name);
            AppSingleton.Instance().wizardHost.WizardPages.Add(itemCount, fieldGrid);
        }
        private void btnUygula_Click(object sender, EventArgs e)
        {
            if (cmbXColumn.SelectedIndex < 0)
            {
                MessageBox.Show("X değeri belirlenmeden işlem yapılamaz.");
                return;
            }
            if (cmbYColumn.SelectedIndex < 0)
            {
                MessageBox.Show("Y değeri belirlenmeden işlem yapılamaz.");
                return;
            }
            AppSingleton.Instance().CreateWorkspacePath();
            var name = Path.GetFileNameWithoutExtension(txtExcel.Text);

            ESRI.ArcGIS.Geoprocessor.Geoprocessor    gp           = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
            ESRI.ArcGIS.ConversionTools.ExcelToTable excelToTable = new ESRI.ArcGIS.ConversionTools.ExcelToTable();
            excelToTable.Input_Excel_File = txtExcel.Text;
            excelToTable.Output_Table     = AppSingleton.Instance().WorkspacePath + "\\" + name;
            gp.AddOutputsToMap            = AppSingleton.Instance().AralariEkle;
            gp.OverwriteOutput            = true;
            gp.Execute(excelToTable, null);

            ESRI.ArcGIS.DataManagementTools.MakeXYEventLayer makeLayer = new ESRI.ArcGIS.DataManagementTools.MakeXYEventLayer();
            makeLayer.table             = excelToTable.Output_Table;
            makeLayer.in_x_field        = cmbXColumn.SelectedItem.ToString();
            makeLayer.in_y_field        = cmbYColumn.SelectedItem.ToString();
            makeLayer.out_layer         = excelToTable.Output_Table + "_layer";
            makeLayer.spatial_reference = "WGS 1984";

            gp.AddOutputsToMap = true;
            gp.OverwriteOutput = true;
            gp.Execute(makeLayer, null);
        }
Exemple #4
0
        protected override void OnClick()
        {
            AppSingleton.Instance().CreateWorkspacePath();
            KadastroForm form = new KadastroForm();

            form.ShowDialog();
        }
Exemple #5
0
 private bool PolygonToRaster(ILayer selectedLayer, string inputType, string valueField, string priorityField)
 {
     try
     {
         ESRI.ArcGIS.Geoprocessor.Geoprocessor       gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
         ESRI.ArcGIS.ConversionTools.PolygonToRaster polygonToRaster = new ESRI.ArcGIS.ConversionTools.PolygonToRaster();
         polygonToRaster.in_features       = selectedLayer;
         polygonToRaster.value_field       = valueField;//"distance";
         polygonToRaster.out_rasterdataset = AppSingleton.Instance().WorkspacePath + "\\Poly_Raster_" + selectedLayer.Name;
         polygonToRaster.cell_assignment   = "MAXIMUM_AREA";
         polygonToRaster.cellsize          = AppSingleton.Instance().CellSize;
         if (priorityField != "")
         {
             polygonToRaster.priority_field = priorityField; //"priority";
         }
         IFeatureLayer fLayer = AppSingleton.Instance().SinirLayer as IFeatureLayer;
         IEnvelope     env    = fLayer.AreaOfInterest.Envelope;
         gp.SetEnvironmentValue("Extent", env.XMin.ToString() + " " + env.YMin.ToString() + " " + env.XMax.ToString() + " " + env.YMax.ToString());
         gp.AddOutputsToMap = AppSingleton.Instance().AralariEkle;
         gp.OverwriteOutput = true;
         gp.Execute(polygonToRaster, null);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #6
0
        public string RasterClipLayer(object selectedLayer, IFeatureLayer sinirLayer, string outputName)
        {
            try
            {
                IFeatureWorkspace fWorkspace             = AppSingleton.Instance().PersonalWorkspace as IFeatureWorkspace;
                ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
                ESRI.ArcGIS.SpatialAnalystTools.ExtractByRectangle rastClip = new ESRI.ArcGIS.SpatialAnalystTools.ExtractByRectangle();
                rastClip.in_raster       = selectedLayer;//Kriging
                rastClip.extraction_area = "INSIDE";
                rastClip.out_raster      = AppSingleton.Instance().WorkspacePath + "\\" + outputName;

                IFeatureLayer fLayer = sinirLayer;
                IEnvelope     env    = fLayer.AreaOfInterest.Envelope;

                string geo = env.XMin.ToString() + " " + env.YMin.ToString() + " " + env.XMax.ToString() + " " + env.YMax.ToString();
                rastClip.rectangle = geo;

                gp.AddOutputsToMap = AppSingleton.Instance().AralariEkle;
                gp.OverwriteOutput = true;
                gp.Execute(rastClip, null);
                return(rastClip.out_raster.ToString());
                //return clip.out_feature_class.ToString();
            }
            catch (Exception ex)
            {
                return(string.Empty);
            }
        }
Exemple #7
0
        public void Init()
        {
            IMxDocument        mxDocument      = AppSingleton.Instance().MxDocument;
            IMap               map             = mxDocument.FocusMap;
            int                layerCount      = map.LayerCount;
            List <LayerObject> LayerObjectList = new List <LayerObject>();

            for (int i = 0; i < layerCount; i++)
            {
                ILayer        layer  = map.get_Layer(i);
                IFeatureLayer fLayer = layer as IFeatureLayer;
                if (fLayer != null)
                {
                    IFeatureClass fclass = fLayer.FeatureClass;

                    LayerObject lObject = new LayerObject();
                    lObject.layer = layer;
                    lObject.Name  = layer.Name;
                    LayerObjectList.Add(lObject);
                }
            }
            UpdateComboboxWithLayers(cmbProjectArea, LayerObjectList);
            UpdateComboboxWithLayers(cmbVeriAylik, LayerObjectList);
            UpdateComboboxWithLayers(cmbVeriYillik, LayerObjectList);
        }
 public bool CheckForm()
 {
     if (txtPiksel.Text != "")
     {
         AppSingleton.Instance().CellSize = Convert.ToDouble(txtPiksel.Text);
     }
     AppSingleton.Instance().AralariEkle       = chbAra.Checked;
     AppSingleton.Instance().TinRasterMethod   = cmbTinToRasterMethod.SelectedItem.ToString();
     AppSingleton.Instance().TinRasterDataType = cmbDataType.SelectedItem.ToString();
     AppSingleton.Instance().NodataValue       = Convert.ToInt32(txtNoData.Text);
     if (cmbYarıcapIDW.SelectedIndex == 0)
     {
         AppSingleton.Instance().IDWYaricap = cmbYarıcapIDW.SelectedItem.ToString() + " " + txtNoktaSayisiIDW.Text + " " + txtMaxUzaklikIDW.Text;
     }
     else
     {
         AppSingleton.Instance().IDWYaricap = cmbYarıcapIDW.SelectedItem.ToString() + " " + txtMesafeIDW.Text + " " + txtMinNoktaIDW.Text;
     }
     if (cmbYarıcapKriging.SelectedIndex == 0)
     {
         AppSingleton.Instance().KrigingYaricap = cmbYarıcapKriging.SelectedItem.ToString() + " " + txtNoktaSayisiKriging.Text + " " + txtMaxUzaklikKriging.Text;
     }
     else
     {
         AppSingleton.Instance().KrigingYaricap = cmbYarıcapKriging.SelectedItem.ToString() + " " + txtMesafeKriging.Text + " " + txtMinNoktaKriging.Text;
     }
     AppSingleton.Instance().KrigingSemiVariogram = cmbSemiVariogramKriging.SelectedItem.ToString();
     AppSingleton.Instance().KrigingLagSayisi     = txtLagKriging.Text;
     AppSingleton.Instance().UygulamaYontemi      = cmbYontem.SelectedItem.ToString();
     return(true);
 }
Exemple #9
0
        public void CheckYonList(ListBox lb)
        {
            List <LayerObject> enterpoleList = AppSingleton.Instance().BufferLayerList;
            List <LayerObject> poligonList   = AppSingleton.Instance().FinalTamponKatmanListesi;

            for (int i = lb.Items.Count - 1; i >= 0; i--)
            {
                bool kontrol = false;
                foreach (LayerObject item in enterpoleList)
                {
                    if (item == lb.Items[i])
                    {
                        kontrol = true;
                        break;
                    }
                }
                foreach (LayerObject item in poligonList)
                {
                    if (item == lb.Items[i])
                    {
                        kontrol = true;
                        break;
                    }
                }

                if (kontrol == false)
                {
                    lb.Items.RemoveAt(i);
                }
            }
        }
Exemple #10
0
        private bool RasterClipLayer(ILayer selectedLayer, string type)
        {
            try
            {
                IFeatureWorkspace fWorkspace             = AppSingleton.Instance().PersonalWorkspace as IFeatureWorkspace;
                ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
                ESRI.ArcGIS.SpatialAnalystTools.ExtractByRectangle rastClip = new ESRI.ArcGIS.SpatialAnalystTools.ExtractByRectangle();
                rastClip.in_raster       = AppSingleton.Instance().WorkspacePath + "\\" + selectedLayer.Name + "_" + type;//Kriging
                rastClip.extraction_area = "INSIDE";
                rastClip.out_raster      = AppSingleton.Instance().WorkspacePath + "\\" + type + "Clip_" + selectedLayer.Name;

                IFeatureLayer fLayer = AppSingleton.Instance().SinirLayer as IFeatureLayer;
                IEnvelope     env    = fLayer.AreaOfInterest.Envelope;
                //<<<<<<< .mine
                //string geo = env.XMin.ToString() + " " + env.YMin.ToString() + " " + env.XMax.ToString() + " " + env.YMax.ToString();
                // rastClip.clipping_geometry = geo;
                //=======
                string geo = env.XMin.ToString() + " " + env.YMin.ToString() + " " + env.XMax.ToString() + " " + env.YMax.ToString();
                rastClip.rectangle = geo;

                gp.AddOutputsToMap = AppSingleton.Instance().AralariEkle;
                gp.OverwriteOutput = true;
                gp.Execute(rastClip, null);
                return(true);
                //return clip.out_feature_class.ToString();
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemple #11
0
        private bool Reclassify(ILayer selectedLayer, string FieldName, string reclassMap, string inputType, string outputType)
        {
            try
            {
                ESRI.ArcGIS.Geoprocessor.Geoprocessor gp      = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
                ESRI.ArcGIS.Analyst3DTools.Reclassify reclass = new ESRI.ArcGIS.Analyst3DTools.Reclassify();
                reclass.in_raster     = AppSingleton.Instance().WorkspacePath + "\\" + inputType + selectedLayer.Name;  //RingBuffered_
                reclass.reclass_field = FieldName;                                                                      //"Value";
                reclass.out_raster    = AppSingleton.Instance().WorkspacePath + "\\" + outputType + selectedLayer.Name; //Reclassified_
                reclass.remap         = reclassMap;                                                                     // "50 1;50 100 2;100 150 3;NODATA 0";

                gp.AddOutputsToMap = AppSingleton.Instance().AralariEkle;
                gp.OverwriteOutput = true;
                gp.Execute(reclass, null);
                if (outputType == "Reclassified_")
                {
                    reclassList.Add(reclass.out_raster.ToString());
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemple #12
0
        private void UpdateEnterpoleLayers()
        {
            List <LayerObject> EnterpoleLayer = new List <LayerObject>();
            List <LayerObject> PolygonLayer   = new List <LayerObject>();
            List <LayerObject> RasterLayer    = new List <LayerObject>();

            foreach (LayerObject layerObject in AppSingleton.Instance().allLayers)
            {
                var layer = (layerObject.layer as IFeatureLayer);
                if (layer != null)
                {
                    if (layer.FeatureClass.ShapeType != esriGeometryType.esriGeometryPolygon)
                    {
                        EnterpoleLayer.Add(layerObject);
                    }
                    else if (layer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                    {
                        PolygonLayer.Add(layerObject);
                    }
                }
                else if (layerObject.layer is IRasterLayer)
                {
                    RasterLayer.Add(layerObject);
                }
            }
            AppSingleton.Instance().EnterpoleLayerList = EnterpoleLayer;
            AppSingleton.Instance().PolygonLayerList   = PolygonLayer;
            AppSingleton.Instance().RasterLayerList    = RasterLayer;
        }
Exemple #13
0
        private void btnCalistir_Click(object sender, EventArgs e)
        {
            if (cmbIklimEkoloji.SelectedIndex < 0)
            {
                MessageBox.Show("İklim-Ekoloji katmanı belirlenmeden işlem yapılamaz.");
                return;
            }
            if (cmbProjectArea.SelectedIndex < 0)
            {
                MessageBox.Show("Proje sınırı belirlenmeden işlem yapılamaz.");
                return;
            }
            if (cmbKadastro.SelectedIndex < 0)
            {
                MessageBox.Show("Kadastro katmanı belirlenmeden işlem yapılamaz.");
                return;
            }
            AppSingleton.Instance().CreateWorkspacePath();
            if (AppSingleton.Instance().SettingsControl == null)
            {
                SettingsControl control = new SettingsControl();
                control.Load();
                control.CheckForm();
            }
            tpSonuc.Visible    = true;
            tpSonuc.CustomText = "İklim Katmanı kesiliyor...";
            tpSonuc.Maximum    = 5;

            tpSonuc.VisualMode = ProgressBarDisplayMode.TextAndPercentage;
            tpSonuc.Step       = 1;
            tpSonuc.PerformStep();
            var iklimClipLayer = AppSingleton.Instance().RasterClipLayer((cmbIklimEkoloji.SelectedItem as LayerObject).layer, ((cmbProjectArea.SelectedItem as LayerObject).layer as IFeatureLayer), "RC_IKLIM");

            tpSonuc.CustomText = "Poligona dönüştürülüyor...";
            tpSonuc.Step       = 1;
            tpSonuc.PerformStep();

            var fClass = RasterToPolygon(iklimClipLayer);

            JoinField(fClass, "gridcode", iklimClipLayer, "Value");
            tpSonuc.CustomText = "Kadastro Katmanı kesiliyor...";
            tpSonuc.Step       = 1;
            tpSonuc.PerformStep();

            var clipLayer = AppSingleton.Instance().ClipLayers((cmbProjectArea.SelectedItem as LayerObject).layer, (cmbKadastro.SelectedItem as LayerObject).layer);

            tpSonuc.CustomText = "Katmanlar kesiştiriliyor...";
            tpSonuc.Step       = 1;
            tpSonuc.PerformStep();

            InterSect(fClass, clipLayer);
            tpSonuc.CustomText = "İşlem tamamlandı...";
            tpSonuc.Step       = 1;
            tpSonuc.PerformStep();
            (this.Parent as Form).Close();
        }
Exemple #14
0
        private void UpdateKullanilacakLayers()
        {
            List <LayerObject> allLayer = new List <LayerObject>();

            foreach (LayerObject LayerObject in listBoxKullanilacaklar.Items)
            {
                allLayer.Add(LayerObject);
            }
            AppSingleton.Instance().allLayers = allLayer;
        }
Exemple #15
0
        private void btnCalistir_Click(object sender, EventArgs e)
        {
            if (cmbEkolojikSitAlani.SelectedIndex < 0)
            {
                MessageBox.Show("Ekolojik Sit Alanı katmanı belirlenmeden işlem yapılamaz.");
                return;
            }
            if (cmbProjectArea.SelectedIndex < 0)
            {
                MessageBox.Show("Proje sınırı belirlenmeden işlem yapılamaz.");
                return;
            }
            if (cmbIklimSiniri.SelectedIndex < 0)
            {
                MessageBox.Show("İklim Sınırı katmanı belirlenmeden işlem yapılamaz.");
                return;
            }
            AppSingleton.Instance().CreateWorkspacePath();
            if (AppSingleton.Instance().SettingsControl == null)
            {
                SettingsControl control = new SettingsControl();
                control.Load();
                control.CheckForm();
            }
            tpSonuc.Visible    = true;
            tpSonuc.VisualMode = ProgressBarDisplayMode.TextAndPercentage;
            tpSonuc.CustomText = "İklim Katmanı kesiliyor...";
            tpSonuc.Maximum    = 5;
            tpSonuc.Step       = 1;
            tpSonuc.PerformStep();
            var iklimClipLayer = AppSingleton.Instance().RasterClipLayer((cmbIklimSiniri.SelectedItem as LayerObject).layer, ((cmbProjectArea.SelectedItem as LayerObject).layer as IFeatureLayer), "RC_IKL");

            tpSonuc.CustomText = "Ekoloji Katmanı kesiliyor...";
            tpSonuc.PerformStep();
            var ekolojiClipLayer = AppSingleton.Instance().RasterClipLayer((cmbEkolojikSitAlani.SelectedItem as LayerObject).layer, ((cmbProjectArea.SelectedItem as LayerObject).layer as IFeatureLayer), "RC_EKO");
            var vatIklim         = AppSingleton.Instance().BuildRasterAttributeTable("RC_IKL");
            var vatEko           = AppSingleton.Instance().BuildRasterAttributeTable("RC_EKO");

            var layerNames = iklimClipLayer + ";" + ekolojiClipLayer;

            tpSonuc.CustomText = "Katmanlar birleştiriliyor...";
            tpSonuc.PerformStep();
            AppSingleton.Instance().Combine(layerNames, "IKL_EKO");
            var vatIklEko = AppSingleton.Instance().BuildRasterAttributeTable("IKL_EKO");

            tpSonuc.CustomText = "Eksik kolonlar ekleniyor...";
            tpSonuc.PerformStep();
            JoinField(vatIklEko, "RC_IKL", vatIklim, "Value");
            JoinField(vatIklEko, "RC_EKO", vatEko, "Value");
            tpSonuc.CustomText = "İşlem tamamlandı...";
            tpSonuc.PerformStep();
            (this.Parent as Form).Close();
        }
Exemple #16
0
        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            ArcMap.Application.CurrentTool = null;
            IMxDocument mxDocument = ArcMap.Document;

            AppSingleton.Instance().MxDocument = mxDocument;
            MainForm mainForm = new MainForm();

            mainForm.ShowDialog();
        }
Exemple #17
0
        private void CmbSinirKatmani_SelectedIndexChanged(object sender, EventArgs e)
        {
            LayerObject LayerObject = CmbSinirKatmani.SelectedItem as LayerObject;

            if (LayerObject != null)
            {
                AppSingleton.Instance().SinirLayer = LayerObject.layer;
            }
            else
            {
                AppSingleton.Instance().SinirLayer = null;
            }
        }
Exemple #18
0
 private string InterSect(string flayer, string kadastroLayer)
 {
     ESRI.ArcGIS.Geoprocessor.Geoprocessor gp        = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
     ESRI.ArcGIS.AnalysisTools.Intersect   intersect = new ESRI.ArcGIS.AnalysisTools.Intersect();
     intersect.in_features       = flayer + ";" + kadastroLayer;
     intersect.out_feature_class = AppSingleton.Instance().WorkspacePath + "\\Final";
     intersect.join_attributes   = "All";
     intersect.output_type       = "INPUT";
     gp.AddOutputsToMap          = true;
     gp.AddOutputsToMap          = true;
     gp.OverwriteOutput          = true;
     gp.Execute(intersect, null);
     return(intersect.out_feature_class.ToString());
 }
Exemple #19
0
        public void UpdateFieldList(string FieldName, string layerName)
        {
            FieldGrid fieldGrid = AppSingleton.Instance().BufferDict[layerName];
            Dictionary <string, string> fieldList = new Dictionary <string, string>();

            string[] split = FieldName.Split(',');

            foreach (string item in split)
            {
                fieldList.Add(item, "");
            }
            fieldGrid.FieldLayerObject.FieldList = fieldList;
            AppSingleton.Instance().BufferDict[layerName] = fieldGrid;
        }
Exemple #20
0
        public void FillDatagrid()
        {
            if (dataGridView1.Rows.Count > 0)
            {
                for (int i = dataGridView1.Rows.Count - 1; i >= 0; i--)
                {
                    bool kontrol = false;
                    if (dataGridView1.Rows[i].Cells[0].Value != null)
                    {
                        string layerName = dataGridView1.Rows[i].Cells[0].Value.ToString();
                        foreach (LayerObject item in AppSingleton.Instance().allLayers)
                        {
                            if (item.layer.Name == layerName)
                            {
                                kontrol = true;
                                break;
                            }
                        }
                        if (kontrol == false)
                        {
                            dataGridView1.Rows.RemoveAt(i);
                        }
                    }
                }
            }
            foreach (LayerObject item in AppSingleton.Instance().allLayers)
            {
                bool kontrol = false;
                if (dataGridView1.Rows.Count > 0)
                {
                    for (int j = dataGridView1.Rows.Count - 1; j >= 0; j--)
                    {
                        if (dataGridView1.Rows[j].Cells[0].Value != null)
                        {
                            string layerName = dataGridView1.Rows[j].Cells[0].Value.ToString();

                            if (item.layer.Name == layerName)
                            {
                                kontrol = true;
                                break;
                            }
                        }
                    }
                }
                if (kontrol == false)
                {
                    AddToDatagrid(item);
                }
            }
        }
Exemple #21
0
 private string RasterToPolygon(object rasterlayer)
 {
     ESRI.ArcGIS.Geoprocessor.Geoprocessor       gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
     ESRI.ArcGIS.ConversionTools.RasterToPolygon rasterToPolygon = new ESRI.ArcGIS.ConversionTools.RasterToPolygon();
     rasterToPolygon.in_raster            = rasterlayer;
     rasterToPolygon.out_polygon_features = AppSingleton.Instance().WorkspacePath + "\\RasterToPolygon";
     rasterToPolygon.simplify             = "SIMPLIFY";
     rasterToPolygon.raster_field         = "Value";
     gp.AddOutputsToMap = AppSingleton.Instance().AralariEkle;
     gp.AddOutputsToMap = AppSingleton.Instance().AralariEkle;
     gp.OverwriteOutput = true;
     gp.Execute(rasterToPolygon, null);
     return(rasterToPolygon.out_polygon_features.ToString());
 }
Exemple #22
0
        public new void Load()
        {
            if (AppSingleton.Instance().CellSize == 0)
            {
                AppSingleton.Instance().CellSize = 1000;
            }

            cmbTinToRasterMethod.SelectedIndex    = 0;
            cmbSemiVariogramKriging.SelectedIndex = 0;
            cmbYarıcapIDW.SelectedIndex           = 0;
            cmbYarıcapKriging.SelectedIndex       = 0;
            cmbDataType.SelectedIndex             = 0;
            txtPiksel.Text          = AppSingleton.Instance().CellSize.ToString();
            cmbYontem.SelectedIndex = 0;
        }
Exemple #23
0
 private void polylayersUpdated()
 {
     if (AppSingleton.Instance().PolygonLayerList.Count > 0)
     {
         if (!(AppSingleton.Instance().wizardHost.WizardPages.ContainsKey(4)))
         {
             poligonSec = new PolygonSec();
             AppSingleton.Instance().wizardHost.WizardPages.Add(4, poligonSec);
         }
     }
     else
     {
         AppSingleton.Instance().wizardHost.WizardPages.Remove(4);
     }
     poligonSec.InitForm();
 }
Exemple #24
0
 private void bufferlayersUpdated()
 {
     if (AppSingleton.Instance().BufferLayerList.Count > 0 || AppSingleton.Instance().PolygonLayerList.Count > 0)
     {
         if (!(AppSingleton.Instance().wizardHost.WizardPages.ContainsKey(3)))
         {
             bufferKatmanSec = new BufferKatmanSec();
             //AppSingleton.Instance().wizardHost.WizardPages.Add(3, bufferKatmanSec);
         }
     }
     else
     {
         //AppSingleton.Instance().wizardHost.WizardPages.Remove(3);
     }
     //bufferKatmanSec.InitForm();
 }
Exemple #25
0
        private ITable BuildRasterAttributeTable(string rasterName)
        {
            Type factoryType = Type.GetTypeFromProgID(
                "esriDataSourcesGDB.AccessWorkspaceFactory");
            IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
                                                     (factoryType);
            IRasterWorkspaceEx  rasterWorkspaceEx = workspaceFactory.OpenFromFile(AppSingleton.Instance().WorkspacePath, 0) as IRasterWorkspaceEx;
            IRasterDataset      rasterDataset     = rasterWorkspaceEx.OpenRasterDataset(rasterName);
            IRasterDatasetEdit2 raster            = (IRasterDatasetEdit2)rasterDataset;

            ESRI.ArcGIS.Geodatabase.IGeoDataset geoDataset = (ESRI.ArcGIS.Geodatabase.IGeoDataset)rasterDataset;
            raster.BuildAttributeTable();
            ITable vat = (raster as IRasterBandCollection).Item(0).AttributeTable;

            return(vat);
        }
        public bool CheckForm()
        {
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[0].Value != null)
                {
                    if (row.Cells[1].Value == null)
                    {
                        validationMessage = row.Cells[0].Value.ToString() + " katmanının öznitelik tipi belli değildir. Lütfen belirtiniz.";
                        return(false);
                    }
                    if (row.Cells[3].Value == null)
                    {
                        validationMessage = row.Cells[0].Value.ToString() + " katmanının enterpolasyon metodu belli değildir. Lütfen belirtiniz.";
                        return(false);
                    }
                }
            }
            List <EnterpoleField> enterpoleListesi = new List <EnterpoleField>();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                EnterpoleField field = new EnterpoleField();
                if (row.Cells[0].Value != null)
                {
                    string layerName     = row.Cells[0].Value.ToString();
                    string attributeName = row.Cells[1].Value.ToString();
                    string hedef         = row.Cells[2].Value.ToString();
                    string metod         = row.Cells[3].Value.ToString();
                    foreach (LayerObject item in AppSingleton.Instance().FinalEnterpolasyonKatmanListesi)
                    {
                        if (item.layer.Name == layerName)
                        {
                            field.LayerObject     = item;
                            field.Hedef           = hedef;
                            field.EnterpoleMetodu = metod;
                            field.FieldName       = attributeName;
                            enterpoleListesi.Add(field);
                        }
                    }
                }
            }
            AppSingleton.Instance().EnterpoleFieldListesi = enterpoleListesi;
            CheckDict();
            return(true);
        }
Exemple #27
0
        public void FillSolList()
        {
            List <LayerObject> solList       = GetList(listBoxTumKatmanlarBuffer);
            List <LayerObject> sagList       = GetList(listBoxKullanilacaklarBuffer);
            List <LayerObject> kontrollist   = AppSingleton.Instance().BufferLayerList;
            List <LayerObject> enterpoleList = CheckListForSagList(kontrollist);

            for (int i = enterpoleList.Count - 1; i >= 0; i--)
            {
                bool kontrol = false;
                foreach (LayerObject item in solList)
                {
                    if (item == enterpoleList[i])
                    {
                        kontrol = true;
                        break;
                    }
                }
                if (kontrol == false)
                {
                    listBoxTumKatmanlarBuffer.Items.Add(enterpoleList[i]);
                }
            }


            List <LayerObject> polykontrollist = AppSingleton.Instance().PolygonLayerList;
            List <LayerObject> polyList        = CheckListForSagList(polykontrollist);

            for (int i = polyList.Count - 1; i >= 0; i--)
            {
                bool kontrol = false;
                foreach (LayerObject item in solList)
                {
                    if (item == polyList[i])
                    {
                        kontrol = true;
                        break;
                    }
                }
                if (kontrol == false)
                {
                    listBoxTumKatmanlarBuffer.Items.Add(polyList[i]);
                }
            }
        }
Exemple #28
0
 public EnterpoleGrid GetEnterpoleGrid(string layerName)
 {
     try
     {
         foreach (var item in AppSingleton.Instance().EnterpoleGridDict)
         {
             if (item.Key == layerName)
             {
                 return(item.Value);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Exemple #29
0
 public FieldGrid GetBufferGrid(string layerName)
 {
     try
     {
         foreach (var item in AppSingleton.Instance().BufferDict)
         {
             if (item.Key == layerName)
             {
                 return(item.Value);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Exemple #30
0
 private bool Combine(string layerNames)
 {
     try
     {
         ESRI.ArcGIS.Geoprocessor.Geoprocessor   gp      = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
         ESRI.ArcGIS.SpatialAnalystTools.Combine combine = new ESRI.ArcGIS.SpatialAnalystTools.Combine();
         combine.in_rasters = layerNames;
         combine.out_raster = AppSingleton.Instance().WorkspacePath + "\\" + "Ekolojik_Sit_Alani";
         gp.AddOutputsToMap = true;
         gp.OverwriteOutput = true;
         gp.Execute(combine, null);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }