wpgp / wopr

An R package and Shiny application to provide API access to the WorldPop Open Population Repository (WOPR)
https://apps.worldpop.org/woprVision
GNU General Public License v3.0
36 stars 7 forks source link

woprize is giving me an error #43

Closed wlepbc closed 2 years ago

wlepbc commented 2 years ago

I am trying to get population estimates for areas within Guinea.

And I get an error message back, plus a couple of warnings.

The warnings either refer to an unknown column 'geometry' or 'geom', depending on whether I've renamed geometry to geom or not.

I presume I'm just doing something wrong.

G <- woprize(features = focidg, country = 'GIN', version = '1.0', confidence = 0.95)
Submitting 4 feature(s) to:
  https://api.worldpop.org/v1/wopr/polytotal
Checking status of 36 tasks:
  Error in results[[j]] : subscript out of bounds
In addition: Warning messages:
1: Unknown or uninitialised column: `geometry`.
2: Unknown or uninitialised column: `geometry`.
edarin commented 2 years ago

Would you mind sharing your vector file or at least its structure?

wlepbc commented 2 years ago

Here's a zipped RData file containing focidg (dropped attachment when completed) Can you delete when you're finished with it, please?

edarin commented 2 years ago

Dear wlepbc, I don't have any issue in processing your file. It's true the warning "1: Unknown or uninitialised column: geometry." is returned but it does not affect the results.

I have processed as such to check if any polygon had an issue, but non was found:

results <- list() 

for(i in 1:nrow(focidg)){
  results[[i]] <- wopr::woprize(focidg[i,], 'GIN', '1.0', confidence = 0.95)
}

I can send you the results if you want.

wlepbc commented 2 years ago

Hi,

Thanks so much for your help.

Don't worry about sending me the results, this was just a trial run so I need to work out what days the issue for me.

I'll try updating my version of R, I've been putting it off for while.

Good to know it isn't the sf object.

Cheers, wlepbc

On 6 June 2022 19:02:37 BST, "Édith Darin" @.***> wrote:

Dear wlepbc, I don't have any issue in processing your file. It's true the warning "1: Unknown or uninitialised column: geometry." is returned but it does not affect the results.

I have processed as such to check if any polygon had an issue, but non was found:

results <- list() 

for(i in 1:nrow(focidg)){
 results[[i]] <- wopr::woprize(focidg[i,], 'GIN', '1.0', confidence = 0.95)
}

I can send you the results if you want.

-- Reply to this email directly or view it on GitHub: https://github.com/wpgp/wopr/issues/43#issuecomment-1147729400 You are receiving this because you authored the thread.

Message ID: @.***>

wlepbc commented 2 years ago

So I've updated from R 4.0 to R4.2 this morning, and reinstalled all my packages, and it is now working fine.

Sorry to have wasted your time with this.