mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
* Remove the concept of "separate metadata"
This was an extra level of attribute indirection (features point
to metadata records which point to key and value strings) which was
intended to reduce the size of temporary storage for features with
large numbers of attributes that were also spread across large numbers
of tiles at maxzoom.
For other kinds of features, the extra indirection slowed things down
instead, and, especially when maxzoom guessing was being used, many more
features were having their metadata externalized than could actually
benefit from it.
* Shave a few bytes off temporary files by using more unsigned integers
* Flush stderr after logging progress
* Revert "Shave a few bytes off temporary files by using more unsigned integers"
This reverts commit eef29084ec.
* Limit the size of the string pools and trees to fit in memory
* Add missing #include
* Move the string pool and search tree from mmap to allocated memory
* Sort in allocated rather than mapped memory too
* Also use pread instead of mapping to read in the data to sort
* When the pool gets too big, switch to just the file, not memory
* Switch string pool from memory to disk when memory is 10% full
* Add to-memory versions of the serialization functions
* Crashy work in progress toward compression
* Fix the pointer bug that was causing the crash
* Serialize features into memory rather than straight to disk
* Compress individual features in the temporary files
* Don't need to store the length of the geometry
* Remove per-feature compression; move minzoom back into the object
* Start adding a stream compressor object
* Track file position within fwrite_check()
* Add compressed stream writer functions
* Pull the writing of the serialized feature out to the callers
* Starting toward compression again from a different point
* Hook up more compression functions
* Remove unused code from the other day
* Make enough deflate calls to flush out all the buffered data
* Start on decompression
* Tile number is uncompressed, tile content is compressed
* Work on alternating compressed and uncompressed in decompression
* Closer, but still doesn't work
* Sort of works
* Works until we get to concatenated tiles
* More attempts that don't work
* One bug down
* It made a tileset!
* Handle nonzero initial zooms
* Fix seeking within compressed feature streams
* Tests pass!
* Remove debug spew
* Oops: remember to delete the temporary files so they don't hang around
* Test that fails with the current compression code
* Properly account for bytes read while closing the compressed stream
* Limit the number of warnings about bad label points
* A little more armor when closing decompression
* This time for sure
* A different, less fragile, test that failed previously with compression
* Move feature stream compression to its own file
* Remove now-unused code to deserialize from a file
* Forgot to add the new files
* Remove a little debugging logging
* Add a couple of comments on what it means to be within decompression
* Fix indentation
* Update changelog. Remove stray debugging comment.
84 lines
1.6 KiB
C++
84 lines
1.6 KiB
C++
#ifndef MAIN_HPP
|
|
#define MAIN_HPP
|
|
|
|
#include <stddef.h>
|
|
#include <atomic>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "json_logger.hpp"
|
|
|
|
struct index {
|
|
long long start = 0;
|
|
long long end = 0;
|
|
unsigned long long ix = 0;
|
|
short segment = 0;
|
|
unsigned short t : 2;
|
|
unsigned long long seq : (64 - 18); // pack with segment and t to stay in 32 bytes
|
|
|
|
index()
|
|
: t(0),
|
|
seq(0) {
|
|
}
|
|
};
|
|
|
|
struct clipbbox {
|
|
double lon1;
|
|
double lat1;
|
|
double lon2;
|
|
double lat2;
|
|
|
|
long long minx;
|
|
long long miny;
|
|
long long maxx;
|
|
long long maxy;
|
|
};
|
|
|
|
extern std::vector<clipbbox> clipbboxes;
|
|
|
|
void checkdisk(std::vector<struct reader> *r);
|
|
|
|
extern int geometry_scale;
|
|
extern int quiet;
|
|
extern int quiet_progress;
|
|
extern json_logger logger;
|
|
extern double progress_interval;
|
|
extern std::atomic<double> last_progress;
|
|
extern int extra_detail;
|
|
|
|
extern size_t CPUS;
|
|
extern size_t TEMP_FILES;
|
|
extern size_t memsize;
|
|
|
|
extern size_t max_tile_size;
|
|
extern size_t max_tile_features;
|
|
extern int cluster_distance;
|
|
extern std::string attribute_for_id;
|
|
extern int tiny_polygon_size;
|
|
extern size_t limit_tile_feature_count;
|
|
extern size_t limit_tile_feature_count_at_maxzoom;
|
|
|
|
struct order_field {
|
|
std::string name;
|
|
bool descending;
|
|
|
|
order_field(std::string _name, bool _descending)
|
|
: name(_name),
|
|
descending(_descending) {
|
|
}
|
|
};
|
|
|
|
extern std::vector<order_field> order_by;
|
|
|
|
// not legal UTF-8, so can't appear as a real attribute name
|
|
#define ORDER_BY_SIZE "\200size"
|
|
extern bool order_by_size;
|
|
|
|
int mkstemp_cloexec(char *name);
|
|
FILE *fopen_oflag(const char *name, const char *mode, int oflag);
|
|
bool progress_time();
|
|
|
|
#define MAX_ZOOM 24
|
|
|
|
#endif
|