Comments (6)
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.
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.
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.
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.
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.
Thanks for explaining. Feel free to open a pull request if you think you can improve the documentation.
from geo.
Related Issues (20)
- Helper for converting between Mercator and Euclidean coordinates HOT 1
- getting one of the closest point for `Closest::Indeterminate` HOT 2
- Consider applying for support from OSGEO or OGC?
- Algorithm to partition a polygon (convex decomposition) using the Hertel-Mehlhorn algorithm HOT 1
- Documentation for monotone-decomposition
- Panic on clip operation HOT 2
- Add a buffer feature like turfjs HOT 1
- panic on polygon union HOT 1
- Replace HaversineIntermediate with HaversineLineInterpolatePoint and HaversineDensify HOT 2
- Segementize LineString into arbitrary lengths. HOT 4
- performance for multipolygon contains much worse than for geos HOT 15
- Note availability of rstar spatial index early in docs HOT 1
- Merge geo-types and geo crate HOT 5
- BooleanOps panic in `Snake::into_ring`
- Boolean difference causes panic: `segment not found` HOT 6
- Enhance SpadeTriangulation API
- Semantics for AffineTransform composition is reversed HOT 5
- `bounding_rect` comsume a lot of cpu?? HOT 23
- Boolean ops should be available between differing geometry types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geo.