Arcengine the contour generated by the next tin

Source: Internet
Author: User

It's too late, the source of the direct connection:

    <summary>//Tin Generate contour Line///</summary>//<param name= "Pinterval" > Contour Line Spacing <            /param> public void Tin2contour (string path_,string name_,double pinterval) {//Get tin Itinlayer Ptinlayer = Getlayerbyname (Pscene, Combobox_tin.            Text) as Itinlayer;            ITin Ptin = Ptinlayer.dataset as ITin;            Create contour shape iworkspacefactory PWSFAC = new Shapefileworkspacefactoryclass ();            Ifeatureworkspace pfeaturews = pwsfac.openfromfile (path_, 0) as Ifeatureworkspace;  if (System.IO.File.Exists (path_+ "\ \" +name_+ ". shp")) {System.IO.File.Delete (path_ + "\ \" + name_                + ". shp");                System.IO.File.Delete (path_ + "\" + name_ + ". dbf");            System.IO.File.Delete (path_ + "\" + name_ + ". Shx");            } ifields pfields = Createshapefields (esrigeometrytype.esrigeometrypolyline); Pfeaturews.createfeatureclass (Name_, pfields, NULL, NULL, Esrifeaturetype.esriftsimple, "Shape", null);                     Ifeatureclass Pcontourfeatureclass = Pfeaturews.openfeatureclass (name_);            Generate contour line Itinsurface ptinsurface = Ptin as Itinsurface;            Ptinsurface.contour (0, Pinterval, Pcontourfeatureclass, "Contour", 0);            Add Contour layer Ifeaturelayer Pfeaturelayer = new Featurelayerclass ();                      Pfeaturelayer.featureclass = Pcontourfeatureclass;            Igeofeaturelayer Pgeofeaturelayer = Pfeaturelayer as Igeofeaturelayer;            Pgeofeaturelayer.displayannotation = true;            Pgeofeaturelayer.displayfield = "Contour";            Pgeofeaturelayer.name = Pcontourfeatureclass.aliasname + "_contour";            Set Line style Ilinesymbol Plinesymbol = new Simplelinesymbolclass ();            Plinesymbol.color = Getrgbcolor (32, 47, 247);            Plinesymbol.width = 2; Isimplerenderer Prender = PgeofeatuRelayer.renderer as Isimplerenderer;            Prender.symbol = Plinesymbol as Isymbol;        Pscene.addlayer (Pfeaturelayer as ILayer); }
      #region Create geometry fields///<summary>//Create Geometry fields///</summary>//<param name= "p _esrigeotype "></param>///<returns></returns> public ifields createshapefields (Esrigeo            Metrytype p_esrigeotype) {ifields pfields = new Fieldsclass ();            Ifieldsedit Pfieldsedit = Pfields as Ifieldsedit;            Igeometrydef pgeodef = new Geometrydefclass ();            Igeometrydefedit Pgeodefedit = pgeodef as Igeometrydefedit;            pgeodefedit.geometrytype_2 = P_esrigeotype;            pgeodefedit.spatialreference_2 = (ispatialreference) new Unknowncoordinatesystem ();            Ifield pfld = new Fieldclass ();            Ifieldedit Pfldedit = pfld as Ifieldedit;            pfldedit.name_2 = "shape";            Pfldedit.isnullable_2 = false;            pfldedit.type_2 = Esrifieldtype.esrifieldtypegeometry;            Pfldedit.geometrydef_2 = Pgeodef;         Pfieldsedit.addfield (PFLD);   return pfields; #endregion #region Get layer by name//by name get layer public ILayer getlayerbyname (Iscene scene, St            Ring strlayername) {ILayer pLayer = null; for (int i = 0;i < scene.                layercount;i++) {PLayer = Scene.get_layer (i);                if (Strlayername = = Player.name) {break;        }} return PLayer; } #endregion

The Contour feature description reference Help documentation.

Copyright notice: This article Bo Master original articles, blogs, without consent, may not be reproduced.

Arcengine the contour generated by the next tin

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.