mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-08 08:24:25 +00:00
Applied MacOSX compile fixes from Artem with a few modifications
This commit is contained in:
@ -17,7 +17,8 @@
|
||||
#include <dirent.h>
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include "render_config.h"
|
||||
#include "dir_utils.h"
|
||||
#include "store.h"
|
||||
|
1
daemon.c
1
daemon.c
@ -10,6 +10,7 @@
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "daemon.h"
|
||||
#include "gen_tile.h"
|
||||
|
10
gen_tile.cpp
10
gen_tile.cpp
@ -21,10 +21,10 @@
|
||||
#include "dir_utils.h"
|
||||
#include "store.h"
|
||||
|
||||
using namespace mapnik;
|
||||
|
||||
#define DEG_TO_RAD (M_PIl/180)
|
||||
#define RAD_TO_DEG (180/M_PIl)
|
||||
using namespace mapnik;
|
||||
#define DEG_TO_RAD (M_PI/180)
|
||||
#define RAD_TO_DEG (180/M_PI)
|
||||
|
||||
#ifdef METATILE
|
||||
#define RENDER_SIZE (256 * (METATILE + 1))
|
||||
@ -67,7 +67,7 @@ class GoogleProjection
|
||||
for (d=0; d<levels; d++) {
|
||||
int e = c/2;
|
||||
Bc[d] = c/360.0;
|
||||
Cc[d] = c/(2 * M_PIl);
|
||||
Cc[d] = c/(2 * M_PI);
|
||||
zc[d] = e;
|
||||
Ac[d] = c;
|
||||
c *=2;
|
||||
@ -84,7 +84,7 @@ class GoogleProjection
|
||||
double e = zc[zoom];
|
||||
double g = (y - e)/-Cc[zoom];
|
||||
x = (x - e)/Bc[zoom];
|
||||
y = RAD_TO_DEG * ( 2 * atan(exp(g)) - 0.5 * M_PIl);
|
||||
y = RAD_TO_DEG * ( 2 * atan(exp(g)) - 0.5 * M_PI);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <getopt.h>
|
||||
#include <time.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gen_tile.h"
|
||||
#include "protocol.h"
|
||||
@ -29,9 +30,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
#else
|
||||
|
||||
#define DEG_TO_RAD (M_PIl/180)
|
||||
#define RAD_TO_DEG (180/M_PIl)
|
||||
|
||||
static int minZoom = 0;
|
||||
static int maxZoom = 18;
|
||||
static int verbose = 0;
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gen_tile.h"
|
||||
#include "protocol.h"
|
||||
@ -31,9 +33,6 @@ int main(int argc, char **argv)
|
||||
#else
|
||||
|
||||
#define INILINE_MAX 256
|
||||
#define DEG_TO_RAD (M_PIl/180)
|
||||
#define RAD_TO_DEG (180/M_PIl)
|
||||
|
||||
static int minZoom = 0;
|
||||
static int maxZoom = 18;
|
||||
static int verbose = 0;
|
||||
|
@ -10,12 +10,16 @@
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gen_tile.h"
|
||||
#include "protocol.h"
|
||||
#include "render_config.h"
|
||||
#include "dir_utils.h"
|
||||
|
||||
#define DEG_TO_RAD (M_PI/180)
|
||||
#define RAD_TO_DEG (180/M_PI)
|
||||
|
||||
#ifndef METATILE
|
||||
#warning("Speed test not implemented for non-metatile mode. Feel free to submit fix")
|
||||
int main(int argc, char **argv)
|
||||
@ -25,9 +29,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
#else
|
||||
|
||||
#define DEG_TO_RAD (M_PIl/180)
|
||||
#define RAD_TO_DEG (180/M_PIl)
|
||||
|
||||
static const int minZoom = 0;
|
||||
static const int maxZoom = 18;
|
||||
|
||||
@ -76,7 +77,7 @@ class GoogleProjection
|
||||
for (d=0; d<levels; d++) {
|
||||
int e = c/2;
|
||||
Bc[d] = c/360.0;
|
||||
Cc[d] = c/(2 * M_PIl);
|
||||
Cc[d] = c/(2 * M_PI);
|
||||
zc[d] = e;
|
||||
Ac[d] = c;
|
||||
c *=2;
|
||||
@ -93,7 +94,7 @@ class GoogleProjection
|
||||
double e = zc[zoom];
|
||||
double g = (y - e)/-Cc[zoom];
|
||||
x = (x - e)/Bc[zoom];
|
||||
y = RAD_TO_DEG * ( 2 * atan(exp(g)) - 0.5 * M_PIl);
|
||||
y = RAD_TO_DEG * ( 2 * atan(exp(g)) - 0.5 * M_PI);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user