2017-07-14 23:56:23 +00:00
|
|
|
#ifndef GEOJSON_HPP
|
|
|
|
#define GEOJSON_HPP
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <set>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include "mbtiles.hpp"
|
|
|
|
#include "jsonpull/jsonpull.h"
|
|
|
|
|
2016-04-27 21:59:20 +00:00
|
|
|
struct parse_json_args {
|
2016-04-27 22:10:26 +00:00
|
|
|
json_pull *jp;
|
|
|
|
const char *reading;
|
|
|
|
volatile long long *layer_seq;
|
|
|
|
volatile long long *progress_seq;
|
|
|
|
long long *metapos;
|
|
|
|
long long *geompos;
|
|
|
|
long long *indexpos;
|
2016-04-28 19:57:03 +00:00
|
|
|
std::set<std::string> *exclude;
|
|
|
|
std::set<std::string> *include;
|
2016-04-27 22:10:26 +00:00
|
|
|
int exclude_all;
|
|
|
|
FILE *metafile;
|
|
|
|
FILE *geomfile;
|
|
|
|
FILE *indexfile;
|
|
|
|
struct memfile *poolfile;
|
|
|
|
struct memfile *treefile;
|
|
|
|
char *fname;
|
|
|
|
int basezoom;
|
|
|
|
int layer;
|
|
|
|
double droprate;
|
|
|
|
long long *file_bbox;
|
|
|
|
int segment;
|
|
|
|
int *initialized;
|
|
|
|
unsigned *initial_x;
|
|
|
|
unsigned *initial_y;
|
|
|
|
struct reader *readers;
|
2016-05-10 22:30:49 +00:00
|
|
|
int maxzoom;
|
2016-08-29 21:59:28 +00:00
|
|
|
std::map<std::string, layermap_entry> *layermap;
|
2016-08-29 23:38:57 +00:00
|
|
|
std::string *layername;
|
2016-11-12 01:37:46 +00:00
|
|
|
bool uses_gamma;
|
2017-04-17 21:42:50 +00:00
|
|
|
std::map<std::string, int> const *attribute_types;
|
2017-05-30 20:28:25 +00:00
|
|
|
double *dist_sum;
|
|
|
|
size_t *dist_count;
|
2017-05-30 23:58:56 +00:00
|
|
|
bool want_dist;
|
2016-04-27 21:59:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct json_pull *json_begin_map(char *map, long long len);
|
2016-08-30 21:02:51 +00:00
|
|
|
void json_end_map(struct json_pull *jp);
|
|
|
|
|
2017-05-30 23:58:56 +00:00
|
|
|
void parse_json(json_pull *jp, const char *reading, volatile long long *layer_seq, volatile long long *progress_seq, long long *metapos, long long *geompos, long long *indexpos, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, FILE *metafile, FILE *geomfile, FILE *indexfile, struct memfile *poolfile, struct memfile *treefile, char *fname, int basezoom, int layer, double droprate, long long *file_bbox, int segment, int *initialized, unsigned *initial_x, unsigned *initial_y, struct reader *readers, int maxzoom, std::map<std::string, layermap_entry> *layermap, std::string layername, bool uses_gamma, std::map<std::string, int> const *attribute_types, double *dist_sum, size_t *dist_count, bool want_dist);
|
2016-04-27 21:59:20 +00:00
|
|
|
void *run_parse_json(void *v);
|
2017-07-14 23:56:23 +00:00
|
|
|
|
|
|
|
#endif
|