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
⚠️ Change coordIndex to last Coordinates Array reference #1168
Comments
This is a bit confusing as to what you're proposing here sorry @DenisCarriere . Anotehr thought is I wonder if rather than sending them through as arguments which is becoming unweildly, whether we construct an object? Perhaps something like meta.coordEach(multiPolyWithHole, (coord, indexes) => {
indexes.featureIndex,
indexes.geometryIndex
etc
}); That might make extending these methods a bit simpler as well in terms of reducing breaking changes etc. |
That is exactly what I'm proposing... via #1099 I just didn't update the JS example here (for now) because this issue only talks about the |
@rowanwins I've updated the comment with: TurfJS v5.x
|
Ah - glad we're on the same track (even if I didn't realise it!) |
Currently Example for a FeatureCollection of LineStringconst lines = lineStrings([
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]
]);
meta.coordEach(lines, indexes => {
//=indexes.coordIndex => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}) Using this proposalmeta.coordEach(lines, indexes => {
//=indexes.coordIndex => [0, 1, 2, 3, 4, 0, 1, 2, 3, 4]
}) |
ah I see now, that's clearer thanks! |
Like #1099, I don't think this is a good idea: it would degrade turf-meta performance just in order to make it 'easier' for core contributors. turf-meta is low-level code: it needs to be fast, not friendly. |
Change
coordIndex
to last Coordinates Array referenceRef: #1099 & #1092 (comment)
TurfJS v5.x
coordEach
TurfJS v6.x
coordEach
Index Breakdowns
MultiPolygon with Holes
Polygon with hole
FeatureCollection of LineStrings
The text was updated successfully, but these errors were encountered: