Not very familiar with the necessary GIS concepts so this is a beginner question. From my web app I am querying a GIS REST Service using this query:
require([ "dojo/dom", "dojo/on", "esri/tasks/query", "esri/tasks/QueryTask", "dojo/domReady!" ], function (dom, on, Query, QueryTask) {
var queryTask = new QueryTask("http://gis.something.org/arcgis/rest/services/XXXX/Operational/MapServer/6");
var query = new Query();
query.returnGeometry = false;
query.outFields = [
"DISTRICTID "
];
query.where = "SUBID = '" + SUBJID + "'";
queryTask.execute(query, showResults);
In this scenario I had a subject ID (SUBID) which I used for the query to return which district the subject falls in (i.e. the respective DistrictID). I now want to query the service by street address, rather than by SUBID. Any pointers how to structure the query in this case?
Assia,
So you want to include your street address field in your out fields (most likely) and then change your query.where.
query.outFields = ["*"];
query.where = "ST_ADD LIKE '%" + STADD + "'%";
Thank you, Robert!
Is ST_ADD a universal convention for naming the street address field or will I have to find out what the equivalent of that is in this particular service?
Assia,
That was just an example. You will have to figure out what the field name is in your data (assuming you do have a field with street address info).
Thank you again!
Don't forget to mark this question as answered by clicking on the "Correct Answer" link on the reply that answered your question.