Feature request: iterate over flattened features
See original GitHub issueTurf 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:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
👍 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!I still plan on updating
@turf/flatten
with newflattenEach
. Just need to find some free cycles to get back to it soon.