REST Endpoint Point in Polygon Demo

One of the most common questions developers get when it comes to geography is "Can you tell me what (census tract, county, congressional district) my point is in?" For the most common geographies, there ARE basic text-based "lookups" for that type of query. But it's not always that straightforward, and often what you want is a "Point in Polygon" query. In other words, given a point - represented by coordinates such as lat/long or x/y, tell me which "area" it falls in. When it comes to really irregular areas such as watersheds (or some heinously gerrymandered congressional districts), this question is not so easy to answer. But if you have a REST endpoint that defines those areas, you can perform a "spatial query" to get the answer relatively easily.

The marker in the map below will stay in the center of the map. As you pan the map across county boundaries, it'll query the county layer in the overlaid map service and give you some results here:

Loading