Ariel Larraburu
Ariel Larraburu

Reputation: 459

algorithm like convex hull, but that return the lower area polygon containing all points

I have a spatial software, In a database I have for each street in several cities, the lat/long of each street. And every street belongs to a zone. I'm trying to get polygons for each zone, and to do this, I need an algorithm that give me as result the smallest polygon that covers a number of points. Very similar to convex hull. convex hull is useless because it resolved it like this:

enter image description here

And, what I need is this:

enter image description here

Upvotes: 0

Views: 361

Answers (2)

karakulj
karakulj

Reputation: 123

There is a working npm module for calculating concave hull here: https://www.npmjs.com/package/hull.js

I use it. It's written in javascript and you can use it on server with Node.js.

Upvotes: 0

Ariel Larraburu
Ariel Larraburu

Reputation: 459

I think I have the answer, Concave hull algorithm.

Upvotes: 2

Related Questions