AE Create topology

Source: Internet
Author: User

Turn from original source AE to create topology

/// <summary>///Create a topology/// </summary>/// <param name= "Featureworkspace" >feature set work space</param>/// <param name= "Featuredatasetname" ></param>/// <param name= "Featureclassname" ></param>/// <returns></returns>        PublicItopology create_topology (Ifeatureworkspace featureworkspace,stringFeaturedatasetname,stringFeatureclassname,stringtopologyname) {    Try    {        //1.---Open the feature dataset where the park is located and create a topologyIfeaturedataset Featuredataset =Featureworkspace.openfeaturedataset (featuredatasetname); if(Featuredataset! =NULL) {Itopologycontainer Topologycontainer=(Itopologycontainer) Featuredataset; Itopology topology= Topologycontainer.createtopology ("topo", Topologycontainer.defaultclustertolerance,-1,"");//error in this place .//2.---Add a feature set to the topologyIfeatureclasscontainer Featureclasscontainer =(Ifeatureclasscontainer) Featuredataset; Ifeatureclass Featureclass=Featureclasscontainer.get_classbyname (featureclassname); Topology. AddClass (Featureclass,5,1,1,false);//Parameters:addclass (IClass, double weight, int xyrank, int zrank, Boolean eventnotificationonvalidate). //3.---Back to topology            returntopology; }    }    Catch(Exception ex) {//System.Diagnostics.Debug.WriteLine (ex. ToString ()); MessageBox.Show (ex.    ToString ()); }    return NULL;} Private voidCreatetopbutton_click (Objectsender, EventArgs e) {    //Open the target databaseIworkspace fworkspace = Open_pgdb_workspace ("E:\\topo.mdb"); Ifeatureworkspace FW= Fworkspace asIfeatureworkspace; //Start editingIworkspaceedit Workspaceedit =(Iworkspaceedit) fworkspace; Workspaceedit.startediting (true);    Workspaceedit.starteditoperation (); //calling methods to create a topologyItopology topology = Create_topology (FW,"Hn_ds","HN","Polygon_topo"); //Stop Editingworkspaceedit.stopeditoperation (); Workspaceedit.stopediting (true); if(Topology! =NULL) {MessageBox.Show ("Create the topology successfully! "); }}

Startup edits are added later, and if you do not start editing, you are prompted not to perform the operation.

AE Create topology

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.