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.

Add option to voronoi to retain properties

See original GitHub issue

So I have a FeatureCollection with (among other data):

geometry: { type: "Point", coordinates: […] },
properties: { id, name ... }

However, when I do voronoiPolygons = turf.voronoi(featureCollection), I find that every Feature in voronoiPolygons has empty properties:

geometry: { type: "Polygon", coordinates: […] }
properties: {  }

​​​Is it possible to propagate the Features properties to the polygons generated by this method?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
andrewharveycommented, Mar 9, 2022

I actually think this should be the default behaviour and we don’t need an extra option. Other operations in turf retain the properties (eg transformTranslate). If you don’t want the properties on the polygons you can either clear them from the points before you pass to voronoi or after you get the results back.

2reactions
stevagecommented, Aug 7, 2018

Ok, I have confirmed that feature order is preserved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create Voronoi regions with Geospatial data in Python
To create Voronoi diagrams, we are going to use several libraries, ... Points and some other attributes like the county, post address, etc....
Read more >
Procedural Nodes (part 34) - Voronoi in Blender - YouTube
This video took a long time to make, I hope it is helpful to you!Blend file link - https://gum.co/EkjLaAlso free on patreon ...
Read more >
qvoronoi -- Voronoi diagram
Qhull outputs the Voronoi vertices for each Voronoi region. With option 'Fv', it lists all ridges of the Voronoi diagram with the corresponding...
Read more >
Get point associated with Voronoi region (scipy.spatial.Voronoi)
For your first question: The issue is that there are N+1 regions (polygons) defined for the N points, and I'm not sure what...
Read more >
VoronoiDiagrammer
Note: If a Voronoi diagram is to be made from points with elevations, and you want to add additional breakline and tolerance options,...
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