// Run this program with : // gcc -Wall -lm density.c && ./a.out density.sh // // The input to it is a list of OO Calc expressions (sums) // Only the ranges are extracted. The actual calculations are ignored. // First it will output the osmosis command for generating the extracts // Then it will output a list of cells that are covered by none of the bboxes // (if any). It is recommended to add ranges until all cells are covered. // At the same time it will create and image map (density.html) and the // associated images. #include #include #include //#include "density.xbm" #define DIM 1024 int col[2], row[2], c, se = 0, cov[DIM][DIM], i, j, m, mat[DIM][DIM]; #define S 3 int split[S] = { 242, 418, 553 }, mid[S][4], bno, bcnt[S * 2 + 1]; char block[S * 2 + 1][98765], *bptr[S * 2 + 1]; #define N2(x) ((x) ? (x) + 'A' - 1 : '0') int main (void) { char fname[30]; FILE *html, *gosm = fopen ("jni/bboxes.c", "w"), *sh = fopen ("bboxSplit.sh", "w"); memset (cov, 0, sizeof (cov)); memset (mat, 0, sizeof (mat)); html= fopen ("density.html", "w"); fprintf (sh, "bzcat planet-latest.osm.bz2 | /home/nic/gosmore/bboxSplit \\\n"); fprintf (html, "\ \n\ \n\ Gosmore Map Selection\n\ \n\ \n\