Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i'd like to create an application that reclass a raster . user enter his/her range of class in a listbox . the application calculate minimum and maximum of band value . the problem is that i couldn't connect min and max value with "a" for reclassify in below code. .in fact i don't know what should i do for reclass.remap .

for (int i = 0; i < preclassHookhelper.FocusMap.LayerCount; i++)
            {
                if (preclassHookhelper.FocusMap.get_Layer(i).Name == cmbraster.Text)
                {
                    prasterlayer = (IRasterLayer)preclassHookhelper.FocusMap.get_Layer(i);
                    IRaster praster;
                    praster = prasterlayer.Raster;
                    IRasterBandCollection prasterbandc;
                    IRasterBand prasterband;
                    prasterbandc = (IRasterBandCollection) praster;
                    prasterband = prasterbandc.Item(0);
                    string min = Convert.ToString(prasterband.Statistics.Minimum);
                    string max = Convert.ToString(prasterband.Statistics.Maximum);
                    string a = ""; 
                   for (int i = 0; i < listBox1.Items.Count; i++)
                     {
                         a += listBox1.Items[i].ToString() + ";";
                     }
                    a.Remove(a.Length - 1);
                    Geoprocessor gp = new Geoprocessor();
                    Reclassify reclass = new Reclassify();
                    reclass.in_raster = prasterlayer.Raster;
                    reclass.missing_values = "NODATA";
                    reclass.out_raster = txtoutputpath.Text;
                    reclass.reclass_field = "Value";
                    reclass.remap =                  

                    gp.Execute(reclass, null);
                    Close();
                }
                }
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.