Skip to content

Conversation

@fentas
Copy link

@fentas fentas commented Nov 2, 2015

Hey there,
I found your repo and this source of data
https://data.hdx.rwlabs.org/dataset/bounding-boxes-for-countries
( source: https://en.wikipedia.org/wiki/User:The_Anome/country_bounding_boxes )

I wrote a little wrapper to merge the data.
https://github.com/fentas/country-data-bounds

Pull Request as a result of this.
Adding "bounds" field as array with [ longmin latmin longmax latmax ].

Hope this helps as you mentioned it in Possible future additions.

@fentas
Copy link
Author

fentas commented Nov 2, 2015

I found a better source for bounding box.
https://pypi.python.org/pypi/country-bounding-boxes/0.2.3

I merged the data as follows:

  • if there are no subunits the field bounds is a single array with [lon1, lat1, lon2, lat2]
  • if there are subunits the field subunits will include all subunits + bounds is a multi array for each subunit (in order)

Within the country csv I separated the multi array with the char ';'.

@evdb
Copy link
Member

evdb commented Nov 13, 2015

This would be great to add, thank you.

A few thoughts, what do you think:

  • perhaps the bounds data should be present in another csv, perhaps with columns alpha3,bounds,subunit and one row per subunit (so GB would get 4 rows).
  • add some methods that let people search for countries by providing a coordinate, like the python module does.
  • Clarify what lon1, lat1, lon2, lat2 means. I'd prefer something like west_bound,north_bound,east_bound,south_bound so it is clear what each one is (that order may well be wrong).

Thanks again :)

@niftylettuce
Copy link
Contributor

@fentas did you see @evdb comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants