I am trying to populate a GeoJSON layer of blockgroups in Leaflet with attribute data pulled live from the Census API.
My GeoJSON has the full FIPS code for the blockgroups as an attribute. That is, each feature has the concatenation of State, County, Tract, and Blockgroup FIPS codes.
An example blockgroup FIPS:
Massachusetts (FIPS: 25), Suffolk County (FIPS: 025), Tract 07010, Blockgroup 3 renders as 25025070103.
I would like to be able to make a request that gets attribute data for all the visible blockgroups at once, by passing a list of these blockgroup FIPS codes. Because the FIPS code is fixed-length, the API should understand what geometry I'm requesting, at least within the State-County-Tract-Blockgroup-Block pipeline.
However, the Census API documentation requires that superior geometries be specified, at least at the county level. However, if my layer crosses counties or states, I have to gather all of my blockgroup IDs, sort them, split them into different requests by states and/or counties, issue the requests sequentially, then add the data as it comes in.
The example from above, albeit a small one, splits into:
Is there a way to issue a request with just tract/blockgroup/block FIPS codes? If not, could one be implemented?