Select to view content in your preferred language

Set a query parameter on Living Atlas REST endpoint in Pro

306
3
Jump to solution
08-21-2024 02:08 PM
GregKeith
Frequent Contributor

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)

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

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.

- Josh Carlson
Kendall County GIS

View solution in original post

3 Replies
jcarlson
MVP Esteemed Contributor

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.

- Josh Carlson
Kendall County GIS
GregKeith
Frequent Contributor

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.

0 Kudos
jcarlson
MVP Esteemed Contributor

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.

- Josh Carlson
Kendall County GIS