Skip to content

Instantly share code, notes, and snippets.

@MateoV
Last active August 29, 2015 14:27
Show Gist options
  • Save MateoV/ce1ad0c6cd8368db540e to your computer and use it in GitHub Desktop.
Save MateoV/ce1ad0c6cd8368db540e to your computer and use it in GitHub Desktop.
var turf = require('turf');
var my_poly = {"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[10.180206298828125,52.77701641822032],[10.180206298828125,52.82351239964272],[10.180206298828125,52.84508292433087],[10.182952880859375,52.8732743724185],[10.257110595703125,52.894820182985136],[10.369720458984375,52.906417338833315],[10.504302978515625,52.906417338833315],[10.526275634765625,52.89979077269751],[10.542755126953125,52.894820182985136],[10.545501708984375,52.89316319305443],[10.545501708984375,52.80857268383112],[10.545501708984375,52.76372272054047],[10.542755126953125,52.6772147136293],[10.542755126953125,52.658892951388836],[10.542755126953125,52.65056233801667],[10.542755126953125,52.58219141858192],[10.542755126953125,52.55047112092798],[10.537261962890625,52.48696168541221],[10.443878173828125,52.48361654018387],[10.443878173828125,52.51371369009507],[10.446624755859375,52.57885352016413],[10.446624755859375,52.595540470772505],[10.449371337890625,52.603881563601846],[10.454864501953125,52.61889152864342],[10.454864501953125,52.697193330211725],[10.402679443359375,52.768708332856974],[10.383453369140625,52.77701641822032],[10.273590087890625,52.76372272054047],[10.224151611328125,52.7653846547399],[10.202178955078125,52.768708332856974],[10.182952880859375,52.7653846547399],[10.180206298828125,52.77701641822032]]],[[[10.018157958984375,52.603881563601846],[10.007171630859375,52.63723005468619],[10.015411376953125,52.648896024853066],[10.034637451171875,52.67388405550449],[10.073089599609375,52.675549416308186],[10.084075927734375,52.6772147136293],[10.130767822265625,52.67388405550449],[10.152740478515625,52.667221977443845],[10.174713134765625,52.65222858768255],[10.171966552734375,52.6305623889136],[10.174713134765625,52.58886645295726],[10.171966552734375,52.5771844756442],[10.155487060546875,52.55882079193054],[10.089569091796875,52.56382983188752],[10.018157958984375,52.603881563601846]]]]},"properties":{}
}
var buffered = turf.buffer(my_poly, 1, 'kilometers');
console.log(JSON.stringify(buffered));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment