question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: iterate over flattened features

See original GitHub issue

Turf has a flatten method that creates a feature collection. It would be helpful to have a flattenEach method that traverses them with a callback without allocating them and consuming memory. I can submit a PR if there is interest in this feature.

Note, this would likely introduce helpers as a dependency. The helpers module in turn has no dependencies. So, this shouldn’t be a problem unless it is desired to keep all these low level modules free of any dependencies.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DenisCarrierecommented, May 1, 2017

👍 Sounds like a plan! I completely agree that @turf/flatten can be simplified.

@dpmcmlxxvi Feel free to send a PR to the @turf/meta module with your proposed solution, looking forward to it!

0reactions
dpmcmlxxvicommented, May 8, 2017

I still plan on updating @turf/flatten with new flattenEach. Just need to find some free cycles to get back to it soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

One liner to flatten nested object - javascript - Stack Overflow
Summary: recursively create an array of one-property objects, then combine them all with Object.assign . This uses ES6 features including Object.assign or the ......
Read more >
ee.FeatureCollection.iterate - Earth Engine - Google Developers
Use "iterate" to cumulatively sum monthly precipitation over the year with // the above defined "cumsum" function. Note that the feature ...
Read more >
4. Iterators and Generators - Python Cookbook, 3rd ... - O'Reilly
Iteration is one of Python's strongest features. At a high level, you might simply view iteration as a way to process items in...
Read more >
arcpy - Iterate through features to use selection as input for ...
I need to iterate through each of the features of a feature class successively to use each one as the mask to extract...
Read more >
Flatten.jl - JuliaHub
It also allows access to solvers and optimisers that require flat lists of ... Dont return Bar or iterate over Bar fields julia>...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found