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

Fix segmentReduce & segmentEach @turf/meta #968

Merged
merged 1 commit into from
Sep 26, 2017
Merged

Conversation

DenisCarriere
Copy link
Member

@DenisCarriere DenisCarriere commented Sep 26, 2017

Fix segmentReduce & segmentEach @turf/meta

Was using segmentReduce and it didn't return anything in the callback, looks like #959 had do something with it.

Going to attempt a patch release for @turf/meta 🤞

const geojson = featureCollection([
    point([0, 1]), // ignored
    lineString([[0, 0], [2, 2], [4, 4]]),
    polygon([[[5, 5], [0, 0], [2, 2], [4, 4], [5, 5]]]),
    point([0, 1]), // ignored
    multiLineString([
        [[0, 0], [2, 2], [4, 4]],
        [[0, 0], [2, 2], [4, 4]]
    ])
]);
segmentEach(geojson, (segment, featureIndex, featureSubIndex, segmentIndex) => {
  //=featureIndexes => [1, 1, 2, 2, 2, 2, 4, 4, 4, 4]
  //=featureSubIndexes => [0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
  //=segmentIndexes => [0, 1, 0, 1, 2, 3, 0, 1, 0, 1]
});

It's previous state wasn't usable, so I highly doubt this would "break" anyone's code since I personally wasn't able to use the index numbers properly before this fix.

@DenisCarriere DenisCarriere added this to the 4.8.0 milestone Sep 26, 2017
@DenisCarriere DenisCarriere self-assigned this Sep 26, 2017
@DenisCarriere DenisCarriere merged commit 77b97ac into master Sep 26, 2017
@DenisCarriere DenisCarriere deleted the segmentReduce-fix branch September 26, 2017 00:19
@DenisCarriere
Copy link
Member Author

image

Damn those early merges 🤔 Might want to disable that...

DenisCarriere added a commit that referenced this pull request Sep 26, 2017
@DenisCarriere DenisCarriere modified the milestones: 4.8.0, 5.0.0 Sep 29, 2017
@DenisCarriere DenisCarriere mentioned this pull request Nov 9, 2017
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant