Skip to content

Commit

Permalink
The first and last positions should be equivalent in polygon ring (#886)
Browse files Browse the repository at this point in the history
* Add first coordinate to generated circle

* Update expected circle in TurfTransformation tests
  • Loading branch information
osana authored Sep 11, 2018
1 parent a04b9d5 commit b7d92fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static Polygon circle(@NonNull Point center, double radius, int steps,
for (int i = 0; i < steps; i++) {
coordinates.add(TurfMeasurement.destination(center, radius, i * 360d / steps, units));
}
coordinates.add(coordinates.get(0));

List<List<Point>> coordinate = new ArrayList<>();
coordinate.add(coordinates);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"coordinates":[[[-75.343,40.028952],[-75.3372459,40.0287354],[-75.3315473,40.0280877],[-75.3259592,40.0270151],[-75.3205355,40.025528],[-75.3153286,40.0236408],[-75.3103886,40.0213716],[-75.3057632,40.0187424],[-75.3014969,40.0157784],[-75.2976309,40.0125084],[-75.2942024,40.0089637],[-75.2912444,40.0051787],[-75.2887852,40.0011897],[-75.2868486,39.9970353],[-75.285453,39.9927555],[-75.2846119,39.9883914],[-75.2843331,39.9839852],[-75.2846194,39.9795793],[-75.2854678,39.9752161],[-75.28687,39.9709376],[-75.2888125,39.966785],[-75.2912765,39.9627983],[-75.2942381,39.9590158],[-75.2976688,39.9554739],[-75.3015355,39.9522068],[-75.305801,39.9492457],[-75.3104242,39.9466192],[-75.3153607,39.9443526],[-75.3205628,39.9424676],[-75.3259806,39.9409824],[-75.331562,39.9399112],[-75.3372534,39.9392643],[-75.343,39.939048],[-75.3487466,39.9392643],[-75.354438,39.9399112],[-75.3600194,39.9409824],[-75.3654372,39.9424676],[-75.3706393,39.9443526],[-75.3755758,39.9466192],[-75.380199,39.9492457],[-75.3844645,39.9522068],[-75.3883312,39.9554739],[-75.3917619,39.9590158],[-75.3947235,39.9627983],[-75.3971875,39.966785],[-75.39913,39.9709376],[-75.4005322,39.9752161],[-75.4013806,39.9795793],[-75.4016669,39.9839852],[-75.4013881,39.9883914],[-75.400547,39.9927555],[-75.3991514,39.9970353],[-75.3972148,40.0011897],[-75.3947556,40.0051787],[-75.3917976,40.0089637],[-75.3883691,40.0125084],[-75.3845031,40.0157784],[-75.3802368,40.0187424],[-75.3756114,40.0213716],[-75.3706714,40.0236408],[-75.3654645,40.025528],[-75.3600408,40.0270151],[-75.3544527,40.0280877],[-75.3487541,40.0287354]]],"type":"Polygon"}
{"coordinates":[[[-75.343,40.028952],[-75.3372459,40.0287354],[-75.3315473,40.0280877],[-75.3259592,40.0270151],[-75.3205355,40.025528],[-75.3153286,40.0236408],[-75.3103886,40.0213716],[-75.3057632,40.0187424],[-75.3014969,40.0157784],[-75.2976309,40.0125084],[-75.2942024,40.0089637],[-75.2912444,40.0051787],[-75.2887852,40.0011897],[-75.2868486,39.9970353],[-75.285453,39.9927555],[-75.2846119,39.9883914],[-75.2843331,39.9839852],[-75.2846194,39.9795793],[-75.2854678,39.9752161],[-75.28687,39.9709376],[-75.2888125,39.966785],[-75.2912765,39.9627983],[-75.2942381,39.9590158],[-75.2976688,39.9554739],[-75.3015355,39.9522068],[-75.305801,39.9492457],[-75.3104242,39.9466192],[-75.3153607,39.9443526],[-75.3205628,39.9424676],[-75.3259806,39.9409824],[-75.331562,39.9399112],[-75.3372534,39.9392643],[-75.343,39.939048],[-75.3487466,39.9392643],[-75.354438,39.9399112],[-75.3600194,39.9409824],[-75.3654372,39.9424676],[-75.3706393,39.9443526],[-75.3755758,39.9466192],[-75.380199,39.9492457],[-75.3844645,39.9522068],[-75.3883312,39.9554739],[-75.3917619,39.9590158],[-75.3947235,39.9627983],[-75.3971875,39.966785],[-75.39913,39.9709376],[-75.4005322,39.9752161],[-75.4013806,39.9795793],[-75.4016669,39.9839852],[-75.4013881,39.9883914],[-75.400547,39.9927555],[-75.3991514,39.9970353],[-75.3972148,40.0011897],[-75.3947556,40.0051787],[-75.3917976,40.0089637],[-75.3883691,40.0125084],[-75.3845031,40.0157784],[-75.3802368,40.0187424],[-75.3756114,40.0213716],[-75.3706714,40.0236408],[-75.3654645,40.025528],[-75.3600408,40.0270151],[-75.3544527,40.0280877],[-75.3487541,40.0287354],[-75.343,40.028952]]],"type":"Polygon"}

0 comments on commit b7d92fb

Please sign in to comment.