Giter Site home page Giter Site logo

class error in wdpa_clean about wdpar HOT 13 CLOSED

prioritizr avatar prioritizr commented on May 18, 2024
class error in wdpa_clean

from wdpar.

Comments (13)

jeffreyhanson avatar jeffreyhanson commented on May 18, 2024 1

Ok - I've just pushed a new version to GitHub that works for Somalia. Thanks for the reminder!

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

Are you @jeffreyhanson around at the sri2020.org conference? Would be great meeting you.

from wdpar.

jeffreyhanson avatar jeffreyhanson commented on May 18, 2024

Hmm - that's strange. Could you please post a reproducible example showing this? Are you using as(x, "sf") to convert the sp class objects to sf class objects before using wdpa_clean?

No, I'm not attending that conference unfortunately - it looks pretty interesting! Yeah - it would be great to catch up. I'm based in Palmerston North in New Zealand - I don't suppose you're travelling to New Zealand while you're in the region?

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

Well no I didnt convert the WDPA from sp to sf, I read the WDPA with wdpar:

wdpa <- wdpa_read("~/WDPA_Feb2020-shapefile.zip")
wdpa <- wdpa[-which(wdpa$MARINE == "2"),]
wdpa <- wdpa[-which(wdpa$ISO3 == "ABNJ"),]
wdpa_som <- wdpa[which(wdpa$ISO3 == "SOM"),]
wdpa_som <- wdpa_clean(wdpa_som)

Bildschirmfoto 2020-02-19 um 10 30 41

(sorry it is in German, but the error remains the same)

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

update: I now tried to clean SOM with the development version of wdpar – it worked. so in case you dont want to follow up on the origin of the error, you may close the issue.

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

its your go to close it in case you are good to go ;-)

from wdpar.

jeffreyhanson avatar jeffreyhanson commented on May 18, 2024

Great - glad to hear it's working. I'll close this issue now then. In the future, if you feel that you've solved an issue that you've opened, please feel free to close it yourself :)

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

Strange... with a changed precision, the error comes up again. Would be great if you could have a look at it.

Error in st_cast_sfc_default(x) : list item(s) not of class sfg

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

So this class error still is the bottleneck in my progress...

from wdpar.

jeffreyhanson avatar jeffreyhanson commented on May 18, 2024

Per #22, could you please post a complete reproducible example showing the issue you're experiencing?

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

Hi – sorry for not replying yet. You can find the reproducible example above. However, it does not pop up always, I have no clue why. Did you change anything in the development version that could have lead to fixing the class error?

from wdpar.

JonasGeschke avatar JonasGeschke commented on May 18, 2024

Congrats to your paper, very nice reading!

In regard of my work on the WPDA, using wdpar: I am in still in progress cleaning and unioning all countries individually and plan to union them together afterwards.
During the computing, the class error came up again – using the development version of the package. Would be great if you find some time working on this error.

from wdpar.

jeffreyhanson avatar jeffreyhanson commented on May 18, 2024

Thanks! It looks like the issue with Somalia is that all the protected areas are points and they have a REP_AREA of zero - meaning that there are no "spatially valid non-empty" geometries for this country. I'll add in a patch to return an empty result (i.e. sf object with zero rows) for such cases.

from wdpar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.