Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

A friend and I are currently creating a pretty straight forward LINQ to ESRI library that sends HTTP queries to an ArcGIS MapServer and then parses the JSON response appropriately.

Everything is currently working beautifully except one thing; multiple Where statements. This seems like a simple syntax issue, but I can't seem to get it working, or find out if it's supported. I'm trying to do something like this.

Doesn't Work:

MapServer/22/query?where=MY_FIELD='Whatever'&where=MY_OTHER_FIELD='Whatever'&f=json

Does Work:

MapServer/22/query?where=MY_FIELD='Whatever'&f=json

Also Works:

MapServer/22/query?where=MY_OTHER_FIELD='Whatever'&f=json

I have tried several different syntax versions, but can't seem to get a multiple Where statement to work. This is my primary source for breaking down these queries. If anyone knows the syntax to do this, or knows the source that says it's not possible. I would really appreciate it!

Thank you

share|improve this question
1  
LINQ to ESRI sounds like a great idea, let us know how it goes. –  Seth P. Mar 1 '11 at 6:30

1 Answer 1

up vote 5 down vote accepted

Stick to a single where parameter in your query string. Here's an example of a where clause hitting multiple fields: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/0/query?geometryType=esriGeometryPoint&spatialRel=esriSpatialRelIntersects&where=address%3D%27875+HOWARD+ST%27+or+objectid%3D193510&returnIdsOnly=false&returnGeometry=true&outFields=%27status,objectid%27&f=html

share|improve this answer
1  
+1 The doc says the where arg can be "Any legal SQL where clause operating on the fields in the layer is allowed." though I suspect there are legal SQL where clauses that aren't supported. –  Kirk Kuykendall Feb 28 '11 at 23:38
    
I can see that happening, since ESRI does not support some clauses on simple IQueryFilters... –  George Mar 1 '11 at 0:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.