Obtaining traffic count data using arcgis for Python

399
2
01-03-2022 03:36 AM
Wahab_Riaz11
New Contributor

I'm trying to obtain traffic count data surrounding specific addresses. The documentation for this function is very vague as to what it needs as an input. This is an example of what I am trying right now, with no success.

from arcgis import gis, geoenrichment, summarize_within

bufferedArea = geoenrichment.BufferStudyArea(
    area='5030 Antelope Rd, Antelope, CA 95843',
    radii=[2], 
    units='miles', 
    overlap=False, 
    travel_mode=False)

summarize_within(bufferedArea, 
                 'traffic counts', 
                  gis=my_gis # my_gis is what allows access to the arcgis paid features)

The error I get when trying to run this just says 'Job Failed' which is also not helpful. I can't be the only person in the world that has wanted to retrieve this data and does NOT want to use arcgis online to do it. Anyone able to provide some insight here?

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor
0 Kudos
jcarlson
MVP Honored Contributor

I think the issue here is that summarize within is meant to work with two layers or features.

Your buffered area, on the other hand, is a geoenrichment feature. That module of the API is meant to work with Esri Demographics datasets, which you can browse here. Note that "traffic" is not considered a demographic or spending attribute.

You'll need to convert your address string to a true point feature, then use the API's geometry functions to buffer out from it, then use that as your input area.

- Josh Carlson
Kendall County GIS
0 Kudos