This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Fix geojson polygons that span the antimeridian and have arcs > 180 | |
/// degrees. This is a workaround for a bug in the underlying H3 library: | |
/// <https://github.com/uber/h3/issues/561> | |
/// | |
/// This code is based on nrabinowitz's code in | |
/// <https://observablehq.com/@nrabinowitz/mapbox-utils> | |
pub fn fix_trans_meridian_coordinate(coord: &mut geo_types::Coordinate<f64>) { | |
if coord.x < 0.0 { | |
coord.x += 360.0; |