"Go" in C # arcgisengine development, a layer is filtered to show only those features that match the criteria

Source: Internet
Author: User

Sometimes, we want to have a selective display of the figures on the layer to meet the actual functional requirements.

The Layer Properties filter display is easy to implement as described in the following methods:

1. When the layer is loaded

Private void string sfilter)        {            = (ESRI. ArcGIS.Carto.IFeatureLayerDefinition) Sflyr;              = sfilter;             SMapCtr.ActiveView.Refresh ();        }

2. When the layer is not loaded

PrivateIfeatureclass Getfeatureclass (Iworkspace PWS,stringStabname,stringsattrfilter) {            Try            {                if(PWS = =NULL|| Stabname = =NULL)return NULL; Ifeatureworkspace Pfws= PWS asIfeatureworkspace; Ifeatureclass PFC=NULL; PFC=Pfws.openfeatureclass (stabname); Iquerydef Pquerydef=pfws.createquerydef (); Pquerydef.tables=Stabname; Pquerydef.whereclause=Sattrfilter; IQueryName2 Pqueryname=NewFeaturequerynameclass (); Pqueryname.primarykey=Pfc.oidfieldname; Pqueryname.querydef=Pquerydef; Idataset PDS=(Idataset) Pfws; Iworkspacename Pwsname=(iworkspacename) pds.fullname; Idatasetname Pdsname=(idatasetname) pqueryname; Pdsname.workspacename=Pwsname; Iname PName=(iname) pqueryname; PFC= Pname.open () asIfeatureclass; returnPFC; }            Catch            {                return NULL; }        }

"Go" in C # arcgisengine development, a layer is filtered to show only those features that match the criteria

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.