Geographic Information Systems Asked by Saurye on January 31, 2021
I’m working on a website with a Cesium map, and I’m using turf.js for geo calculations.
I need to find a way to merge a large set of points on the map (with a fixed distance between them) to polygons, by a certain property.
For example, here is a set of points, with two different properties (marked red and orange):
And the desired output should be something like this:
The way I tried to approach this is by transforming each point into a square, and then use turf’s union on all squares that have the same property. This produced the second image above.
The problem with this solution is that I’m getting a large number of points (can be around 100K) and performing the union on them can sometimes take a very long time (up to 2 minutes), and I need to find a more performance efficient way of doing this.
The solution turned out to be rather simple. I used the concave algorithm on all points that have the same property (in my case I used turf.concave), and it returned the desired polygons.
Answered by Saurye on January 31, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP