mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-04-08 19:44:15 +00:00
Reindent with clang-format (#3)
This commit is contained in:
parent
e6ab02ddd3
commit
6978a0e102
@ -190,7 +190,7 @@ drawvec readMultiPolygon(std::vector<long long> &coords, std::vector<int> &lengt
|
||||
}
|
||||
}
|
||||
|
||||
dv.push_back(draw(VT_CLOSEPATH, 0, 0)); // mark that the next ring is outer
|
||||
dv.push_back(draw(VT_CLOSEPATH, 0, 0)); // mark that the next ring is outer
|
||||
}
|
||||
|
||||
return dv;
|
||||
|
@ -16,7 +16,12 @@
|
||||
// XXX duplicated
|
||||
#define GEOM_TYPES 6
|
||||
static const char *geometry_names[GEOM_TYPES] = {
|
||||
"Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon",
|
||||
"Point",
|
||||
"MultiPoint",
|
||||
"LineString",
|
||||
"MultiLineString",
|
||||
"Polygon",
|
||||
"MultiPolygon",
|
||||
};
|
||||
|
||||
// XXX duplicated
|
||||
|
@ -223,7 +223,7 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
|
||||
sf.has_tippecanoe_maxzoom = (tippecanoe_maxzoom != -1);
|
||||
sf.tippecanoe_maxzoom = tippecanoe_maxzoom;
|
||||
sf.geometry = dv;
|
||||
sf.feature_minzoom = 0; // Will be filled in during index merging
|
||||
sf.feature_minzoom = 0; // Will be filled in during index merging
|
||||
sf.seq = *(sst->layer_seq);
|
||||
|
||||
if (tippecanoe_layername.size() != 0) {
|
||||
|
@ -1100,7 +1100,7 @@ static int clip(double *x0, double *y0, double *x1, double *y1, double xmin, dou
|
||||
|
||||
// Now find the intersection point;
|
||||
// use formulas y = y0 + slope * (x - x0), x = x0 + (1 / slope) * (y - y0)
|
||||
if (outcodeOut & TOP) { // point is above the clip rectangle
|
||||
if (outcodeOut & TOP) { // point is above the clip rectangle
|
||||
x = *x0 + (*x1 - *x0) * (ymax - *y0) / (*y1 - *y0);
|
||||
y = ymax;
|
||||
} else if (outcodeOut & BOTTOM) { // point is below the clip rectangle
|
||||
@ -1109,7 +1109,7 @@ static int clip(double *x0, double *y0, double *x1, double *y1, double xmin, dou
|
||||
} else if (outcodeOut & RIGHT) { // point is to the right of clip rectangle
|
||||
y = *y0 + (*y1 - *y0) * (xmax - *x0) / (*x1 - *x0);
|
||||
x = xmax;
|
||||
} else if (outcodeOut & LEFT) { // point is to the left of clip rectangle
|
||||
} else if (outcodeOut & LEFT) { // point is to the left of clip rectangle
|
||||
y = *y0 + (*y1 - *y0) * (xmin - *x0) / (*x1 - *x0);
|
||||
x = xmin;
|
||||
}
|
||||
|
@ -4,5 +4,5 @@
|
||||
#include "json_logger.hpp"
|
||||
|
||||
void json_logger::progress_tile(double progress) {
|
||||
fprintf(stderr,"{\"progress\":%3.1f}\n",progress);
|
||||
fprintf(stderr, "{\"progress\":%3.1f}\n", progress);
|
||||
}
|
||||
|
@ -3,11 +3,10 @@
|
||||
#ifndef LOGGING_HPP
|
||||
#define LOGGING_HPP
|
||||
|
||||
|
||||
struct json_logger {
|
||||
bool json_enabled = false;
|
||||
bool json_enabled = false;
|
||||
|
||||
void progress_tile(double progress);
|
||||
void progress_tile(double progress);
|
||||
};
|
||||
|
||||
#endif
|
8
main.cpp
8
main.cpp
@ -1046,7 +1046,7 @@ void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FI
|
||||
mem = 8192;
|
||||
}
|
||||
|
||||
long long availfiles = MAX_FILES - 2 * nreaders // each reader has a geom and an index
|
||||
long long availfiles = MAX_FILES - 2 * nreaders // each reader has a geom and an index
|
||||
- 4 // pool, meta, mbtiles, mbtiles journal
|
||||
- 4 // top-level geom and index output, both FILE and fd
|
||||
- 3; // stdin, stdout, stderr
|
||||
@ -3246,7 +3246,7 @@ int main(int argc, char **argv) {
|
||||
if (sources.size() == 0) {
|
||||
struct source src;
|
||||
src.layer = "";
|
||||
src.file = ""; // standard input
|
||||
src.file = ""; // standard input
|
||||
sources.push_back(src);
|
||||
}
|
||||
|
||||
@ -3258,7 +3258,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
long long file_bbox[4] = {UINT_MAX, UINT_MAX, 0, 0};
|
||||
|
||||
ret = read_input(sources, name ? name : out_mbtiles ? out_mbtiles : out_dir, maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, out_dir, &exclude, &include, exclude_all, filter, droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0, file_bbox, prefilter, postfilter, description, guess_maxzoom, &attribute_types, argv[0], &attribute_accum, attribute_descriptions, commandline);
|
||||
ret = read_input(sources, name ? name : out_mbtiles ? out_mbtiles
|
||||
: out_dir,
|
||||
maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, out_dir, &exclude, &include, exclude_all, filter, droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0, file_bbox, prefilter, postfilter, description, guess_maxzoom, &attribute_types, argv[0], &attribute_accum, attribute_descriptions, commandline);
|
||||
|
||||
if (outdb != NULL) {
|
||||
mbtiles_close(outdb, argv[0]);
|
||||
|
4
mvt.cpp
4
mvt.cpp
@ -306,8 +306,8 @@ std::string mvt_tile::encode() {
|
||||
protozero::pbf_writer layer_writer(layer_string);
|
||||
|
||||
layer_writer.add_uint32(15, layers[i].version); /* version */
|
||||
layer_writer.add_string(1, layers[i].name); /* name */
|
||||
layer_writer.add_uint32(5, layers[i].extent); /* extent */
|
||||
layer_writer.add_string(1, layers[i].name); /* name */
|
||||
layer_writer.add_uint32(5, layers[i].extent); /* extent */
|
||||
|
||||
for (size_t j = 0; j < layers[i].keys.size(); j++) {
|
||||
layer_writer.add_string(3, layers[i].keys[j]); /* key */
|
||||
|
@ -14,20 +14,30 @@
|
||||
#include "milo/dtoa_milo.h"
|
||||
|
||||
const char *geometry_names[GEOM_TYPES] = {
|
||||
"Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon",
|
||||
"Point",
|
||||
"MultiPoint",
|
||||
"LineString",
|
||||
"MultiLineString",
|
||||
"Polygon",
|
||||
"MultiPolygon",
|
||||
};
|
||||
|
||||
int geometry_within[GEOM_TYPES] = {
|
||||
-1, /* point */
|
||||
GEOM_POINT, /* multipoint */
|
||||
GEOM_POINT, /* linestring */
|
||||
GEOM_POINT, /* multipoint */
|
||||
GEOM_POINT, /* linestring */
|
||||
GEOM_LINESTRING, /* multilinestring */
|
||||
GEOM_LINESTRING, /* polygon */
|
||||
GEOM_POLYGON, /* multipolygon */
|
||||
GEOM_POLYGON, /* multipolygon */
|
||||
};
|
||||
|
||||
int mb_geometry[GEOM_TYPES] = {
|
||||
VT_POINT, VT_POINT, VT_LINE, VT_LINE, VT_POLYGON, VT_POLYGON,
|
||||
VT_POINT,
|
||||
VT_POINT,
|
||||
VT_LINE,
|
||||
VT_LINE,
|
||||
VT_POLYGON,
|
||||
VT_POLYGON,
|
||||
};
|
||||
|
||||
void json_context(json_object *j) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#define GEOM_POINT 0 /* array of positions */
|
||||
#define GEOM_POINT 0 /* array of positions */
|
||||
#define GEOM_MULTIPOINT 1 /* array of arrays of positions */
|
||||
#define GEOM_LINESTRING 2 /* array of arrays of positions */
|
||||
#define GEOM_MULTILINESTRING 3 /* array of arrays of arrays of positions */
|
||||
#define GEOM_POLYGON 4 /* array of arrays of arrays of positions */
|
||||
#define GEOM_POLYGON 4 /* array of arrays of arrays of positions */
|
||||
#define GEOM_MULTIPOLYGON 5 /* array of arrays of arrays of arrays of positions */
|
||||
#define GEOM_TYPES 6
|
||||
|
||||
|
16
tile.cpp
16
tile.cpp
@ -464,7 +464,7 @@ void *partial_feature_worker(void *v) {
|
||||
}
|
||||
|
||||
if ((t == VT_LINE || t == VT_POLYGON) && !(prevent[P_SIMPLIFY] || (z == maxzoom && prevent[P_SIMPLIFY_LOW]) || (z < maxzoom && additional[A_GRID_LOW_ZOOMS]))) {
|
||||
if (1 /* !reduced */) { // XXX why did this not simplify if reduced?
|
||||
if (1 /* !reduced */) { // XXX why did this not simplify if reduced?
|
||||
if (t == VT_LINE) {
|
||||
geom = remove_noop(geom, t, 32 - z - line_detail);
|
||||
}
|
||||
@ -1792,7 +1792,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
pid_t prefilter_pid = 0;
|
||||
FILE *prefilter_fp = NULL;
|
||||
pthread_t prefilter_writer;
|
||||
run_prefilter_args rpa; // here so it stays in scope until joined
|
||||
run_prefilter_args rpa; // here so it stays in scope until joined
|
||||
FILE *prefilter_read_fp = NULL;
|
||||
json_pull *prefilter_jp = NULL;
|
||||
|
||||
@ -2345,7 +2345,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Going to try merging %0.2f%% of the polygons to make it fit\n", 100 - merge_fraction * 100);
|
||||
}
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
continue;
|
||||
} else if (additional[A_INCREASE_GAMMA_AS_NEEDED] && gamma < 10) {
|
||||
if (gamma < 1) {
|
||||
@ -2362,7 +2362,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Going to try gamma of %0.3f to make it fit\n", gamma);
|
||||
}
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
continue;
|
||||
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
|
||||
mingap_fraction = mingap_fraction * max_tile_features / totalsize * 0.90;
|
||||
@ -2413,7 +2413,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
} else if (prevent[P_DYNAMIC_DROP]) {
|
||||
arg->still_dropping = true;
|
||||
}
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
continue;
|
||||
} else {
|
||||
fprintf(stderr, "Try using --drop-fraction-as-needed or --drop-densest-as-needed.\n");
|
||||
@ -2440,7 +2440,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Going to try merging %0.2f%% of the polygons to make it fit\n", 100 - merge_fraction * 100);
|
||||
}
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
} else if (additional[A_INCREASE_GAMMA_AS_NEEDED] && gamma < 10) {
|
||||
if (gamma < 1) {
|
||||
gamma = 1;
|
||||
@ -2456,7 +2456,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Going to try gamma of %0.3f to make it fit\n", gamma);
|
||||
}
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
|
||||
mingap_fraction = mingap_fraction * max_tile_size / compressed.size() * 0.90;
|
||||
unsigned long long mg = choose_mingap(indices, mingap_fraction);
|
||||
@ -2511,7 +2511,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
||||
} else if (prevent[P_DYNAMIC_DROP]) {
|
||||
arg->still_dropping = true;
|
||||
}
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
line_detail++; // to keep it the same when the loop decrements it
|
||||
}
|
||||
} else {
|
||||
if (pass == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user