Coder Social home page Coder Social logo

Comments (6)

michaelkirk avatar michaelkirk commented on June 11, 2024

I wanted to clip with an exterior of a Polygon

Sorry, I'm not sure what you mean by this.

But maybe it's helpful to clarify that "1-D geometry" is reinforcing the type signature of the method - it means it takes a LineString as input.

from geo.

wlinna avatar wlinna commented on June 11, 2024

Thanks for the quick response.

if I wanted to clip with an exterior of a Polygon
Sorry, I'm not sure what you mean by this.

Say I have Polygons A and B.
I was thinking of using Polygon::exterior of B, wrap it in a MultiLineString and call something like A.clip(&b_exterior_multilinestr, ...). Would that make sense?

But maybe it's helpful to clarify that "1-D geometry" is reinforcing the type signature of the method - it means it takes a LineString as input.

ls is actually a MultiLineString. Is that also a 1-D geometry? If so, is a Polygon with an interior a 2-D geometry?

from geo.

wlinna avatar wlinna commented on June 11, 2024

No wait.. it's 1-D because it doesn't have thickness or any notion of solidity?
(And thus only one coordinate is needed to specify a point in it.. though I'm not entirely sure how that'd work for a MultiLineString)

from geo.

michaelkirk avatar michaelkirk commented on June 11, 2024

No wait.. it's 1-D because it doesn't have thickness or any notion of solidity?

Exactly.

0-D: Point
1-D: Line/LineString/MultiLineString
2-D: Polygon/MultiPolygon/Rect/Triangle

I was thinking of using Polygon::exterior of B, wrap it in a MultiLineString and call something like A.clip(&b_exterior_multilinestr, ...). Would that make sense?

Maybe? It depends on what you are expecting to happen. Polygon::exterior is 1-dimensional.

So A.clip(&b_exterior_multilinestr, ...) will give you a 1 dimensional clipping - potentially a bunch of disparate line strings.

If that's what you are looking for, then great.

My guess though, is that you are looking for 2-dimensional clipping. Something like https://docs.rs/geo/latest/geo/algorithm/bool_ops/trait.BooleanOps.html

from geo.

wlinna avatar wlinna commented on June 11, 2024

Okay, thank you, this conversation has been very helpful

So A.clip(&b_exterior_multilinestr, ...) will give you a 1 dimensional clipping - potentially a bunch of disparate line strings.
If that's what you are looking for than great.

Yes, that's exactly what I was looking for.

My guess though, is that you are looking for 2-dimensional clipping.
I use those too, and I use them too.

Funnily enough, I find them intuitive as they are. Possibly because they are just simple type signatures (and because they are very common set operations)

I feel that I would have understood clip too if Clip a 1-D geometry with self was removed from the docstring. The reason is that I don't expect free-form comments to tell me something that the type signature does perfectly adequately. At least to me it seems clear that LineStrings in itself is different from Polygons for example. So the sentence made me overthink and question what I could see in the signature. I don't feel that Clip a 1-D geometry with self adds anything that the signature and the next sentence doesn't already express.

That might be just me though

from geo.

michaelkirk avatar michaelkirk commented on June 11, 2024

Thanks for explaining. Feel free to open a pull request if you think you can improve the documentation.

from geo.

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.