mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Add more comments
This commit is contained in:
+8
-1
@@ -364,14 +364,21 @@ static long long scale_geometry(struct serialization_state *sst, long long *bbox
|
|||||||
prev_x = op.x;
|
prev_x = op.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this is a polygon, in which the first and last
|
||||||
|
// points of each ring are supposed to be identical,
|
||||||
|
// make sure the antimeridian wraparound detection
|
||||||
|
// preserves that expectation. If it doesn't, it means
|
||||||
|
// we have detected something wrongly.
|
||||||
if (geom[j - 1] == geom[i]) {
|
if (geom[j - 1] == geom[i]) {
|
||||||
if (offset != 0) {
|
if (offset != 0) {
|
||||||
// first and last points are supposed to be the same
|
// first and last points are supposed to be the same
|
||||||
// but there is an unresolved antimeridian shift still
|
// but there is an unresolved antimeridian shift
|
||||||
balanced = false;
|
balanced = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If something contradictory happened in longitude
|
||||||
|
// wraparound detection, restore the original geometry
|
||||||
if (!balanced) {
|
if (!balanced) {
|
||||||
ring.clear();
|
ring.clear();
|
||||||
for (size_t k = i; k < j; k++) {
|
for (size_t k = i; k < j; k++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user