ArcGis gets the unique value of a field in a datasheet

Source: Internet
Author: User

From:http://www.cnblogs.com/3echo/archive/2006/08/16/478094.html

1 / /<summary>

2         ///get unique values for a field of a feature class
3        /// </summary>
4        /// <param name= "Pfeatureclass" >Feature Class</param>
5        /// <param name= "STRFLD" >Specify a field to get a unique value</param>
6        /// <returns>unique value character data</returns>
7list<string> Getuniquevalue (Ifeatureclass pfeatureclass,stringSTRFLD)
8{
9list<string> LST =Newlist<string> ();
Ten//Get ifeaturecursor Cursors
OneIfeaturecursor pcursor = Pfeatureclass.search (NULL,false);
A
-//CoClass Object instance generation
-Idatastatistics PData =NewDatastatisticsclass ();
thePdata.field = STRFLD;
-Pdata.cursor = Pcursor asICursor;
-
-//Enumerate unique values
+IEnumerator Penumvar = pdata.uniquevalues;
-
+//Total Records
AintRecordCount = Pdata.uniquevaluecount;
at
-//character Array
-Penumvar.reset ();
-
- while(Penumvar.movenext ())
-{
inLst. ADD (PEnumVar.Current.ToString ());
-}
to
+returnLst
-}

ArcGis gets the unique value of a field in a datasheet

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.