Arcengine element rendering and topic graph Creation

Source: Internet
Author: User
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 plot; 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 the Renderer is not set for featurelayer, simple rendering is used. Simple Rendering uses the same method to display all feature in the entire layer. Simple rendering is represented by isimplerenderer in arcengine. The usage of isimplerenderer is 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, each field value is connected by a delimiter. 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 a point density chart has a special place. The point 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)
Ii. Use of legends
Use the ilegendinfo interface. Every Renderer implements this interface, but sometimes this implementation is not easy to use, so you can implement this interface 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. Then a symbol array is provided. Note that each symbol must specify a level. If not specified, the default value is 0.
Iv. Transparency Control
Transparency control uses the itransparencyrenderer interface. This interface allows you to specify a field. The field value indicates that the transparency value ranges from 0.
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
VII. rotation control
The rotation control is represented by the irotationrenderer interface. This interface requires that the rotation angle field be provided. The rotation method is also required.
8. Data Samples
Idatasampling is not used.
9. External Association
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.