ArcGIS API for Android case 11

Source: Internet
Author: User
Element Recognition

Element Recognition is the identify in ArcGIS. The difference between it and the preceding query is that it can perform space Filtering for multiple layers and specify a certain degree of tolerance. The feature of Element Recognition is used in the "highlightfeatures" example of ArcGIS Android API. Let's first run this example:

Figure 28 Map Service Element Recognition

The implementation of this function is very similar to that of querytask, but the called object is identifytask. Let's take a brief look at the implementation of the Code:

Identifyparameters inputparameters =NewIdentifyparameters ();

Inputparameters. setgeometry (pointclicked );

Inputparameters. seturl ("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services
/PublicSafety/publicsafetybasemap/mapserver/identify ");

Inputparameters. setlayers (New Int[] {Layerindexes [selectedlayerindex]});

Inputparameters. setmapextent (mapview. getextent ());

Inputparameters. setdpi (96 );

Inputparameters. setmapheight (mapview. getheight ());

Inputparameters. setmapwidth (mapview. getwidth ());

Inputparameters. settolerance (10 );

FinalIdentifytask identifyaction =NewIdentifytask (inputparameters );

Identifyresult [] Results = identifyaction.exe cute ();

From the code, we can see that the use of the identify function is almost the same as that of all other ArcGIS Server APIs, just like meeting an old friend. The most important parameter to be specified for identify is the included layers and tolerances, which are implemented using the setlayers and settolerance methods respectively. In this way, the ArcGIS Android API knows that the geometric objects to be queried need to be buffered according to the tolerances, and then perform spatial queries in the preceding layers. Finally, the results are summarized and returned to the client.

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.