I'm trying to filter data here, by specific USA state - https://hydro.nationalmap.gov/arcgis/rest/services/nhd/MapServer/12/query
However, I'm not sure how to use the "Input Geometry" field (in which format geometry needs to be).
Could someone send me an example with polygon applied as a one filter AND in Where
there will be "FCODE"=46006
filter as well?

- 11
- 3
1 Answers
For input geometry you need to provide a valid geometry object in JSON format, as specified by ESRI: enter link description here
Within the JSON you can specify type of geometry (point, poly etc) as well as spatial reference in wkid or wkt format.
{
"xmin": -109.55,
"ymin": 25.76,
"xmax": -86.39,
"ymax": 49.94,
"spatialReference": {
"wkid": 4326
}
}
Finally, the ArcGIS REST API documentation explains what other parameters to pass to your HTTP GET verb to specify the 'where' clause.
Here is an example call to your service: https://hydro.nationalmap.gov/arcgis/rest/services/nhd/MapServer/12/query?where=FCODE=46006&geometry={ "xmin": -180, "ymin": -90, "xmax": 180, "ymax": 90, "spatialReference": { "wkid": 4326 } }&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&units=esriSRUnit_Foot&outFields=*&returnGeometry=true&returnTrueCurves=false&returnIdsOnly=false&returnCountOnly=false&f=pjson

- 41
- 3