Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on the configuration of index.edn #346

Open
loganpowell opened this issue Jul 17, 2021 · 0 comments
Open

Add documentation on the configuration of index.edn #346

loganpowell opened this issue Jul 17, 2021 · 0 comments
Labels
docs documentation

Comments

@loganpowell
Copy link
Member

loganpowell commented Jul 17, 2021

index.edn has a couple of overloaded properties, namely:

The underlying APIs that citysdk abstracts need various configurations in order to be harmonized and merged together:

  1. Tiger WMS services is used for both geocoding lat/lng coordinates as well as composing the needed geographic hierarchy for the stats API (api.census.gov)
  2. GeoJSON API (a REST API built using raw files on github.com) provides files that contain geographic identifiers (GEOIDs),. Sometimes these GEOIDs are broken up into parts (e.g., ST, COUNTY) and sometimes they are nicely combined into a single GEOID under their properties

The way index.edn helps with the maintenance burden of updating the CitySDK - due to the complex differences between both the availability and format of the underlying resources - is to provide a single file that provides the needed paths to the underlying data so that they can be merged together.

A vector (path) is used to qualify the statistics API geographies (for :stats+ calls) when using the WMS geocoders. E.g.:

When given only place: { lat: 20, lng: -30 }, citysdk uses this path to both make the request to Tiger WMS for the correct FIPS codes and compose the correct arguments for the stats API. I.e.:

api.census.gov/data/2019/acs/acs1/get=...&for=place:123&in=state:01

Note that citysdk provided state without user input. This is facilitated by this configuration.

Another path (sometimes identical to that above and sometimes simply [ :GEOID ]) points to the correct properties within the GeoJSON features to enable the results from the stats API to be merged with the GeoJSON

  • if :lookup is a vector: This path is used to configure the WMS and stats API and :id<-json is used to target the properties in the GeoJSON
  • if :lookup is not a vector (e.g., :2010), the :id<-json key from the vintage within the containing geographic scope is used to furnish the WMS configuration.

In either case, the last element on the path (vector) is used here

@loganpowell loganpowell added the docs documentation label Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs documentation
Projects
None yet
Development

No branches or pull requests

1 participant