Howdy!
I'm trying to set a query parameter on a Living Atlas Census Tract layer REST endpoint. I'd like it to return only tracts in Michigan. I can do this within the endpoint query page by setting the Where parameter to STATE_ABBR = 'MI'. However, when I try to add the resulting URL to a map in ArcGIS Pro using Add Data From Path, it gives an error of "Bad syntax, status 400" and returns nothing. If I use the base endpoint URL with no parameters, all US census tracts are returned. If I try to set the parameter in either the layer properties in the map, or the URL, I get nothing as well.
Is there a way to do this? I know I can put a definition query on the layer, but I'd prefer to limit the amount of data returned rather than download all and then filter. Thanks!
ArcGIS Pro 11.2
REST Endpoint: Layer: USA Census Tract Boundaries (ID:0) (arcgis.com)
Solved! Go to Solution.
The Definition Query is the way to do this. Your definition query is literally turned into the "where" parameter in the queries Pro sends to the REST endpoint.
It's not "downloading all" unless you're zoomed out to the full extent of the dataset. You could either add the layer while zoomed in, or else pause the map rendering until the query is in place.
The Definition Query is the way to do this. Your definition query is literally turned into the "where" parameter in the queries Pro sends to the REST endpoint.
It's not "downloading all" unless you're zoomed out to the full extent of the dataset. You could either add the layer while zoomed in, or else pause the map rendering until the query is in place.
Thanks @jcarlson. I didn't know that, thought all data was downloaded and then the definition query kicked in. Good to know. Still don't know why the endpoint query doesn't work. I've done that in Python, although not on Living Atlas layers.
When Pro, and maybe other desktop software, look at a layer URL, they're expecting the service URL with all the metadata and symbology and such, and then it does the legwork of sending requests to the /query URL for you. When you point directly at the query, none of the expected information is there to be handled as a layer.