UNPKG

geotoolbox

Version:

geotoolbox is GIS javascript library. It is based on d3geo, topojson and geos-wasm.

2 lines (1 loc) 488 B
import{geojsonToGeosGeom as e,geosGeomToGeojson as o}from"../node_modules/geos-wasm/build/package/helpers/geos.helpers.esm.js";import{ensureGeosLoaded as s,getGeos as r}from"./helpers/geosloader.js";function t(t,{quadsegs:g=8,isProjected:a=!1,distance:p=0}={}){s(),geos=r();let m=JSON.parse(JSON.stringify(t));const i=e(m,geos),n=geos.GEOSBuffer(i,p,g);let l=o(n,geos);return geos.GEOSFree(i),geos.GEOSFree(n),m.features=[{type:"Feature",properties:{},geometry:l}],m}export{t as buffer};