Search code examples
javascriptgeometrypolygongeojson

Enlarge a GeoJSON polygon


How to enlarge a GeoJSON polygon ?

Say I have a GeoJSON polygon

small polygon

I'd like to enlarge this shape to have a larger polygon with the same basis

enter image description here

I did not found anything on the web about this. I found many promising libraries such as turf.js, but couldn't figure out how to achieve this.


Solution

  • I figured it out thanks to turf.js.

    A combination of turf.buffer() and turf.simplify() does the trick.

    Reference