Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prepared geometry wrapper #105

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

add prepared geometry wrapper #105

wants to merge 6 commits into from

Conversation

rafaqz
Copy link
Member

@rafaqz rafaqz commented Apr 12, 2024

Needs tests

Fixes #103

src/prepared.jl Outdated Show resolved Hide resolved
Co-authored-by: Anshul Singhvi <[email protected]>
src/prepared.jl Outdated Show resolved Hide resolved
@asinghvi17
Copy link
Member

What are your thoughts about the preparation interface? We need to be able to take a reliable path for preparations which might have RTree but not MonotoneChain, for example...

@rafaqz
Copy link
Member Author

rafaqz commented Apr 12, 2024

I'm not sure really! I'm hoping that will be easier when there is a concrete PR using it. Probably we will need to make some changes to some of this too.

@asinghvi17 asinghvi17 mentioned this pull request Apr 17, 2024
@asinghvi17 asinghvi17 added the enhancement New feature or request label Apr 20, 2024
@asinghvi17
Copy link
Member

asinghvi17 commented Jul 26, 2024

Sampling could use this - e.g. to_edges could access an EdgeDecomposition preparation, and linestrings could have precomputed per-segment arclength, multipolygons can have precomputed area per polygon, triangulation, etc.

A current list of preparations for #184 would be:

  • EdgeVector: A vector of edges, per geometry.
  • Triangulation: A tuple of (points, faces), per polygon. Multipolygons are at a higher level than this and don't care.
  • SegmentLengths: A vector of length per edge, linestring only.
  • SubpolygonArea: A vector of area per subpolygon, multipolygon only.

I guess each preparation would have a specialized function? Or we can override e.g. area on multipolygons which have the SubpolygonArea preparation.

Not sure how to dispatch on only prepared geoms which have some preparation, nor how to define an order of priority for that dispatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prepared geometry
2 participants