Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
/ dp-map-renderer Public archive

Renders an SVG representation of a map given a topojson file.

License

Notifications You must be signed in to change notification settings

ONSdigital/dp-map-renderer

Repository files navigation

dp-map-renderer

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)

Endpoints

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

Healthchecking

Currently reported on endpoint /healthcheck. There are no other services consumed, so it will always return OK.

Contributing

See CONTRIBUTING for details.

License

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

About

Renders an SVG representation of a map given a topojson file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •