Use of arcengine Rendering

Source: Internet
Author: User

Use of arcengine Rendering


1. Basic Feature Rendering Method
The following methods are commonly used to draw feature:
1. Simple Drawing
2. unique value plotting/Multi-field unique value plotting
3. Point density/Multi-field point density
4. Hierarchical Data Rendering
5. Quality chart (pie chart/histogram)
6. rendering by scale
7. Proportional sign Rendering

1. Simple Rendering
Simple rendering is the default rendering of arcengine. When we open a featureclass and create a featurelayer,
If you have not set Renderer for featurelayer, simple rendering is used. Simple rendering of all feature in the entire layer
Display in the same way.
Simple rendering is represented by isimplerenderer in arcengine.
Isimplerenderer is used as follows:
// Assume that the layer is an ifeaturelayer to obtain the igeofeaturelayer
Igeofeaturelayer geolayer = layer as igeofeaturelayer;
// Construct the simplerenderer
Isimplerenderer Renderer = new simplerendererclass ();
Renderer. Description = "simple rendering ";
Renderer. Label = "symbol label ";
// Assume that sym is a symbol corresponding to the geometry type in the layer;
Renderer. symbol = sym;
// Set rendering for the layer. Note that you need to refresh the layer.
Geolayer. Renderer = Renderer;
2. Independent value/Multi-field independent value Rendering
Independent value/Multi-field independent value rendering, determine the symbol based on the data of a certain field of feature or the combination of several fields.
Use the same symbol for feature with the same value or the same combination value. When multiple fields are used
Use delimiters to connect. The field value sequence is the same as that set in Renderer.
The basic usage is as follows:
// Assume that the layer is an ifeaturelayer to obtain the igeofeaturelayer
Igeofeaturelayer geolayer = layer as igeofeaturelayer;
// Construct a uniquevaluerenderer
Iuniquevaluerenderer Renderer = new uniquevaluerendererclass ();
// Assume two fields are used for rendering.
Renderer. fieldcount = 2;
// Assume that the yslx field represents the element type.
// Assume that the ysyt field indicates the actual usage.
Renderer. set_field (0, "yslx ");
Renderer. set_field (1, "ysyt ");
// Use | between fields to connect (default value)
Renderer. fielddelimiter = "| ";
// Set the default symbol
Renderer. defaultsymbol = defaultsymbol;
Renderer. defaultlabel = "default label ";
// Add Value
Renderer. addvalue ("Houses | houses", "Houses", mjsymbol );
Renderer. addvalue ("House | commercial land", "commercial land", sysymbol );
...
// You can also modify the preceding settings through set_symbol, set_heading, and set_value.
Geolayer. Renderer = Renderer.
3. Point density/Multi-field point density
The dot density graph indicates that the number of data is large by hitting on the feature graph. The more dense the vertex, the larger the data volume.
You can also use a dot density chart with multiple fields. The same feature can display several different points.
Note that the dot density chart has a special point:
The dot density chart uses a surface symbol. Some of them need to include the dot symbol.
The interface is used as follows:
Idotdensityrenderer Renderer = new dotdensityrendererclass ();
Irendererfields FLDS = (irendererfields) Renderer;
FLDS. addfield ("mj", "area ");
FLDS. addfield ("rk", "Population ");
Idotdensityfillsymbol ddsym = new dotdensityfillsymbolclass ();
Isymbolarray symarray = (isymbolarray) ddsym;
Symarray. addsymbol (mjsymbol );
Symarray. addsymbol (rksymbol );
Ddsym. Outline = (ilinesymbol) outlinesymbol;
Ddsym. dotsize = 10;
Ddsym. fixedplacement = true;

Renderer. dotdensitysymbol = ddsym;
Renderer. dotvalue = 20;
Renderer. maintainsize = This. m_dotdensityparam. maintainsize;
Igeofeaturelayer geolayer = (igeofeaturelayer) layer;
Geolayer. Renderer = (ifeaturerenderer) Renderer;
4. Hierarchical Data Rendering (using iclassbreaksrenderer)
5. Pie Chart/histogram (using ichartrenderer)
6. rendering by scale (enable iscaledependentrenderer)
7. Proportional sign rendering (using iproportionalsymbolrenderer)
2. Use of legends
Use the ilegendinfo interface. Every Renderer implements this interface, but sometimes this implementation is not easy to use,
You can also implement this interface by yourself. The implementation process is relatively simple.
3. Rendering Layers
Use the ilevelrender interface. This interface can specify the current level (-1) to draw all.
A symbol array is provided. Note that each symbol must specify a level. If this parameter is not specified, the default value is 0.

4. Transparency Control
Transparency control uses the itransparencyrenderer interface. This interface allows you to specify a field to indicate transparency.
Note that the transparency value is between 0--100.
5. Data normalization
Data normalization is represented by the idatanormalization interface. This interface provides several Regular Expression methods.
6. Partial Rendering
Partial rendering is implemented by using idataexclusion. This interface allows filtering statements to filter out unnecessary feature values.
You can also give them special symbols. Control whether to display
7. rotation control
The rotation control is represented by the irotationrenderer interface. This interface requires that the rotation angle field be provided. Rotation is also required
Method.
8. Data Samples
Idatasampling is not used.
9. External join
Itable disptable = (idisplaytable) fealayer). displaytable; // Layer
Itable atttable; // appearance
Imemoryrelationshipclassfactory FAC = new memoryrelationshipclassfactoryclass ();
Irelationshipclass relclass = FAC. Open ("jzmj", (iobjectclass) disptable, "zddjh ",
Iobjectclass) atttable, "g03 ",
"Forward", "backward ",
Esrirelcardinality. esrirelcardinalityonetoone );
Idisplayrelationshipclass disprelclass = fealayer as idisplayrelationshipclass;
Disprelclass. displayrelationshipclass (relclass, esrijointype. esrileftinnerjoin );
10. Statistical analysis
Itablehistogram tablehistogram = new basictablehistogramclass ();
Tablehistogram. Table = (idisplaytable) layer). displaytable;
Tablehistogram. Field = fieldname;
Object valuearray = NULL, freq = NULL;
Ibasichistogram basichistogram = (ibasichistogram) tablehistogram;
Basichistogram. gethistogram (Out valuearray, out freq );
Iclassify classify = NULL;
Int breaknum = 6;
// Classification Method
Switch (classifymethod)
{
Case classifymethodname. lsclassifymethodequalinterval:
{

Required intervalclass eq = new required intervalclass ();
Eq. classify (valuearray, freq, ref breaknum );
Classify = (iclassify) eq;

Break;
}
Case classifymethodname. lsclassifymethodstandarddeviation:
{

Standarddeviationclass SD = new standarddeviationclass ();
Istatisticsresults stat = Histogram as istatisticsresults;
Classify = SD as iclassify;
Classify. sethistogramdata (valuearray, freq );
Ideviationinterval di = SD as ideviationinterval;
Di. deviationinterval = 1;
Di. Mean = Stat. Mean;
Di. standarddev = Stat. standarddeviation;
Classify. classify (ref breaknum );

Break;
}
Case classifymethodname. lsclassifymethodquantile:
{

Quantile qc = new quantileclass ();
QC. classify (valuearray, freq, ref breaknum );
Classify = QC as iclassify;

Break;
}
Case classifymethodname. lsclassifymethodnaturalbreaks:
{

Naturalbreaksclass NB = new naturalbreaksclass ();
NB. classify (valuearray, freq, ref breaknum );
Classify = Nb as iclassify;

Break;
}
Case classifymethodname. lsclassifymethoddefinedinterval:
{
Definedintervalclass di = new definedintervalclass ();
Di. intervalrange = This. m_classbreaksparam. interval;
Di. classify (valuearray, freq, ref breaknum );
Classify = di as iclassify;
Break;
}
Default:
{

Required intervalclass eq = new required intervalclass ();
Eq. classify (valuearray, freq, ref breaknum );
Classify = (iclassify) eq;
Break;

}
}
Object o = classify. classbreaks;
System. array breakarray = O as system. array;
Now breakarray is the statistical data.

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.