Code Monkey home page Code Monkey logo

Comments (5)

mfherman avatar mfherman commented on September 17, 2024 1

Also, just wanted to give an early thanks for this package! I've done some areal interpolation in R before, but it makes a lot of sense to turn it into a package.

from areal.

chris-prener avatar chris-prener commented on September 17, 2024

Thanks @mfherman!

This might be a bit of an edge case - the only reference I can find to the error from sf::st_cast(), which was the root case, is here.

Your intersection is creating geometry collections, which our test data has not done. Reading between the lines of the sf issue, it seems like you might be creating slivers with the intersection but I didn't verify that. I've added a line to aw_intersect() that gets a version of your code working correctly.

I'm going to leave this open until we merge the PR - we've got a backlog since the package is under CRAN review. What we'll do is wait until we hear back from the initial review. If we have to resubmit, will merge the multipolygon branch before we do.

Otherwise, will merge into master after CRAN acceptance and then submit a patch to CRAN in January.

from areal.

mfherman avatar mfherman commented on September 17, 2024

Thanks, @chris-prener! aw_intersect() on the multipolygon branch is working for my sf objects now.

from areal.

chris-prener avatar chris-prener commented on September 17, 2024

Glad to hear it @mfherman!

from areal.

dblodgett-usgs avatar dblodgett-usgs commented on September 17, 2024

@chris-prener -- I think the fix to this issue might be causing some performance issues when it isn't really needed.

A little back of the envelope profiling of my areal function vs a non-areal function gives me ~9 minutes for areal and ~30 seconds for non-areal. I dug into the function calls I'm making and found that this line is the killer. I also get the warning:

Warning message:
In st_collection_extract.sf(intersection) : x is already of type POLYGON.

Reproduce with: big_test.rda.zip

load("big_test.rda")
int <- areal::aw_intersect(target_polygons, data_source_cells, "area")

I'm not really sure what the consequences of not calling that are or what the best check would be to see if you don't need it... will do some research and get back to you.

from areal.

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.