Skip to content

Instantly share code, notes, and snippets.

@aborruso
Created December 29, 2017 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aborruso/17024eae6c5fd1f619ad8577f08f1ecd to your computer and use it in GitHub Desktop.
Save aborruso/17024eae6c5fd1f619ad8577f08f1ecd to your computer and use it in GitHub Desktop.
#!/bin/bash
### requirements
# jq https://stedolan.github.io/jq/
# csvkit https://csvkit.readthedocs.io/en/1.0.2/index.html
### requirements
# download the json
curl "https://search.worldbank.org/api/v2/projects?format=json&countryshortname_exact=India&source=IBRD&kw=N&rows=1" | \
# extract the locations
jq ".projects.P146936.locations" | \
# convert in csv and then in geojson
in2csv -I -f json | csvjson --lat latitude --lon longitude | \
jq .
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment