Kerkin interpolation and raster Rendering

Source: Internet
Author: User

1. First, write a method for raster rendering:

Step: 1 calculate the cube Graph 2 create a ribbon 3 Rendering

// Rendering
Private void renders (irasterlayer layer)
{
Irasterclassifycolorramprenderer classrender = new rasterclassifycolorramprendererclass ();


Irasterrenderer rasterrender = classrender as irasterrenderer;
Iraster raster = Layer. Raster;
Irasterbandcollection collection = raster as irasterbandcollection;
Irasterband rasterband = collection. Item (0 );
If (rasterband. histogram = NULL)
{
Rasterband. computestatsandhist (); // calculates the cube.
}

Classrender. classcount = 8;

Ialgorithmiccolorramp ramp = new algorithmiccolorrampclass ();
Ramp. fromcolor = getcolor (255, 0, 0 );
Ramp. tocolor = getcolor (0,255, 0 );
Ramp. size = 8;
Bool OK = true;
Ramp. createramp (out OK );

Ifillsymbol fillsymbol = new simplefillsymbolclass ();
For (INT I = 0; I <classrender. classcount; I ++)
{
Fillsymbol. Color = ramp. get_color (I); // ramp. colors. Next () is unavailable ()
Classrender. set_symbol (I, fillsymbol as isymbol );
Classrender. set_label (I, "class" + I. tostring ());

}
Irasterrenderer render = classrender as irasterrenderer;
Render. Update ();
Layer. Renderer = classrender as irasterrenderer;
}

2 kerkin interpolation, similar to IDW Interpolation

Private void kringtoolstripmenuitem_click (Object sender, eventargs E)
{

Igeodataset geodataset = axmapcontrol1.get _ layer (0) as igeodataset;
Object etn = geodataset. extent;
Ifeaturelayer layer = axmapcontrol1.get _ layer (0) as ifeaturelayer;
Ifeatureclassdescriptor descriptor = new featureclassdescriptorclass ();
Descriptor. Create (layer. featureclass, null, "value ");

Irasterradius radius = new rasterradiusclass ();
Object missing = NULL;
Radius. setvariable (12, ref missing );
// Double DSearch = 10;
// Object dsearchcount = 3;
// Radius. setfixed (DSearch, ref dsearchcount );

Iinterpolationop interpolation = new rasterinterpolationopclass ();

Object cellsize = 15;
Irasteranalysisenvironment environment = interpolation as irasteranalysisenvironment;
Environment. setcellsize (esrirasterenvsettingenum. esrirasterenvvalue, ref cellsize );
Environment. setextent (esrirasterenvsettingenum. esrirasterenvvalue, ref etn, ref missing );

Igeodataset dataset = interpolation. krige (igeodataset) descriptor, esrigeoanalysissemivariogramenum. esrigeoanalysissphericalsemivariogram, radius, false, ref missing );
MessageBox. Show ("interpolation successful! ");
Iraster raster = new ESRI. ArcGIS. datasourcesraster. Raster ();
Raster = dataset as iraster;
Irasterlayer rasterlayer = new rasterlayerclass ();
Rasterlayer. createfromraster (raster );
Renders (rasterlayer );
Axmapcontrol1.addlayer (rasterlayer );

MessageBox. Show ("interpolation successful! ");

 


}


Kerkin interpolation and raster Rendering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.