Select to view content in your preferred language

Rest API returns No Results When Should Intersect

721
1
06-24-2019 11:22 AM
NoahHuntington2
Emerging Contributor

I can download statewide NY senate districts using ...

https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_Current/MapServer/56/query?wh...

When I query lat/lng against the api... I get zero results. 

https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_Current/MapServer/56/query?wh...

But when I map the statewide dataset and map the lat/lng I can see I should have an intersect.  Can someone tell me why this intersect returns no results when the point falls within zone on the map??? 

0 Kudos
1 Reply
Egge-Jan_Pollé
MVP Regular Contributor

Hi Noah Huntington,

Yeah, got it: you forgot to specify the Input Spatial reference.

The Spatial Reference of the TIGERweb data is 102100  (3857), which is Web Mercator, and the Input Geometry, your point, is in WGS84 (4326). When the input spatial reference differs from the one of the dataset being queried, you have to specify it.

So, with the addition of inSR=4326 your query should (and does) work. The query below returns one polygon with the name "State Senate District 44".

https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_Current/MapServer/56/query?wh...  

Does this solve your issue?

Cheers,

Egge-Jan

0 Kudos