More reorganization to reuse JSON parsing

This commit is contained in:
Eric Fischer
2016-12-06 17:19:22 -08:00
parent 112f451c66
commit 4256473283
5 changed files with 57 additions and 51 deletions
+3 -14
View File
@@ -7,7 +7,6 @@
#include <unistd.h>
#include "mvt.hpp"
#include "plugin.hpp"
#include "write_json.hpp"
#include "projection.hpp"
#include "geometry.hpp"
@@ -15,6 +14,9 @@ extern "C" {
#include "jsonpull/jsonpull.h"
}
#include "write_json.hpp"
#include "read_json.hpp"
struct writer_arg {
int *pipe_orig;
mvt_layer *layer;
@@ -44,17 +46,6 @@ void *run_writer(void *a) {
return NULL;
}
static void json_context(json_object *j) { // XXX share with geojson.cpp
char *s = json_stringify(j);
if (strlen(s) >= 500) {
sprintf(s + 497, "...");
}
fprintf(stderr, "In JSON object %s\n", s);
free(s); // stringify
}
mvt_layer parse_layer(int fd, unsigned z, unsigned x, unsigned y) {
mvt_layer ret;
@@ -124,7 +115,6 @@ mvt_layer parse_layer(int fd, unsigned z, unsigned x, unsigned y) {
exit(EXIT_FAILURE);
}
#if 0
int t;
for (t = 0; t < GEOM_TYPES; t++) {
if (strcmp(geometry_type->string, geometry_names[t]) == 0) {
@@ -136,7 +126,6 @@ mvt_layer parse_layer(int fd, unsigned z, unsigned x, unsigned y) {
json_context(j);
exit(EXIT_FAILURE);
}
#endif
json_free(j);
}