Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

more than 1 country? #14

Open
onlyjsmith opened this issue Jun 17, 2019 · 4 comments
Open

more than 1 country? #14

onlyjsmith opened this issue Jun 17, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@onlyjsmith
Copy link
Member

onlyjsmith commented Jun 17, 2019

This line looks like it can return more than 1 country if the points are across boundaries. Think this will cause bugs in most functions that use country, expecting it to be a single string.

country = as.character(coords2country(st_coordinates(points))[1])

@onlyjsmith onlyjsmith added the bug Something isn't working label Jun 17, 2019
@HughSt
Copy link
Contributor

HughSt commented Jun 17, 2019

It only works for 1 country. This line gets the country from the 1st coordinate. So if the points span 2 countries, it will only get layers for the country in which the first point lies.

@onlyjsmith
Copy link
Member Author

Ah, right - that's what the [1] does?

So will the bug then be that: points in two countries will only trigger download of data for 1 country, so we'd get nulls/NAs for points in 1 country?

@HughSt
Copy link
Contributor

HughSt commented Jan 23, 2020

Yes I think so. So far, accessing data across country-boundaries hasn't been a priority. Moving to icebox for the moment.

@onlyjsmith
Copy link
Member Author

I've added something to the SPECS.md to explain this (commit 32a0b97). Might help us with debugging at some point!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants