2017-07-14 23:56:23 +00:00
|
|
|
#ifndef PROJECTION_HPP
|
|
|
|
#define PROJECTION_HPP
|
|
|
|
|
2016-06-01 22:49:41 +00:00
|
|
|
void lonlat2tile(double lon, double lat, int zoom, long long *x, long long *y);
|
|
|
|
void epsg3857totile(double ix, double iy, int zoom, long long *x, long long *y);
|
|
|
|
void tile2lonlat(long long x, long long y, int zoom, double *lon, double *lat);
|
2016-06-28 22:18:27 +00:00
|
|
|
void tiletoepsg3857(long long x, long long y, int zoom, double *ox, double *oy);
|
|
|
|
void set_projection_or_exit(const char *optarg);
|
2016-06-01 23:55:52 +00:00
|
|
|
|
|
|
|
struct projection {
|
|
|
|
const char *name;
|
|
|
|
void (*project)(double ix, double iy, int zoom, long long *ox, long long *oy);
|
2016-06-28 22:18:27 +00:00
|
|
|
void (*unproject)(long long ix, long long iy, int zoom, double *ox, double *oy);
|
2016-06-01 23:55:52 +00:00
|
|
|
const char *alias;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct projection *projection;
|
2016-06-28 22:18:27 +00:00
|
|
|
extern struct projection projections[];
|
2017-07-14 23:56:23 +00:00
|
|
|
|
2018-12-12 18:49:53 +00:00
|
|
|
extern unsigned long long (*encode_index)(unsigned int wx, unsigned int wy);
|
|
|
|
extern void (*decode_index)(unsigned long long index, unsigned *wx, unsigned *wy);
|
|
|
|
|
|
|
|
unsigned long long encode_quadkey(unsigned int wx, unsigned int wy);
|
|
|
|
void decode_quadkey(unsigned long long index, unsigned *wx, unsigned *wy);
|
|
|
|
|
|
|
|
unsigned long long encode_hilbert(unsigned int wx, unsigned int wy);
|
|
|
|
void decode_hilbert(unsigned long long index, unsigned *wx, unsigned *wy);
|
|
|
|
|
2017-07-14 23:56:23 +00:00
|
|
|
#endif
|