Comments (2)
it might be possible to do something similar still.
Since Deref will be applied recursively, doesn't this leave us at the same place as you were trying to avoid, mentioned here:
this isn't a good idea since we would also re-expose a lot of other methods from Vec
I confess I am kind of a Deref
coward. It's useful to work around the "Orphan Rule" and for translating between Rust's zoo of smart pointers, but it has somewhat far reaching consequences, so I try to avoid it.
For example, it's harder to find methods in the documentation when they are gained via Deref, and it potentially adds a lot of API surface that you're committing to.
We're talking about 4 collections, right? MultiPoint
, MultiLineString
, MultiPolygon
, and GeometryCollection
.
As a more cowardly alternative, I'd be happy to audit and implement consistent "collection" methods on these 4 types. It could be consolidated into a private macro_rule if there is concern about consistency of implementation.
from geo.
Since Deref will be applied recursively, doesn't this leave us at the same place as you were trying to avoid, mentioned here
Woops, yes. I even tried out other behavior in a playground but forgot that it traverses further down the references if a method is missing š
For example, it's harder to find methods in the documentation when they are gained via Deref, and it potentially adds a lot of API surface that you're committing to.
Makes total sense. I understand and now also share your concerns! Especially because my original idea isn't working as expected and probably won't work like that anyways
As a more cowardly alternative, I'd be happy to audit and implement consistent "collection" methods on these 4 types. It could be consolidated into a private macro_rule if there is concern about consistency of implementation.
That's definitely something I would be fine with. The only other approach we would probably need to evaluate then is something like a GeoCollection
trait.
from geo.
Related Issues (20)
- 3D (3-dimensional) data types HOT 2
- Rhumb destinations do not wrap angles after the first pole intersection HOT 8
- GeodesicDestination produces cyclcically incosistent results HOT 5
- Expose fields in AffineTransform struct (or have a way to access the internal values)? HOT 4
- st_makeline function HOT 2
- 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
- Iām confused about the clip API. Could the operations be more clearly documented? HOT 6
- 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 14
- 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`
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.