Identify task returning extra results

3193
3
Jump to solution
05-11-2016 02:23 PM
JillianStanford
Occasional Contributor III

Hi,

I'm having an issue where the identify task seems to be returning records for layers that I have not specified. Sometimes it will return records for the same layer twice.

My request looks like this: //[server_name]/arcgis/rest/services/[service_name]/MapServer/identify?geometry={"x":-9857097.368979331,"y":5159521.918742495,"spatialReference":{"wkid":102100}}&geometryType=esriGeometryPoint&sr=102100&layers=visible:5,139,22,135,133,24,25,28,141,73,115&layerDefs=&time=&layerTimeOptions=&tolerance=5&mapExtent={"xmin":-9912437.77745782,"ymin":5112742.457431949,"xmax":-9766901.675602788,"ymax":5190861.1003394285,"spatialReference":{"wkid":102100}}&imageDisplay=952,511,96&returnGeometry=true

So, I'm requesting layers 5,139,22,135,133,24,25,28,141,73,115 only.

But my results look like this (attributes and geometry removed for brevity):

{

    "results": [{

        "layerId": 139,

        "layerName": "2016 TIP Points"

    }, {

        "layerId": 6,

        "layerName": " 2013 TIP Points"

    }, {

        "layerId": 139,

        "layerName": "2016 TIP Points"

    }, {

        "layerId": 73,

        "layerName": "Road Jurisdiction"

    }, {

        "layerId": 73,

        "layerName": "Road Jurisdiction"

    }, {

        "layerId": 115,

        "layerName": "County"

    }]

}

So, why am I getting results for layer 6 and layer 139 and 73 twice (there is only one feature there)? If I identify at a different location I get a different set of extra layers being queried.

Any ideas? Am I not using the Layers parameter correctly?

Thanks!

Jill

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Are any of the layers you're requesting a group layer instead of an actual data layer? Including the group layer will give you a return with features from all of its members, not just the ones you specify.

View solution in original post

3 Replies
FC_Basson
MVP Regular Contributor

That's weird. What server version are you using? 

Does it make any difference is you change the identify layers order to be sequential and not in the order that you are specifying it? Or set the tolerance to zero?

If your feature class does indeed have multiple features at the identify location, you can always "clean" your results by just taking the first result for the specified layer.

KenBuja
MVP Esteemed Contributor

Are any of the layers you're requesting a group layer instead of an actual data layer? Including the group layer will give you a return with features from all of its members, not just the ones you specify.

JillianStanford
Occasional Contributor III

Thank you for the replies!

Ken, you are right. There are some group layers in there and when I remove them I don't get the extra results. I don't see this referenced anywhere in the help.

Thanks again!

Jill

0 Kudos