Add starting radius to circle and sector #2778
LamprosPitsillos
started this conversation in
Feature proposals
Replies: 1 comment 1 reply
-
var radius = 5;
var bearing1 = 25;
var bearing2 = 45;
var A_center = turf.point([-75, 40]);
var B_center = turf.point([-75.02, 40.01]);
var A_sector = turf.sector(A_center, radius, bearing1, bearing2);
var A_sector_mask = turf.sector(A_center, radius-2, bearing1, bearing2);
var x = turf.difference(turf.featureCollection([A_sector, A_sector_mask]));
var B_sector = turf.sector(B_center, radius, bearing1, bearing2);
var B_sector_mask = turf.sector(B_center, radius-2, bearing1, bearing2);
const y = turf.mask(B_sector, B_sector_mask);
return turf.featureCollection([x,y]); Turns out i cant achieve what i want using mask ( documented behavior ) "Returns Masked Polygon (exterior ring with holes)" |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Having Circle and Sector accept an option like "initRadius" , where the circle or sector will start after that radius.
This can be easily done internally with the
Misc.mask
Why to achieve something like a torus for circles and sectors really easily and conveniently
Beta Was this translation helpful? Give feedback.
All reactions