Using C # and AE to call GP tools

Source: Internet
Author: User

Transferred from the original language using C # and AE call GP tools

First, it is necessary to identify what tools you need to call arctoolbox and what functions to implement. Third, write command or tool tools and write your own functional tools.

1) Create a project first. 3) define the name of the tool and other information  
 PublicKriging () {Base. M_category ="Gptools"; Base. m_caption ="Krugin interpolation"; Base. M_message ="Krugin interpolation"; Base. M_tooltip ="Krugin interpolation"; Base. M_name ="Kriging"; Try   {       stringBitmapresourcename = GetType (). Name +". bmp"; Base. M_bitmap =NewBitmap (GetType (), bitmapresourcename); }   Catch(Exception ex) {System.Diagnostics.Trace.WriteLine (ex). Message,"Invalid Bitmap"); }} Public Override voidOnClick () {geoprocessor GP=Newgeoprocessor (); ESRI. ArcGIS.Analyst3DTools.Kriging pkriging=NewKriging (); Pkriging.in_point_features=@"e:\ sea level pressure. SHP"; Pkriging.z_field="PSLV"; Pkriging.out_surface_raster=@"e:\\krigingnew"; Pkriging.semivariogram_props="Spherical"; Gp. Execute (pkriging,NULL);}5Run the program, call it in ArcMap and try it, and it's quite successful. As follows: The extraction tool can also call the GP tool, the code is as follows: Geoprocessor GP=Newgeoprocessor (); ESRI. ArcGIS.SpatialAnalystTools.ExtractByMask Pextractbymask=Newpextractbymask ();p extractbymask.in_raster=@"C:\map\grid\dqjsl";p Extractbymask.in_mask_data=@"C:\map\XZJQ_ShiJi_R";p Extractbymask.out_raster=@"C:\map\clipresult"; Commonclass.runtool (GP, Pextractbymask,NULL);
6) Other methods to call GP tools are similar, very convenient method.

Using C # and AE to call GP tools

Related Article

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.