GP Statics

Subject Using ESRI.ArcGIS.AnalysisTools.Statistics 
Author capton siluvairajan 
Date Jun 16, 2008 
Message Hi,
I am trying to use the Geoprocessor -> Analysis Tools -> Statistics Tool from C# and find that the documentation is not helping me.
What are the parameters for the Statistics tool ?

Does anyone have any samples ?

any help would be appreciated.

thanks, 
 
ITable inTbl = clsGDBWorkSpaceManager.openTable("Table1", pws);
ITable outTbl = clsGDBWorkSpaceManager.openTable("Table2", pws);
IField f1 = inTbl.Fields.get_Field(inTbl.FindField("F1"));
IField f2 = inTbl.Fields.get_Field(inTbl.FindField("F2"));     

Geoprocessor GP = new Geoprocessor();

ESRI.ArcGIS.AnalysisTools.Statistics s = new Statistics();

s.in_table = inTbl;
s.out_table = outTbl;
			 

s.case_field = f1;

s.statistics_fields = "Sum.F2";
			
			  

GP.Execute(s, null);
 
  Capton Siluvairajan
GIS Programmer
Cambridge Systematics, Inc.
2457 Care Drive, Suite 101
Tallahassee, FL 32308
csiluvairajan@camsys.com
LinkedIn : http://www.linkedin.com/pub/capton-siluvairajan/9/248/83
 
  untitled.bmp (opens in new window)
 
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Using ESRI.ArcGIS.AnalysisTools.Statistics 
Author Ken Buja 
Date Jun 16, 2008 
Message I agree that the Geoprocessing documentation leaves something to be desired. Usually, I use the Toolbox to create the type of process I intend to code and get the parameters from the dialog box. In the case of Statistics, this is the line that one test executes:

Executing (Statistics_1): Statistics D:\Data\testing\Buja\Export_Output.dbf D:\Data\testing\Buja\Export_Output_Statistics.dbf "HAUL SUM" #

I was getting the Sum of the field Haul, so in your case, try

s.statistics_fields = "F2 Sum"; 
  Ken Buja

National Oceanic and Atmospheric Administration
1305 East-West Highway, N/SCI1
Silver Spring MD 20910-3281
(301) 713-3028 x140
ken.buja@noaa.gov 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Using ESRI.ArcGIS.AnalysisTools.Statistics 
Author capton siluvairajan 
Date Jun 16, 2008 
Message Thanks a lot Ken.

With your suggestion i was able to get it running.

IWorkspace pws = clsGDBWorkSpaceManager.openGDBWorkSpace(clsGDBWorkSpaceManager.GDBType.FileGDB, pth, fileNm, 0);

ITable inTbl = clsGDBWorkSpaceManager.openTable("Table1", pws);
//ITable outTbl = clsGDBWorkSpaceManager.openTable("Table2", pws);
IField f1 = inTbl.Fields.get_Field(inTbl.FindField("F1"));
IField f2 = inTbl.Fields.get_Field(inTbl.FindField("F2"));

Geoprocessor GP = new Geoprocessor();

ESRI.ArcGIS.AnalysisTools.Statistics s = new Statistics();

s.in_table = @"D:\FDOTwork\QCEW_DataWork\Apps\Data\q1.gdb\Table1";
s.out_table = @"D:\FDOTwork\QCEW_DataWork\Apps\Data\q1.gdb\Table1_Statistics";

s.case_field = "F1";

s.statistics_fields = "F2 SUM;F3 SUM";
GP.Execute(s, null);

No where in their(ESRI) poor quality documentation, did they mention the input param "object inoutTableName" is actually a string or the field names should be semi colon separated. How are we supposed to know all these ?


anyway thanks for taking the time to help me out.

capton.
 
  Capton Siluvairajan
GIS Programmer
Cambridge Systematics, Inc.
2457 Care Drive, Suite 101
Tallahassee, FL 32308
csiluvairajan@camsys.com
LinkedIn : http://www.linkedin.com/pub/capton-siluvairajan/9/248/83
 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Using ESRI.ArcGIS.AnalysisTools.Statistics 
Author capton siluvairajan 
Date Jun 19, 2008 
Message Ken, can yu please help me with this one also.

I just posted under ArcObjects General section with subject line

"Geoprocessing - Geocoding using c# doesn't work"

if you have time, please take a look at it. thanks in advance for you help.

- capton. 
  Capton Siluvairajan
GIS Programmer
Cambridge Systematics, Inc.
2457 Care Drive, Suite 101
Tallahassee, FL 32308
csiluvairajan@camsys.com
LinkedIn : http://www.linkedin.com/pub/capton-siluvairajan/9/248/83
本文引用地址: http://www.sciencenet.cn/m/user_content.aspx?id=253619
原文地址:https://www.cnblogs.com/zhangjun1130/p/1684148.html