Renders an SVG representation of a choropleth map given a topojson file and data.
See the exampleResponse for an illustration of the sort of map that can be generated. The testdata folder also includes example requests for both the render and analyse endpoints.
The api is completely described by swagger.yaml - paste the contents of this file into editor.swagger.io for easier reading.
Environment variable | Default | Description |
---|---|---|
BIND_ADDR | :23500 | The host and port to bind to |
CORS_ALLOWED_ORIGINS | * | The allowed origins for CORS requests |
SHUTDOWN_TIMEOUT | 5s | The graceful shutdown timeout (time.Duration format) |
url | Method | Parameter values | Description |
---|---|---|---|
/render/{render_type} | POST | render_type = svg or png |
Renders the (json) data provided in the post body as an html figure with either an svg or png map |
/analyse | POST | Accepts json containing a topojson topology and a string representation of a csv file. Validates that the csv file matches the topology and returns the contents of the csv in json format. Also identifies natural breaks for the choropleth map |
Currently reported on endpoint /healthcheck
. There are no other services consumed, so it will always return OK.
See CONTRIBUTING for details.
Copyright © 2018, Office for National Statistics (https://www.ons.gov.uk)
Released under MIT license, see LICENSE for details.
The transformation of geojson to svg builds on original work by Fabian Prein: geojson2svg