Excute ServiceFeatureTable.QueryFeatureAsync Catch Exception

587
8
08-21-2017 06:00 AM
xiaoguangyan
New Contributor III

Hi, when I excute the below codes, somethimes it will catch the "Invalid URI: URI string too long" exception.

QueryParameters queryParams = new QueryParameters()
{
WhereClause="name like '%"+ (stateName.ToUpper()) + "%'",

Geometry=searchGeometry
};

// Query the feature table
FeatureQueryResult queryResult = await _featureTable.QueryFeaturesAsync(queryParams);

I don't konw this is because there is something wrong with my input geometry or some else? 

Tags (1)
8 Replies
dotMorten_esri
Esri Frequent Contributor

In order to reproduce, what's the 'stateName' value, and could you share the Geometry as Json? (searchGeometry.ToJson())

Also which version of the ArcGIS Runtime are you using?

0 Kudos
xiaoguangyan
New Contributor III

Hi, sorry, actually I want to query a point ServiceFeatureTable within a polygon geometry, my codes like below, Geometry Jsons are attached

var queryParameters = new QueryParameters
{
Geometry = bufferGeometry,
SpatialRelationship = SpatialRelationship.Intersects,
//MaxFeatures = 50
};

FeatureQueryResult queryResult = await _featureTable.QueryFeaturesAsync(queryParameters);

it will catch the "Invalid URI: URI string too long" exception.

0 Kudos
xiaoguangyan
New Contributor III

I am using the ArcGIS Runtime 100.1

0 Kudos
RussellSchwab
New Contributor II

Has there been any resolution for this?  I have the same problem with Runtime 100.2.  I'm sure it has to do with the complexity of the query geometry - the query runs fine with a simple geometry, but I get the "URI string too long" error with a complex geometry.

0 Kudos
SalieghAziz
New Contributor II

Morten Nielsen‌ I am having the same issue. In Runtime 10.2.x, if my map service has a limit of 1,000 features, that 1k will be returned, but when it has a max return record count of 50k, I get back zero results.

I now decided to test against 100.4, and I get the same exception mentioned above. The size of the shape does not seem to be the problem. My original shape has 900+ rings and this fails. When I attempt an overlap with the extent of this complex shape, I get back results the 50k max.

I am happy to share the service I am testing against, as well as the geometry in question, but this will need to be in a private forum due to it being sensitive data.

0 Kudos
xiaoguangyan
New Contributor III

Hi, Saliegh,

 Yes, I remember that if the input geometry has too much rings it would get exception

0 Kudos
SalieghAziz
New Contributor II

Hi xiaoguang yan

How did you resolve the issue?

0 Kudos
xiaoguangyan
New Contributor III

Hi  Saliegh,

 I  created a custom gp tool to solve this 

0 Kudos