For developers¶
Everything on the portal has a stable web address. The portal's Developers page has the full list of files and copy-and-paste examples.
Files¶
https://www.ghanaopendata.com/data/reference/gha_admin0.geojson national border
https://www.ghanaopendata.com/data/reference/gha_admin1.geojson 16 regions
https://www.ghanaopendata.com/data/reference/gha_admin2.geojson 260 districts
https://www.ghanaopendata.com/data/reference/gha_admincapitals.geojson
National indicators¶
GET https://www.ghanaopendata.com/api/series?code=NY.GDP.MKTP.KD.ZG&countries=GHA,NGA
Each point is [year, value], with "imf" as a third element where the figure comes from the IMF.
import geopandas as gpd, requests
districts = gpd.read_file("https://www.ghanaopendata.com/data/reference/gha_admin2.geojson")
series = requests.get("https://www.ghanaopendata.com/api/series",
params={"code": "SP.POP.TOTL", "countries": "GHA"}).json()
library(sf); library(jsonlite)
districts <- st_read("https://www.ghanaopendata.com/data/reference/gha_admin2.geojson")
series <- fromJSON("https://www.ghanaopendata.com/api/series?code=SP.POP.TOTL&countries=GHA")
INSTALL spatial; LOAD spatial;
SELECT adm1_name, count(*) FROM ST_Read('https://www.ghanaopendata.com/data/reference/gha_admin2.geojson') GROUP BY 1;
Linking to a map¶
Any page can open the GIS workspace on a given map. The portal's Developers page builds such links; the parameters are layers, eo (a satellite layer), bbox, date and title.
Questions and comments
Ask a question, report a problem with this page or share how you used the data. You need a free GitHub account to post.