Currently the only possible optional configuration of circleToPolygon is numberOfSegments. We want to expand the functionality of circleToPolygon to allow for more optional configurations like creating MultiPolygon (if needed) and to not follow the right-hand rule. We want to do this without increasing the number of parameters for circleToPlygon
Proposed solution
Rename the parameter numberOfSegements to options
Expand the function to allow the parameter to either be a Number or an Object
There should be no behavior changes if options is a Number
If options is an Object with a key named numberOfSegemnts, then the value of that key should be used as the value for numberOfSegments
If options is an Object but does not have the key numberOfSegements, then then numberOfSegments should default to 32.
The reason that there should not be any error thrown if options is an object without the key numberOfSegements is that all options should be optional. The user might set different options depending on different conditions. We do not want the code to throw an error if one or both of x and y are false.
Problem Description
Currently the only possible optional configuration of
circleToPolygon
isnumberOfSegments
. We want to expand the functionality ofcircleToPolygon
to allow for more optional configurations like creating MultiPolygon (if needed) and to not follow the right-hand rule. We want to do this without increasing the number of parameters forcircleToPlygon
Proposed solution
numberOfSegements
tooptions
options
is a Numberkey
namednumberOfSegemnts
, then the value of that key should be used as the value fornumberOfSegments
options
is an Object but does not have the keynumberOfSegements
, then thennumberOfSegments
should default to32
.The reason that there should not be any error thrown if
options
is an object without the keynumberOfSegements
is that all options should be optional. The user might set different options depending on different conditions. We do not want the code to throw an error if one or both ofx
andy
are false.circleToPolygon's Current Parameters (for reference)
center
Array *required has to contain two OR three elements,longitude
Number. Has to be>=-180
and<=180
latitude
Number. Has to be>=-90
and<=90
radius
Number *required has to be>0
.numberofSegments
Number has to be>=3
if passed to the function. Will default to32
.