Created
December 29, 2017 19:15
-
-
Save aborruso/17024eae6c5fd1f619ad8577f08f1ecd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment