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 featureIndex & featureSubIndex ordering in @turf/meta #959

Merged
merged 3 commits into from
Sep 22, 2017

Conversation

DenisCarriere
Copy link
Member

@DenisCarriere DenisCarriere commented Sep 22, 2017

Fixed featureIndex & featureSubIndex ordering

  • Add GeometryCollection to Typescript definition
  • Fix featureIndex & featureSubIndex ordering to coordEach & geomEach
  • Refactor test.js
const data = featureCollection([
    point([0, 0]),
    lineString([[1, 1], [2, 2]]),
    multiLineString([[[1, 1], [0, 0]], [[4, 4], [5, 5]]])
]);

meta.coordEach(data, (coord, coordIndex, featureIndex, featureSubIndex) => {
  //=coordIndexes => [0, 1, 2, 3, 4, 5, 6]
  //=featureIndexes => [0, 1, 1, 2, 2, 2, 2]
  //=featureSubIndexes => [0, 0, 0, 0, 0, 1, 1]
});

meta.flattenEach(fcMixed, (feature, featureIndex, featureSubIndex) => {
  //=featureIndexes => [0, 1, 2, 2]
  //=featureSubIndexes => [0, 0, 0, 1]
});

- [x] Add GeometryCollection to Typescript defintion
- [x] Fix featureIndex & featureSubIndex ordering to `coordEach` & `geomEach`
- [x] Refactor test.js
@DenisCarriere DenisCarriere added this to the 4.8.0 milestone Sep 22, 2017
@DenisCarriere DenisCarriere self-assigned this Sep 22, 2017
@DenisCarriere DenisCarriere changed the title Update @turf/meta tests Fix featureIndex & featureSubIndex ordering in @turf/meta Sep 22, 2017
@DenisCarriere DenisCarriere merged commit dd63cc3 into master Sep 22, 2017
@DenisCarriere DenisCarriere deleted the update-meta branch September 22, 2017 06:34
@DenisCarriere DenisCarriere modified the milestones: 4.8.0, 5.0.0 Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant