Turfjs / turf-buffer

Buffers a point, linestring, or polygon Feature/FeatureCollection to a given radius. Units supported are miles, kilometers, and degrees.
MIT License
22 stars 27 forks source link

geodesic polygon buffer #3

Open morganherlocker opened 10 years ago

aparshin commented 9 years ago

Hello Morgan,

I've implemented a prototype of geodesic buffer here: https://github.com/aparshin/turf-buffer/tree/geodesic There is a Leaflet page for debug added there, but it requires to browserify sources (browserify index.js --standalone buffer > bundle.js).

The algorithm is simple: manually construct geodesic buffers for each line segment (taken from artisinal branch) and then union them using JSTS (CascadedPolygonUnion can be used to speedup things a little). There are couple issues with this implementation:


We had implemented similar algorithm in our Web-GIS and faced performance problem. Here is my question in JSTS mailing list about possible faster algorithms: http://sourceforge.net/p/jts-topo-suite/mailman/message/31906899/

I think the following variant will be faster for small and medium-size geometries:

What do you think about this? Maybe, you have any other ideas?