Skip to content

Commit 28c0273

Browse files
committed
formatting fixes with make format
1 parent c14931b commit 28c0273

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

debug/debug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include <GLFW/glfw3.h>
2-
#include <memory>
31
#include "../bench/util.hpp"
2+
#include <GLFW/glfw3.h>
43
#include <mapbox/geojson.hpp>
54
#include <mapbox/geojson_impl.hpp>
65
#include <mapbox/geojsonvt.hpp>
6+
#include <memory>
77

88
using namespace mapbox::geojsonvt;
99

include/mapbox/geojsonvt.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ inline uint64_t toID(uint8_t z, uint32_t x, uint32_t y) {
6060
}
6161

6262
inline const Tile geoJSONToTile(const geojson& geojson_,
63-
uint8_t z,
64-
uint32_t x,
65-
uint32_t y,
66-
const TileOptions& options = TileOptions(),
67-
bool wrap = false,
68-
bool clip = false) {
63+
uint8_t z,
64+
uint32_t x,
65+
uint32_t y,
66+
const TileOptions& options = TileOptions(),
67+
bool wrap = false,
68+
bool clip = false) {
6969

7070
const auto features_ = geojson::visit(geojson_, ToFeatureCollection{});
7171
auto z2 = 1u << z;
@@ -80,8 +80,7 @@ inline const Tile geoJSONToTile(const geojson& geojson_,
8080
const auto left = detail::clip<0>(features, (x - p) / z2, (x + 1 + p) / z2, -1, 2);
8181
features = detail::clip<1>(left, (y - p) / z2, (y + 1 + p) / z2, -1, 2);
8282
}
83-
return detail::InternalTile({ features, z, x, y, options.extent, tolerance })
84-
.tile;
83+
return detail::InternalTile({ features, z, x, y, options.extent, tolerance }).tile;
8584
}
8685

8786
class GeoJSONVT {
@@ -186,7 +185,8 @@ class GeoJSONVT {
186185
(z == options.maxZoom ? 0 : options.tolerance / (z2 * options.extent));
187186

188187
it = tiles
189-
.emplace(id, detail::InternalTile{ features, z, x, y, options.extent, tolerance })
188+
.emplace(id,
189+
detail::InternalTile{ features, z, x, y, options.extent, tolerance })
190190
.first;
191191
stats[z] = (stats.count(z) ? stats[z] + 1 : 1);
192192
total++;

include/mapbox/geojsonvt/convert.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ inline vt_features convert(const geometry::feature_collection<double>& features,
9999
for (const auto& feature : features) {
100100
projected.emplace_back(
101101
geometry::geometry<double>::visit(feature.geometry, project{ tolerance }),
102-
feature.properties,
103-
feature.id);
102+
feature.properties, feature.id);
104103
}
105104
return projected;
106105
}

include/mapbox/geojsonvt/tile.hpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,30 @@ class InternalTile {
6565
}
6666

6767
private:
68-
void addFeature(const vt_point& point, const property_map& props, const optional<identifier>& id) {
68+
void
69+
addFeature(const vt_point& point, const property_map& props, const optional<identifier>& id) {
6970
tile.features.push_back({ transform(point), props, id });
7071
}
7172

72-
void addFeature(const vt_line_string& line, const property_map& props, const optional<identifier>& id) {
73+
void addFeature(const vt_line_string& line,
74+
const property_map& props,
75+
const optional<identifier>& id) {
7376
const auto new_line = transform(line);
7477
if (!new_line.empty())
7578
tile.features.push_back({ std::move(new_line), props, id });
7679
}
7780

78-
void addFeature(const vt_polygon& polygon, const property_map& props, const optional<identifier>& id) {
81+
void addFeature(const vt_polygon& polygon,
82+
const property_map& props,
83+
const optional<identifier>& id) {
7984
const auto new_polygon = transform(polygon);
8085
if (!new_polygon.empty())
8186
tile.features.push_back({ std::move(new_polygon), props, id });
8287
}
8388

84-
void addFeature(const vt_geometry_collection& collection, const property_map& props, const optional<identifier>& id) {
89+
void addFeature(const vt_geometry_collection& collection,
90+
const property_map& props,
91+
const optional<identifier>& id) {
8592
for (const auto& geom : collection) {
8693
vt_geometry::visit(geom, [&](const auto& g) {
8794
// `this->` is a workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636

test/test.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ TEST(GetTile, USStates) {
185185
ASSERT_EQ(features == expected, true);
186186

187187
const auto square = parseJSONTile(loadFile("test/fixtures/us-states-square.json"));
188-
ASSERT_EQ(square == index.getTile(9, 148, 192).features, true); // clipped square
188+
ASSERT_EQ(square == index.getTile(9, 148, 192).features, true); // clipped square
189189

190190
ASSERT_EQ(empty_tile == index.getTile(11, 800, 400), true); // non-existing tile
191191
ASSERT_EQ(&empty_tile == &index.getTile(11, 800, 400), true); // non-existing tile
@@ -200,19 +200,16 @@ TEST(GetTile, AntimeridianTriangle) {
200200
const auto geojson = mapbox::geojson::parse(loadFile("test/fixtures/dateline-triangle.json"));
201201

202202
// Using default options.
203-
GeoJSONVT index { geojson };
203+
GeoJSONVT index{ geojson };
204204

205205
struct TileCoordinate {
206206
uint8_t z;
207207
uint32_t x;
208208
uint32_t y;
209209
};
210210

211-
std::vector<TileCoordinate> tileCoordinates {
212-
{ 1, 0, 0 },
213-
{ 1, 0, 1 },
214-
{ 1, 1, 0 },
215-
{ 1, 1, 1 }
211+
std::vector<TileCoordinate> tileCoordinates{
212+
{ 1, 0, 0 }, { 1, 0, 1 }, { 1, 1, 0 }, { 1, 1, 1 }
216213
};
217214

218215
for (const auto tileCoordinate : tileCoordinates) {

0 commit comments

Comments
 (0)