You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(49) |
Sep
(25) |
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(24) |
Nov
(50) |
Dec
(4) |
2004 |
Jan
(2) |
Feb
(2) |
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
(10) |
Aug
(22) |
Sep
(10) |
Oct
|
Nov
(57) |
Dec
(5) |
2005 |
Jan
(24) |
Feb
(12) |
Mar
|
Apr
|
May
(3) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(5) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <le...@pr...> - 2005-01-22 09:51:46
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13037 Modified Files: Tag: leonard-dev main.c Log Message: correct problem with north and south sectors Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3.2.5 retrieving revision 1.3.2.6 diff -u -d -r1.3.2.5 -r1.3.2.6 --- main.c 22 Jan 2005 03:15:03 -0000 1.3.2.5 +++ main.c 22 Jan 2005 09:51:37 -0000 1.3.2.6 @@ -316,16 +316,16 @@ for (p = 1; p <= n; p++) { d = sqrt(n*n + p*p); LOS(n,p,n-1,p-1,n-1,p) /* ESE */ - LOS(-p,n,-(p-1),n-1,-(p-1),n) /* SSW */ + LOS(-p,n,-(p-1),n-1,-p,n-1) /* SSW */ LOS(-n,-p,-(n-1),-(p-1),-(n-1),-p) /* WNW */ - LOS(p,-n,p-1,-(n-1),p-1,-n) /* NNE */ + LOS(p,-n,p-1,-(n-1),p,-(n-1)) /* NNE */ } for (p = 0; p < n; p++) { d = sqrt(n*n + p*p); LOS(n,-p,n-1,-(p-1),n-1,-p) /* ENE */ - LOS(p,n,p-1,n-1,p-1,n) /* SSE */ + LOS(p,n,p-1,n-1,p,n-1) /* SSE */ LOS(-n,p,-(n-1),p-1,-(n-1),p) /* WSW */ - LOS(-p,-n,-(p-1),-(n-1),-(p-1),-n) /* NNW */ + LOS(-p,-n,-(p-1),-(n-1),-p,-(n-1)) /* NNW */ } } } |
From: <le...@pr...> - 2005-01-22 03:15:12
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13226 Modified Files: Tag: leonard-dev main.c Log Message: oops. didnt update d Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -u -d -r1.3.2.4 -r1.3.2.5 --- main.c 21 Jan 2005 23:12:45 -0000 1.3.2.4 +++ main.c 22 Jan 2005 03:15:03 -0000 1.3.2.5 @@ -297,7 +297,7 @@ #define LOS(x,y,xp,yp,xq,yq) \ if (-w2<(x) && (x)<w2 && -h2<(y) && (y)<h2) { \ float az, azprev, azmaxprev; \ - az = (H(x,y) - h0) / d; \ + az = (H(x,y) - h0) / d; \ if (isnanf(az)) az = ZENITH; \ azprev = AZ(xp,yp)*(p/n) + \ AZ(xq,yq)*(1-p/n); \ @@ -314,12 +314,14 @@ } for (p = 1; p <= n; p++) { + d = sqrt(n*n + p*p); LOS(n,p,n-1,p-1,n-1,p) /* ESE */ LOS(-p,n,-(p-1),n-1,-(p-1),n) /* SSW */ LOS(-n,-p,-(n-1),-(p-1),-(n-1),-p) /* WNW */ LOS(p,-n,p-1,-(n-1),p-1,-n) /* NNE */ } for (p = 0; p < n; p++) { + d = sqrt(n*n + p*p); LOS(n,-p,n-1,-(p-1),n-1,-p) /* ENE */ LOS(p,n,p-1,n-1,p-1,n) /* SSE */ LOS(-n,p,-(n-1),p-1,-(n-1),p) /* WSW */ |
From: <le...@pr...> - 2005-01-21 23:12:59
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26263 Modified Files: Tag: leonard-dev main.c Log Message: fix bug where initial height was sub-surface Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -d -r1.3.2.3 -r1.3.2.4 --- main.c 21 Jan 2005 16:05:25 -0000 1.3.2.3 +++ main.c 21 Jan 2005 23:12:45 -0000 1.3.2.4 @@ -96,7 +96,7 @@ int i; int vflag = 0; int lflag = 0; - double lvalue = 0; + double lvalue = 0, h0; double e0, n0, scale, e, n; int w, h, w2, h2; char *Shiftfile = NULL; @@ -196,6 +196,10 @@ exit(0); } + if (lflag) { + h0 = lvalue + alt_fastat(&alt, e0, n0); + } + /* if no crosses, put one in the centre */ if (ncross == 0) { cr = newcross(); @@ -240,7 +244,7 @@ 1.0/scale, 1.0/scale); } else { /* generate PNG output */ - image_set_type(IMAGE_TYPE_JPG); + image_set_type(IMAGE_TYPE_PNM); image_begin(w, h); } @@ -293,7 +297,7 @@ #define LOS(x,y,xp,yp,xq,yq) \ if (-w2<(x) && (x)<w2 && -h2<(y) && (y)<h2) { \ float az, azprev, azmaxprev; \ - az = (H(x,y) - lvalue) / d; \ + az = (H(x,y) - h0) / d; \ if (isnanf(az)) az = ZENITH; \ azprev = AZ(xp,yp)*(p/n) + \ AZ(xq,yq)*(1-p/n); \ |
From: <le...@pr...> - 2005-01-21 16:07:40
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17182 Modified Files: Tag: leonard-dev map3b.php Log Message: use LOS when a nodeid is selected Index: map3b.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/map3b.php,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -d -r1.4.2.1 -r1.4.2.2 --- map3b.php 7 Nov 2004 05:50:06 -0000 1.4.2.1 +++ map3b.php 21 Jan 2005 16:07:26 -0000 1.4.2.2 @@ -12,12 +12,12 @@ include("config.php"); include("util.php"); -$e = doubleval($e); -$n = doubleval($n); -$w = intval($w); -$h = intval($h); -$s = doubleval($s); -$vrml = intval($vrml); +$e = doubleval($_GET["e"]); +$n = doubleval($_GET["n"]); +$w = intval($_GET["w"]); +$h = intval($_GET["h"]); +$s = doubleval($_GET["s"]); +$vrml = intval($_GET["vrml"]); $maxage = intval($_GET["maxage"]); if (!$maxage) $maxage = $PREF["maxnodeage"]; @@ -38,15 +38,17 @@ if ($vrml) header("Content-type: model/vrml"); else - header("Content-type: image/png"); + header("Content-type: image/jpeg"); if ($REQUEST_METHOD == "HEAD") exit; +debug("w=$w h=$h s=$s"); $De = $w / $s / 2; $Dn = $h / $s / 2; $q = "SELECT" ." admin.nodeid AS nodeid," ." e," - ." n" + ." n," + ." h" ." FROM admin,physloc" ." WHERE admin.nodeid = physloc.nodeid" ." AND n>".($n-$Dn) @@ -58,17 +60,25 @@ $c = ""; $result = mysql_query($q, $db); while ($row = mysql_fetch_assoc($result)) { - if (isset($t[$row["nodeid"]])) + if (isset($t[$row["nodeid"]])) { $x = $t[$row["nodeid"]]; - else + if ($x == "X" && $row["h"]) { + $los = " -l ".$row["h"]; + } + } else $x = "x"; if ($x == 'o' || $x == 'X' || $x == 'x') $c .= " -$x ".doubleval($row["e"])." ".doubleval($row["n"]); } +debug("$BINDIR/alt" + ." -A ${ALTFILE} -S ${SHIFTFILE}" + .($vrml ? " -v" : "") . $los + ." $c -- $e $n $w $h $s"); + mypassthru("$BINDIR/alt" ." -A ${ALTFILE} -S ${SHIFTFILE}" - .($vrml ? " -v" : "") + .($vrml ? " -v" : "") . $los ." $c -- $e $n $w $h $s"); exit; |
Update of /cvsroot/meshdb/src/geo/libgeo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16626/libgeo Modified Files: Tag: leonard-dev image-png.c image-ppm.c image.h Makefile.am Added Files: Tag: leonard-dev image-jpeg.c image-private.h image.c Log Message: fix alt; make image libs selectable (jpg is still buggy?) --- NEW FILE: image-jpeg.c --- #include <stdio.h> #include "compat/err.h" #include "image.h" #include "image-private.h" #include "jpeglib.h" static struct jpeg_error_mgr jerr; static struct jpeg_compress_struct cinfo; static JSAMPLE *sample; static int xpos; static int xwidth; static void image_jpg_begin(width, height) int width, height; { cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); jpeg_stdio_dest(&cinfo, stdout); cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = 3; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); jpeg_start_compress(&cinfo, TRUE); sample = (JSAMPLE *)malloc(width * 3 * sizeof (char)); xpos = 0; xwidth = width; } static void image_jpg_write_rgb(rgb) rgb_t *rgb; { memcpy((char *)sample + 3 * xpos, rgb, 3); xpos++; if (xpos >= xwidth) { JSAMPROW row_pointer[1]; row_pointer[0] = sample; jpeg_write_scanlines(&cinfo, row_pointer, 1); xpos = 0; } } static void image_jpg_end() { jpeg_finish_compress(&cinfo); jpeg_destroy_compress(&cinfo); free(sample); } struct image_class image_jpg_class = { IMAGE_TYPE_JPG, image_jpg_begin, image_jpg_write_rgb, image_jpg_end }; --- NEW FILE: image-private.h --- struct image_class { const char *type; void (*begin)(int width, int height); void (*write_rgb)(rgb_t *rgb); void (*end)(void); }; --- NEW FILE: image.c --- #include <stdio.h> #include <stdlib.h> #include "compat/err.h" #include "image.h" #include "image-private.h" extern struct image_class image_png_class; extern struct image_class image_pnm_class; extern struct image_class image_jpg_class; static struct image_class *selected_class = &image_png_class; static struct image_class *known_classes[] = { &image_png_class, &image_pnm_class, &image_jpg_class }; static int samples_remaining; void image_set_type(type) const char *type; { int i; for (i = 0; i < sizeof known_classes / sizeof *known_classes; i++) if (strcmp(type, known_classes[i]->type) == 0) { selected_class = known_classes[i]; return; } errx(1, "image_set_type: unknown type %s", type); } const char * image_get_type() { return selected_class->type; } void image_begin(w, h) int w, h; { (*selected_class->begin)(w,h); samples_remaining = w * h; } void image_write_rgb(rgb) rgb_t *rgb; { if (samples_remaining <= 0) warnx("image_write_rgb: Too many samples!"); (*selected_class->write_rgb)(rgb); samples_remaining--; } void image_write3(r, g, b) unsigned char r, g, b; { rgb_t rgb = { r, g, b }; image_write_rgb(&rgb); } void image_end() { if (samples_remaining != 0) warnx("image_end: Too few samples written (%d more)!", samples_remaining); (*selected_class->end)(); fflush(stdout); } Index: image-png.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/image-png.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- image-png.c 24 Nov 2003 07:04:49 -0000 1.2 +++ image-png.c 21 Jan 2005 16:05:23 -0000 1.2.2.1 @@ -4,6 +4,7 @@ #include "compat/err.h" #include "png.h" #include "image.h" +#include "image-private.h" #ifndef png_jmpbuf # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) @@ -14,8 +15,8 @@ static int width, height; static int xpos, xmax; -void -image_begin(w, h) +static void +image_png_begin(w, h) int w, h; { int i; @@ -29,8 +30,8 @@ xpos = 0; } -void -image_write_rgb(rgb) +static void +image_png_write_rgb(rgb) rgb_t *rgb; { if (xpos < xmax) { @@ -44,15 +45,7 @@ } void -image_write3(r, g, b) - unsigned char r, g, b; -{ - rgb_t rgb = { r, g, b }; - image_write_rgb(&rgb); -} - -void -image_end() +image_png_end() { png_structp png_ptr; png_infop info_ptr; @@ -81,10 +74,18 @@ info_ptr->color_type = PNG_COLOR_TYPE_RGB; info_ptr->interlace_type = PNG_INTERLACE_ADAM7; png_set_rows(png_ptr, info_ptr, rows); - png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); + png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION); png_write_png(png_ptr, info_ptr, NULL, NULL); png_destroy_write_struct(&png_ptr, &info_ptr); free(rows); free(data); } + +struct image_class image_png_class = { + IMAGE_TYPE_PNG, + image_png_begin, + image_png_write_rgb, + image_png_end +}; + Index: image-ppm.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/image-ppm.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- image-ppm.c 10 Aug 2002 03:51:32 -0000 1.1.1.1 +++ image-ppm.c 21 Jan 2005 16:05:24 -0000 1.1.1.1.2.1 @@ -1,30 +1,29 @@ #include <stdio.h> #include "image.h" +#include "image-private.h" -void -image_begin(width, height) +static void +pnm_image_begin(width, height) int width, height; { printf("P6\n%u %u 255\n", width, height); } -void -image_write_rgb(rgb) +static void +pnm_image_write_rgb(rgb) rgb_t *rgb; { fwrite(rgb, sizeof *rgb, 1, stdout); } -void -image_write3(r, g, b) - unsigned char r, g, b; +static void +pnm_image_end() { - rgb_t rgb = { r, g, b }; - image_write_rgb(&rgb); } -void -image_end() -{ - fflush(stdout); -} +struct image_class image_pnm_class = { + IMAGE_TYPE_PNM, + pnm_image_begin, + pnm_image_write_rgb, + pnm_image_end +}; Index: image.h =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/image.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- image.h 10 Aug 2002 03:51:32 -0000 1.1.1.1 +++ image.h 21 Jan 2005 16:05:25 -0000 1.1.1.1.2.1 @@ -8,3 +8,9 @@ void image_write_rgb(rgb_t *rgb); void image_write3(unsigned char r, unsigned char g, unsigned char b); void image_end(void); + +#define IMAGE_TYPE_PNM "image/pnm" +#define IMAGE_TYPE_PNG "image/png" +#define IMAGE_TYPE_JPG "image/jpeg" +void image_set_type(const char *); +const char *image_get_type(void); Index: Makefile.am =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/Attic/Makefile.am,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- Makefile.am 7 Nov 2004 12:16:34 -0000 1.1.2.2 +++ Makefile.am 21 Jan 2005 16:05:25 -0000 1.1.2.3 @@ -4,5 +4,5 @@ lib_LIBRARIES = libgeo.a libgeo_a_SOURCES = alt.c qt.c ntv2.c spread.c geodesy.c vincenty.c inclin.c -libgeo_a_SOURCES += image-png.c +libgeo_a_SOURCES += image.c image-ppm.c image-png.c image-jpeg.c |
From: <le...@pr...> - 2005-01-21 16:05:36
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16626/alt Modified Files: Tag: leonard-dev main.c Log Message: fix alt; make image libs selectable (jpg is still buggy?) Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -d -r1.3.2.2 -r1.3.2.3 --- main.c 21 Jan 2005 14:12:37 -0000 1.3.2.2 +++ main.c 21 Jan 2005 16:05:25 -0000 1.3.2.3 @@ -25,12 +25,6 @@ #include "compat/compat.h" #include "compat/err.h" -/* -#define image_begin(w, h) printf("P6\n%u %u 255\n",w,h) -#define image_write_rgb(r) fwrite(r,3,1,stdout) -#define image_end() fflush(stdout) -*/ - #define CROSS 2 #define CROSS2 3 @@ -246,6 +240,7 @@ 1.0/scale, 1.0/scale); } else { /* generate PNG output */ + image_set_type(IMAGE_TYPE_JPG); image_begin(w, h); } @@ -299,7 +294,7 @@ if (-w2<(x) && (x)<w2 && -h2<(y) && (y)<h2) { \ float az, azprev, azmaxprev; \ az = (H(x,y) - lvalue) / d; \ - if (isinf(az)) az = ZENITH; \ + if (isnanf(az)) az = ZENITH; \ azprev = AZ(xp,yp)*(p/n) + \ AZ(xq,yq)*(1-p/n); \ azmaxprev = AZMAX(xp,yp)*(p/n) + \ @@ -415,10 +410,8 @@ printf("\n ]\n" " }\n" "}\n"); - else { + else image_end(); - fflush(stdout); - } exit(0); } |
From: <le...@pr...> - 2005-01-21 14:12:45
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22710 Modified Files: Tag: leonard-dev main.c Log Message: add "-l <height>" flag to do line-of-sight. make texturing greyscale. Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -d -r1.3.2.1 -r1.3.2.2 --- main.c 7 Nov 2004 09:49:42 -0000 1.3.2.1 +++ main.c 21 Jan 2005 14:12:37 -0000 1.3.2.2 @@ -25,6 +25,12 @@ #include "compat/compat.h" #include "compat/err.h" +/* +#define image_begin(w, h) printf("P6\n%u %u 255\n",w,h) +#define image_write_rgb(r) fwrite(r,3,1,stdout) +#define image_end() fflush(stdout) +*/ + #define CROSS 2 #define CROSS2 3 @@ -37,6 +43,8 @@ struct cross *cross = NULL; int ncross = 0; +static int debug = 0; + static const float NaN = 0.0f/0.0f; static const float Inf = 1.0f/0.0f; @@ -93,26 +101,52 @@ int tflag = 0; int i; int vflag = 0; + int lflag = 0; + double lvalue = 0; double e0, n0, scale, e, n; int w, h, w2, h2; char *Shiftfile = NULL; char *Altfile = NULL; struct cross *cr; int zone = 56; + float shade; + float *hm, *azm, *azmaxm; + char *visiblem; - while ((ch = getopt(argc, argv, "S:A:to:x:X:F:v")) != -1) + fprintf(stderr, "ALT:"); + for (i = 0; i < argc; i++) fprintf(stderr, " \"%s\"", argv[i]); + fprintf(stderr, "\n"); + + while ((ch = getopt(argc, argv, "A:F:S:dl:tvz:X:o:x:")) != -1) switch (ch) { + case 'A': + Altfile = optarg; + break; + case 'F': + loadfile(optarg); + break; case 'S': Shiftfile = optarg; break; - case 'A': - Altfile = optarg; + case 'd': + debug++; + break; + case 'l': + /* Line-of-sight initial altitude */ + lflag = 1; + sscanf(optarg, "%lf", &lvalue); break; case 't': tflag = 1; break; - case 'o': + case 'v': + vflag = 1; + break; + case 'z': + zone = atoi(optarg); + break; case 'X': + case 'o': case 'x': if (argv[optind] == NULL) { error = 1; @@ -124,15 +158,6 @@ sscanf(argv[optind], "%lf", &cr->n); optind++; break; - case 'F': - loadfile(optarg); - break; - case 'z': - zone = atoi(optarg); - break; - case 'v': - vflag = 1; - break; default: error = 1; } @@ -143,13 +168,17 @@ if (error) { fprintf(stderr, "usage: %s" - " [-S shift.gsb] [-A alt.desc] [-t] [-v]" + " [-dtvl]" + " [-S shift.gsb] [-A alt.desc]" " [-F filename]*" " [-[x|X|o] e n]*" " e n w h [scale]\n", argv[0]); exit(1); } + if (lflag && (vflag || tflag)) + errx(1, "-l incompatible with -v and -t"); + /* Read the rest of the arguments */ sscanf(argv[optind], "%lf", &e0); sscanf(argv[optind+1], "%lf", &n0); @@ -190,8 +219,9 @@ cross[i].kind = 0; /* make invisible */ } - /* generate PPM output by reading individual pixels */ + if (vflag) { + /* Generate VRML output */ printf("#VRML V2.0 utf8\n"); printf("# $Id$\n"); printf("# Brisbane Mesh www.brismesh.org\n" @@ -214,92 +244,181 @@ " height [\n", w2 * 2, h2 * 2, 1.0/scale, 1.0/scale); - } else + } else { + /* generate PNG output */ image_begin(w, h); + } + + if (debug > 1) + { extern int ntv2_verbose, qtdebug, altdebug; + fprintf(stderr, "alt: "); + ntv2_verbose++; + alt_print_at(&alt, e0, n0); + ntv2_verbose--; + qtdebug++; altdebug++; + fprintf(stderr, " = %f", alt_at(&alt, e0, n0)); + qtdebug--; altdebug--; + fprintf(stderr, "\n"); + } + + /* Allocate the height map as (w+2)*(h+2) floats. */ + hm = (float *)malloc((w+2) * (h+2) * sizeof (float)); + + /* Shift hm so that H[-h2-1,-w2-1] == h[0] (step of w+1) */ +#define MAP(m,x,y) (m)[(x) + (w+2)*(y) - (w+2)*(h+2)/2] +#define H(x,y) MAP(hm,x,y) + + /* Compute the height map */ + for (y = -h2 -1; y <= h2; y++) { + n = n0 - y / scale; + for (x = -w2 -1; x <= w2; x++) { + e = e0 + x / scale; + H(x,y) = alt_fastat(&alt, e, n); + } + } + + if (lflag) { + int n, nmax = w2 > h2 ? w2 : h2; + + azm = (float *)malloc((w+2) * (h+2) * sizeof (float)); + azmaxm = (float *)malloc((w+2) * (h+2) * sizeof (float)); + visiblem = (char *)malloc((w+2) * (h+2) * sizeof (char)); +#define AZ(x,y) MAP(azm,x,y) +#define AZMAX(x,y) MAP(azmaxm,x,y) +#define VISIBLE(x,y) MAP(visiblem,x,y) +#define ZENITH (-Inf) + + AZ(0,0) = AZMAX(0,0) = ZENITH; + VISIBLE(0,0) = 1; + + for (n = 1; n < nmax; n++) { + int p; + float d; + +#define LOS(x,y,xp,yp,xq,yq) \ + if (-w2<(x) && (x)<w2 && -h2<(y) && (y)<h2) { \ + float az, azprev, azmaxprev; \ + az = (H(x,y) - lvalue) / d; \ + if (isinf(az)) az = ZENITH; \ + azprev = AZ(xp,yp)*(p/n) + \ + AZ(xq,yq)*(1-p/n); \ + azmaxprev = AZMAX(xp,yp)*(p/n) + \ + AZMAX(xq,yq)*(1-p/n); \ + if (az < azmaxprev) { \ + AZMAX(x,y) = azmaxprev; \ + VISIBLE(x,y) = 0; \ + } else { \ + AZMAX(x,y) = az; \ + VISIBLE(x,y) = 1; \ + } \ + AZ(x,y) = az; \ + } + + for (p = 1; p <= n; p++) { + LOS(n,p,n-1,p-1,n-1,p) /* ESE */ + LOS(-p,n,-(p-1),n-1,-(p-1),n) /* SSW */ + LOS(-n,-p,-(n-1),-(p-1),-(n-1),-p) /* WNW */ + LOS(p,-n,p-1,-(n-1),p-1,-n) /* NNE */ + } + for (p = 0; p < n; p++) { + LOS(n,-p,n-1,-(p-1),n-1,-p) /* ENE */ + LOS(p,n,p-1,n-1,p-1,n) /* SSE */ + LOS(-n,p,-(n-1),p-1,-(n-1),p) /* WSW */ + LOS(-p,-n,-(p-1),-(n-1),-(p-1),-n) /* NNW */ + } + } + } + for (y = -h2; y < h2; y++) { - n = n0 - y / scale; for (x = -w2; x < w2; x++) { int iscross = 0; - float f; - e = e0 + x / scale; - f = alt_fastat(&alt, e, n); + float f = H(x,y); + /* VRML is easy */ if (vflag) { if (isnanf(f)) printf(" 0"); else printf(" %.2f", f); - } else { + continue; + } - for (i = 0; i < ncross && !iscross; i++) { - int dx, dy; - switch (cross[i].kind) { - case 0: - break; + /* Is this pixel on a cross/circle? */ + for (i = 0; i < ncross && !iscross; i++) { + int dx, dy; + switch (cross[i].kind) { + case 0: + break; - case 'X': - dx = x - cross[i].x; - dy = y - cross[i].y; - if ((dx == dy || dx == -dy) && - (-CROSS2 < dx && dx < CROSS2)) - iscross = 1; - break; + case 'X': + dx = x - cross[i].x; + dy = y - cross[i].y; + if ((dx == dy || dx == -dy) && + (-CROSS2 < dx && dx < CROSS2)) + iscross = 1; + break; - case 'x': - dx = x - cross[i].x; - dy = y - cross[i].y; - if ((dx == dy || dx == -dy) && - (-CROSS < dx && dx < CROSS)) - iscross = 1; - break; + case 'x': + dx = x - cross[i].x; + dy = y - cross[i].y; + if ((dx == dy || dx == -dy) && + (-CROSS < dx && dx < CROSS)) + iscross = 1; + break; - case 'o': - dx = x - cross[i].x; - dy = y - cross[i].y; - if (dx*dx+dy*dy < (CROSS2+1)*(CROSS2+1) && - dx*dx+dy*dy >= (CROSS2-0)*(CROSS2-0)) - iscross = 1; - break; - } + case 'o': + dx = x - cross[i].x; + dy = y - cross[i].y; + if (dx*dx+dy*dy < (CROSS2+1)*(CROSS2+1) && + dx*dx+dy*dy >= (CROSS2-0)*(CROSS2-0)) + iscross = 1; + break; } + } + + /* Crosses (and circles in red) */ + if (iscross) { + rgb[0] = 255; + rgb[1] = rgb[2] = 0; + goto plot; + } + + if (isnanf(f)) { + /* Unknown data (sea) is black */ + rgb[0] = rgb[1] = rgb[2] = 0; + goto plot; + } + + /* + * Shade the pixel after determining the + * cosine of the normal to the top-left sun + */ + shade = (f - H(x-1,y-1)) / ((fmax-fmin) * 0.3) + 0.5; + if (shade < 0) shade = 0; + if (shade > 1) shade = 1; + + rgb[0] = rgb[1] = rgb[2] = 255 * shade; + + /* Tinge with blue if visible */ + if (lflag && VISIBLE(x,y)) + rgb[2] = 255 - (255-rgb[2])/4; - if (iscross) - rgb[0] = rgb[1] = rgb[2] = 255; - else { - if (isnanf(f)) - /* Unknown data (sea) is black */ - rgb[0] = rgb[1] = rgb[2] = 0; - else if (f < fmin) { - /* sub-minima is blue */ - rgb[0] = 0; - rgb[1] = 0; - rgb[2] = 128; - } else if (f > fmax) { - /* super-maxima is green */ - rgb[0] = 0; - rgb[1] = 255; - rgb[2] = 0; - } else { - /* everything else is in between */ - float i = (f - fmin)/(fmax - fmin); - rgb[0] = 0; - rgb[1] = i * 255.0; - rgb[2] = (1.0 - i) * (i*0.5+0.5) * 255.0; - } /* fprintf(stderr, "[%d,%d] = %lf,%lf -> %f -> <%u,%u,%u>\n", - x,y,lon,lat,f,rgb[0],rgb[1],rgb[2]); +x,y,lon,lat,f,rgb[0],rgb[1],rgb[2]); */ - } - image_write_rgb(&rgb); - } + + plot: + image_write_rgb(&rgb); } } if (vflag) printf("\n ]\n" " }\n" "}\n"); - else + else { image_end(); + fflush(stdout); + } exit(0); } |
From: <il...@pr...> - 2004-12-27 05:52:21
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31710 Modified Files: main.c Log Message: We only need to add an extra tile width/height once, else we'll end up with a larger quadtree than we need. Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/make-hgt-qt/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- main.c 27 Dec 2004 04:13:46 -0000 1.3 +++ main.c 27 Dec 2004 05:52:13 -0000 1.4 @@ -86,8 +86,8 @@ ewmax += 1; snmax += 1; - w = RES * (ewmax - ewmin + 1) + 1; - h = RES * (snmax - snmin + 1) + 1; + w = RES * (ewmax - ewmin) + 1; + h = RES * (snmax - snmin) + 1; csz = 1./RES; nodata = -32768; |
From: <il...@pr...> - 2004-12-27 04:13:55
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18719 Modified Files: main.c Log Message: Include inttypes.h and netinet/in.h for ntohs() on Solaris. Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/make-hgt-qt/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- main.c 27 Dec 2004 04:09:10 -0000 1.2 +++ main.c 27 Dec 2004 04:13:46 -0000 1.3 @@ -9,13 +9,16 @@ * David Leonard, 2004. Public domain. */ +#include <sys/types.h> + #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <err.h> #include <errno.h> +#include <inttypes.h> #include <fcntl.h> -#include <err.h> -#include <sys/types.h> +#include <netinet/in.h> #include <sys/mman.h> #include <unistd.h> |
From: <il...@pr...> - 2004-12-27 04:10:07
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18100 Added Files: .cvsignore Log Message: Ignore the built binary. --- NEW FILE: .cvsignore --- make-hgt-qt |
From: <il...@pr...> - 2004-12-27 04:09:19
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18030 Modified Files: main.c Log Message: Merge from leonard-dev: working programme to import SRTM tiles to meshdb format. Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/make-hgt-qt/main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- main.c 20 Sep 2004 13:37:19 -0000 1.1 +++ main.c 27 Dec 2004 04:09:10 -0000 1.2 @@ -11,6 +11,7 @@ #include <stdio.h> #include <string.h> +#include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <err.h> @@ -19,7 +20,9 @@ #include <unistd.h> #include "compat/compat.h" -#include "qt.h" +#include "libgeo/qt.h" + +#define RES 1200 int main(argc, argv) @@ -30,8 +33,8 @@ int qtfd; unsigned long w, h, i; int16_t nodata; - float v, xll, yll, csz; - int first; + float v, csz; + int first, *ew, *sn; off_t mark; char *infile; char *qtdata; @@ -43,30 +46,49 @@ int n; char *s, SN[2], EW[2]; int sndeg, ewdeg; + int ewmin, ewmax, snmin, snmax; - if (argc != 4) { - fprintf(stderr, "usage: %s infile qt.data qt.desc\n", argv[0]); + if (argc <= 3) { + fprintf(stderr, "usage: %s qt.data qt.desc file...\n", argv[0]); exit(1); } - infile = argv[1]; - qtdata = argv[2]; - qtdesc = argv[3]; + qtdata = argv[1]; + qtdesc = argv[2]; - s = strrchr(infile, '/'); - s = s == NULL ? infile : s + 1; - if (sscanf(s, "%1[SN]%u%1[EW]%u.", SN, &sndeg, EW, &ewdeg) != 4) - errx(1, "%s: not in the format '*/[SN]num[EW]num.hgt'", s); - xll = (*EW == 'E') ? ewdeg : -ewdeg; - yll = (*SN == 'N') ? sndeg : -sndeg; - w = 1201; - h = 1201; - csz = 1./1200; - nodata = -32768; + ew = (int *)alloca((argc - 3) * sizeof (int)); + sn = (int *)alloca((argc - 3) * sizeof (int)); - if ((f = fopen(infile, "r")) == NULL) - err(1, "%s", infile); + /* Compute the total enclosing rectangle */ + for (i = 3; i < argc; i++) { + infile = argv[i]; + s = strrchr(infile, '/'); + s = s == NULL ? infile : s + 1; + if (sscanf(s, "%1[SN]%u%1[EW]%u.", SN, &sndeg, EW, &ewdeg) != 4) + errx(1, "%s: not in the format '[SN]num[EW]num.hgt'", s); + if (*EW == 'W') ewdeg = -ewdeg; + if (*SN == 'S') sndeg = -sndeg; + fprintf(stderr, "%s -> %d,%d\n", infile, ewdeg, sndeg); + if (i == 3) { + ewmin = ewmax = ewdeg; + snmin = snmax = sndeg; + } else { + if (ewdeg < ewmin) ewmin = ewdeg; + if (ewdeg > ewmax) ewmax = ewdeg; + if (sndeg < snmin) snmin = sndeg; + if (sndeg > snmax) snmax = sndeg; + } + ew[i - 3] = ewdeg; + sn[i - 3] = sndeg; + } + ewmax += 1; + snmax += 1; - fprintf(stderr, "xll = %f, yll = %f\n", xll, yll); + w = RES * (ewmax - ewmin + 1) + 1; + h = RES * (snmax - snmin + 1) + 1; + csz = 1./RES; + nodata = -32768; + + fprintf(stderr, "xll = %d, yll = %d\n", ewmin, snmin); fprintf(stderr, "w x h = %lu x %lu\nnodata = %d\n", w, h, nodata); if ((qtfd = open(qtdata, O_TRUNC|O_CREAT|O_RDWR, 0666)) == -1) @@ -81,8 +103,8 @@ fprintf(desc, "width %d\nheight %d\nelement_size %d\nfilename %s\n", qtw, qth, sizeof (float), qtdata); fprintf(desc, "xll %f\nyll %f\ncellsz %f\n", - xll + csz/2, - yll + csz/2, + (float)ewmin + csz/2, + (float)snmin + csz/2, csz); fflush(desc); @@ -103,25 +125,40 @@ ((float *)qt->data)[x] = v; /* Fill in the quadtree */ - fprintf(stderr, "filling in quadtree: "); - progress = 0; - for (y = 0; y < h; y++) { - if (y * 100 / h >= progress) { + for (i = 3; i < argc; i++) { + int xo = (ew[i - 3] - ewmin) * RES; + int yo = (sn[i - 3] - snmin) * RES; + const unsigned long hh = RES + 1; + const unsigned long ww = RES + 1; + + infile = argv[i]; + fprintf(stderr, "filling from %s @ %d,%d -> %d,%d:\n", + infile, ew[i-3], sn[i-3], xo, yo); + + if ((f = fopen(infile, "r")) == NULL) + err(1, "%s", infile); + + progress = 0; + for (y = 0; y < hh; y++) { + int yy = hh - y; + if (y * 100 / hh >= progress) { fprintf(stderr, "%d%% ", progress); - progress = 10 + y * 100 / h; + progress = 10 + y * 100 / hh; } - for (x = 0; x < w; x++) { + for (x = 0; x < ww; x++) { int16_t a,b; float *fp; fread(&a, sizeof a, 1, f); b = ntohs(a); - fp = qtgetpoint_byindex(qt, x, y); + fp = qtgetpoint_byindex(qt, x + xo, yo + yy); if (b != nodata) *fp = b; } + } + fprintf(stderr, " ok\n"); } - fprintf(stderr, "\nsync\n"); + fprintf(stderr, "sync\n"); fclose(f); qtfree(qt); |
From: <le...@pr...> - 2004-12-21 12:42:23
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18702 Modified Files: Tag: leonard-dev main.c Log Message: This now works. The make-hgt-qt program takes a set of SRTM .hgt files as arguments, automatically figures out their coordinates (based on their filename) and then generates a large qt altitude map. output file size is limited by mmap; i hit problems at about 18 tiles. For Brismesh, the following tile set seems to be sufficient. S27E151.hgt S28E151.hgt S29E151.hgt S30E151.hgt S31E151.hgt S27E152.hgt S28E152.hgt S29E152.hgt S30E152.hgt S31E152.hgt S27E153.hgt S28E153.hgt S29E153.hgt S30E153.hgt S31E153.hgt Note that the water in these sets appears to be ground, and my raw data has holes in it. Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/make-hgt-qt/main.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- main.c 7 Nov 2004 09:49:44 -0000 1.1.2.1 +++ main.c 21 Dec 2004 12:42:15 -0000 1.1.2.2 @@ -11,6 +11,7 @@ #include <stdio.h> #include <string.h> +#include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <err.h> @@ -21,6 +22,8 @@ #include "compat/compat.h" #include "libgeo/qt.h" +#define RES 1200 + int main(argc, argv) int argc; @@ -30,8 +33,8 @@ int qtfd; unsigned long w, h, i; int16_t nodata; - float v, xll, yll, csz; - int first; + float v, csz; + int first, *ew, *sn; off_t mark; char *infile; char *qtdata; @@ -43,30 +46,49 @@ int n; char *s, SN[2], EW[2]; int sndeg, ewdeg; + int ewmin, ewmax, snmin, snmax; - if (argc != 4) { - fprintf(stderr, "usage: %s infile qt.data qt.desc\n", argv[0]); + if (argc <= 3) { + fprintf(stderr, "usage: %s qt.data qt.desc file...\n", argv[0]); exit(1); } - infile = argv[1]; - qtdata = argv[2]; - qtdesc = argv[3]; + qtdata = argv[1]; + qtdesc = argv[2]; - s = strrchr(infile, '/'); - s = s == NULL ? infile : s + 1; - if (sscanf(s, "%1[SN]%u%1[EW]%u.", SN, &sndeg, EW, &ewdeg) != 4) - errx(1, "%s: not in the format '*/[SN]num[EW]num.hgt'", s); - xll = (*EW == 'E') ? ewdeg : -ewdeg; - yll = (*SN == 'N') ? sndeg : -sndeg; - w = 1201; - h = 1201; - csz = 1./1200; - nodata = -32768; + ew = (int *)alloca((argc - 3) * sizeof (int)); + sn = (int *)alloca((argc - 3) * sizeof (int)); - if ((f = fopen(infile, "r")) == NULL) - err(1, "%s", infile); + /* Compute the total enclosing rectangle */ + for (i = 3; i < argc; i++) { + infile = argv[i]; + s = strrchr(infile, '/'); + s = s == NULL ? infile : s + 1; + if (sscanf(s, "%1[SN]%u%1[EW]%u.", SN, &sndeg, EW, &ewdeg) != 4) + errx(1, "%s: not in the format '[SN]num[EW]num.hgt'", s); + if (*EW == 'W') ewdeg = -ewdeg; + if (*SN == 'S') sndeg = -sndeg; + fprintf(stderr, "%s -> %d,%d\n", infile, ewdeg, sndeg); + if (i == 3) { + ewmin = ewmax = ewdeg; + snmin = snmax = sndeg; + } else { + if (ewdeg < ewmin) ewmin = ewdeg; + if (ewdeg > ewmax) ewmax = ewdeg; + if (sndeg < snmin) snmin = sndeg; + if (sndeg > snmax) snmax = sndeg; + } + ew[i - 3] = ewdeg; + sn[i - 3] = sndeg; + } + ewmax += 1; + snmax += 1; - fprintf(stderr, "xll = %f, yll = %f\n", xll, yll); + w = RES * (ewmax - ewmin + 1) + 1; + h = RES * (snmax - snmin + 1) + 1; + csz = 1./RES; + nodata = -32768; + + fprintf(stderr, "xll = %d, yll = %d\n", ewmin, snmin); fprintf(stderr, "w x h = %lu x %lu\nnodata = %d\n", w, h, nodata); if ((qtfd = open(qtdata, O_TRUNC|O_CREAT|O_RDWR, 0666)) == -1) @@ -81,8 +103,8 @@ fprintf(desc, "width %d\nheight %d\nelement_size %d\nfilename %s\n", qtw, qth, sizeof (float), qtdata); fprintf(desc, "xll %f\nyll %f\ncellsz %f\n", - xll + csz/2, - yll + csz/2, + (float)ewmin + csz/2, + (float)snmin + csz/2, csz); fflush(desc); @@ -103,25 +125,40 @@ ((float *)qt->data)[x] = v; /* Fill in the quadtree */ - fprintf(stderr, "filling in quadtree: "); - progress = 0; - for (y = 0; y < h; y++) { - if (y * 100 / h >= progress) { + for (i = 3; i < argc; i++) { + int xo = (ew[i - 3] - ewmin) * RES; + int yo = (sn[i - 3] - snmin) * RES; + const unsigned long hh = RES + 1; + const unsigned long ww = RES + 1; + + infile = argv[i]; + fprintf(stderr, "filling from %s @ %d,%d -> %d,%d:\n", + infile, ew[i-3], sn[i-3], xo, yo); + + if ((f = fopen(infile, "r")) == NULL) + err(1, "%s", infile); + + progress = 0; + for (y = 0; y < hh; y++) { + int yy = hh - y; + if (y * 100 / hh >= progress) { fprintf(stderr, "%d%% ", progress); - progress = 10 + y * 100 / h; + progress = 10 + y * 100 / hh; } - for (x = 0; x < w; x++) { + for (x = 0; x < ww; x++) { int16_t a,b; float *fp; fread(&a, sizeof a, 1, f); b = ntohs(a); - fp = qtgetpoint_byindex(qt, x, y); + fp = qtgetpoint_byindex(qt, x + xo, yo + yy); if (b != nodata) *fp = b; } + } + fprintf(stderr, " ok\n"); } - fprintf(stderr, "\nsync\n"); + fprintf(stderr, "sync\n"); fclose(f); qtfree(qt); |
From: <il...@pr...> - 2004-11-17 12:37:23
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1972 Modified Files: ipv6-pi-addr.php Log Message: Use the correct format prefix as recommended in the I-D (in binary, not hex, duh). Be bold and display the FP in the calculated address. Index: ipv6-pi-addr.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/ipv6-pi-addr.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ipv6-pi-addr.php 17 Nov 2004 12:01:35 -0000 1.1 +++ ipv6-pi-addr.php 17 Nov 2004 12:37:15 -0000 1.2 @@ -18,7 +18,7 @@ $EQUATORIAL_SCALE = 0.000057220458984375; $POLAR_SCALE = 0.00017166137695312500; -$FP = "1000"; +$FP = "0001"; /* binary */ /* Do we have anything to compute? */ if (!empty($usegrid)) { @@ -101,7 +101,7 @@ $word = substr($addr, $i * 16, 16); $hexaddr .= dechex(bindec($word)); } - $hexaddr{0} = "x"; + //$hexaddr{0} = "x"; /************************************** |
From: <il...@pr...> - 2004-11-17 12:01:44
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25765 Added Files: ipv6-pi-addr.php Log Message: A handy page for looking up IPv6 provider independent geographic address prefixes (as specified in draft-hain-ipv6-pi-addr-07.txt) from coordinates. --- NEW FILE: ipv6-pi-addr.php --- <?php include "config.php"; include "util.php"; $lat = doubleval($_POST["lat"]); $lon = doubleval($_POST["lon"]); $e = doubleval($_POST["e"]); $n = doubleval($_POST["n"]); $zone = intval($_POST["zone"]); if (empty($zone)) $zone = 56; $usegrid = $_POST["usegrid"]; $USECURV = "Obtain from curvilinear"; $USEGRID = "Obtain from UTM"; $EQUATORIAL_SCALE = 0.000057220458984375; $POLAR_SCALE = 0.00017166137695312500; $FP = "1000"; /* Do we have anything to compute? */ if (!empty($usegrid)) { /************************************** * Compute the prefix for this point. */ /* Convert to WGS 84 curvilinear coordinates. */ if ($usegrid == $USEGRID) { list($lat, $lon) = cvtlatlon($e, $n, $zone); } else { list($e, $n, $zone) = cvteastnorth($lat, $lon, $findzone=1); } /* Shift origin to south pole at 90 degrees east. */ if ($lon < 90) $seclon = $lon + 270; else $seclon = $lon - 90; $seclat = $lat + 90; /* Shift origin to southwest of section. */ if ($seclat < 30) { /* Antarctica. */ $section = 6; } elseif ($seclat >= 150) { /* Arctic. */ $section = 7; $seclat -= 150; } else { /* Equatorial band. */ $seclat -= 30; if ($seclon < 120) { /* Asia. */ $section = 0; } else if ($seclon < 240) { /* America. */ $section = 1; $seclon -= 120; } else { /* Europe. */ $section = 2; $seclon -= 240; } } /* Scale to [0..2^21). */ if ($section < 3) { /* Equatorial band. */ $scaledlon = intval($seclon / $EQUATORIAL_SCALE); $scaledlat = intval($seclat / $EQUATORIAL_SCALE); } else { /* Polar bands. */ $scaledlon = intval($seclon / $POLAR_SCALE); $scaledlat = intval($seclat / $POLAR_SCALE); } /* Convert to binary. */ $binlon = sprintf("%021b", $scaledlon); $binlat = sprintf("%021b", $scaledlat); if ($section > 3) { $binsec = sprintf("%03b", $section); } else { $binsec = sprintf("%02b", $section); } /* Construct the address as a binary string. */ $addr = $FP.$binsec; for ($i = 0; $i < 21; $i++) { if ($section <= 3 || $i > 0) $addr .= $binlat{$i}; $addr .= $binlon{$i}; } /* Format it as colon-separated hex. */ $hexaddr = ""; for ($i = 0; $i < 3; $i++) { if ($i > 0) $hexaddr .= ":"; $word = substr($addr, $i * 16, 16); $hexaddr .= dechex(bindec($word)); } $hexaddr{0} = "x"; /************************************** * Compute the area for this prefix. */ /* Convert the range back to a scaled decimal number. */ $scaledlon1 = bindec($binlon); $scaledlat1 = bindec($binlat); $scaledlon2 = $scaledlon + 1; $scaledlat2 = $scaledlat + 1; /* Scale it back up to degrees within the section. */ if ($section < 3) { $seclon1 = $scaledlon1 * $EQUATORIAL_SCALE; $seclat1 = $scaledlat1 * $EQUATORIAL_SCALE; $seclon2 = $scaledlon2 * $EQUATORIAL_SCALE; $seclat2 = $scaledlat2 * $EQUATORIAL_SCALE; } else { $seclon1 = $scaledlon1 * $POLAR_SCALE; $seclat1 = $scaledlat1 * $POLAR_SCALE; $seclon2 = $scaledlon2 * $POLAR_SCALE; $seclat2 = $scaledlat2 * $POLAR_SCALE; } /* Convert them to ordinary degrees. */ $lon1 = $seclon1; $lon2 = $seclon2; if ($section < 3) { $lat1 = $seclat1 - 60; $lat2 = $seclat2 - 60; $lon1 = $seclon1 + 90 + (120 * $section); $lon2 = $seclon2 + 90 + (120 * $section); } else { if ($section = 6) { /* Antarctica. */ $lat1 = $seclat1 - 90; $lat2 = $seclat2 - 90; } else { /* Arctic. */ $lat1 = $lat1 + 60; $lat2 = $lat2 + 60; } } if ($lon1 > 180) $lon1 -=360; if ($lon2 > 180) $lon2 -= 360; /* Convert to UTM. */ list($e1, $n1, $zone1) = cvteastnorth($lat1, $lon1, $findzone=1); list($e2, $n2, $zone2) = cvteastnorth($lat2, $lon2, $findzone=1); } ?> <html> <head> <link rel="stylesheet" href="<?=$PREF["stylesheet"]?>" type="text/css"> <link rel="icon" href="favicon.ico"> <title>IPv6 geographic provider independent addressing</title> <body> <h1>IPv6 geographic provider independent addressing</h1> <p> IPv6 geographic provider independent addressing is proposed in <a href="http://www.ietf.org/internet-drafts/draft-hain-ipv6-pi-addr-07.txt">draft-hain-ipv6-pi-addr</a> and provides a way to obtain unique IPv6 address from one's physical location on the earth's surface. It provides a 48 bit prefix for each area of a few square metres. </p> <?php if ($e && $n && $zone == $ZONE) { ?> <img align="right" width="200" height="200" src="map2b.php?s=0.1&w=200&h=200&n=<?=$n?>&e=<?=$e?>&markcentre=1&shownonodes=0" alt="location"> <?php } ?> <form method="post"> <table> <tr> <th width="50%" colspan="2" style="text-align: center">Curvilinear</th> <th width="50%" colspan="2" style="text-align: center">UTM</th> </tr> <tr> <td style="text-align: right"> Latitude: </td> <td> <input name="lat" value="<?=htmlspecialchars(printf("%.5f", $lat))?>" size="10">°N </td> <td style="text-align: right"> Northing: </td> <td> <input name="n" value="<?=htmlspecialchars(printf("%.1f", $n))?>" size="10">m </td> </tr> <tr> <td style="text-align: right"> Longitude: </td> <td> <input name="lon" value="<?=htmlspecialchars(printf("%.5f", $lon))?>" size="10">°E </td> <td style="text-align: right"> Easting: </td> <td> <input name="e" value="<?=htmlspecialchars(printf("%.1f", $e))?>" size="10">m </td> </tr> <tr> <td></td> <td></td> <td style="text-align: right"> Zone: </td> <td> <input name="zone" value="<?=htmlspecialchars($zone)?>" size="4"> </td> </tr> <tr> <td style="text-align: right">System:</td> <td>WGS84</td> <td style="text-align: right">System:</td> <td>AGD66</td> </tr> <tr> <td colspan="2" style="text-align: center"> <input type="submit" name="usegrid" value="<?=$USECURV?>"> </td> <td colspan="2" style="text-align: center"> <input type="submit" name="usegrid" value="<?=$USEGRID?>"> </td> </tr> <?php /* Did we compute anything? */ if (isset($hexaddr)) { ?> <tr> <td colspan="4"> <br> <font size="+1">Prefix for this site is: <b><tt><?=$hexaddr?>::/48</tt><b></font>. <br><br> </td> </tr> <tr> <td style="text-align: right"> Latitude: </td> <td> <?=printf("%.5f", abs($lat1))?>°<?=$lat1 >= 0 ? "N" : "S"?> </td> <td style="text-align: right"> Northing: </td> <td> <?=printf("%.1f", $n1)?>m </td> </tr> <tr> <td style="text-align: right"> to: </td> <td> <?=printf("%.5f", abs($lat2))?>°<?=$lat2 >= 0 ? "N" : "S"?> </td> <td style="text-align: right"> to: </td> <td> <?=printf("%.1f", $n2)?>m (<?=printf("%.1f", abs($n2 - $n1))?>m) </td> </tr> <tr> <td style="text-align: right"> Longitude: </td> <td> <?=printf("%.5f", abs($lon1))?>°<?=$lon1 >= 0 ? "E" : "W"?> </td> <td style="text-align: right"> Easting: </td> <td> <?=printf("%.1f", $e1)?>m </td> </tr> <tr> <td style="text-align: right"> to: </td> <td> <?=printf("%.5f", abs($lon2))?>°<?=$lon2 >= 0 ? "E" : "W"?> </td> <td style="text-align: right"> to: </td> <td> <?=printf("%.1f", $e2)?>m (<?=printf("%.1f", abs($e2 - $e1))?>m) </td> </tr> <?php } ?> </table> </form> <?php if ($hexaddr && False) { print $section." ".$seclat." ".$seclon."<br>"; print $scaledlon." ".$scaledlat."<br>"; print $binsec." ".$binlat." ".$binlon."<br>"; print $addr." (".strlen($addr).")<br>"; //print $binlat1." ".$binlon1."<br>"; //print $binlat2." ".$binlon2."<br>"; print $scaledlat1." ".$scaledlon1."<br>"; print $scaledlat2." ".$scaledlon2."<br>"; print $seclat1." ".$seclon1."<br>"; print $seclat2." ".$seclon2."<br>"; print $lat1."° ".$lon1."°<br>"; print $lat2."° ".$lon2."°<br>"; print "Z".$zone1." ".$n1."N ".$e1."E<br>"; print "Z".$zone2." ".$n2."N ".$e2."E<br>"; } if ($zone != $ZONE) { print "<p><font size=\"+1\"><b>Note:</b> UTM coordinates on this page are accurate only within Queensland.</font></p>"; } ?> <hr> <a href="..">Brisbane Mesh</a> | <a href=".">Node database</a> </body> </html> |
From: <il...@pr...> - 2004-11-17 12:00:01
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25331 Modified Files: util.php Log Message: Added support for converting coordinates even if they're not in the same UTM zone. Index: util.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/util.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- util.php 16 Sep 2004 22:58:16 -0000 1.2 +++ util.php 17 Nov 2004 11:59:52 -0000 1.3 @@ -10,13 +10,14 @@ return passthru("ulimit -c 0; ulimit -t 120; ".$cmd); } -function cvtlatlon($E,$N,$noshift=0) { - global $SHIFTFILE, $ZONE; +function cvtlatlon($E,$N,$zone=0,$noshift=0) { + global $SHIFTFILE,$ZONE; if ($E == "" && $N == "") return array("",""); $E1 = doubleval($E); $N1 = doubleval($N); - $latlon = mybacktick("bin/rf -F \"%l %L\" -z $ZONE -g $E1 $N1 2>&1"); + if (!$zone) $zone = $ZONE; + $latlon = mybacktick("bin/rf -F \"%l %L\" -z $zone -g $E1 $N1 2>&1"); if (!$noshift) $latlon = mybacktick("bin/shift -S ${SHIFTFILE} -- $latlon"); list($Lat,$Lon) = split(" ", $latlon, 2); @@ -25,7 +26,7 @@ return array($Lat, $Lon); } -function cvteastnorth($Lat, $Lon) { +function cvteastnorth($Lat, $Lon, $findzone=0) { global $SHIFTFILE, $ZONE; if ($Lat == "" && $Lon == "") return array("",""); @@ -34,11 +35,14 @@ $latlon = mybacktick("bin/shift -r -S ${SHIFTFILE} -- $Lat $Lon"); $enz = mybacktick("bin/rf -F \"%e %n %z\" -l $latlon 2>&1"); list($E,$N,$Z) = split(" ", $enz, 3); - if ($Z != $ZONE) + if ($Z != $ZONE && !$findzone) die ("Lat/lon $Lat/$Lon is in zone $Z. should be in zone $ZONE"); $E = doubleval($E); $N = doubleval($N); - return array($E,$N); + if ($findzone) + return array($E, $N, $Z); + else + return array($E,$N); } ?> |
From: <le...@pr...> - 2004-11-08 14:16:36
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19083 Modified Files: Tag: leonard-dev view.php Log Message: track r1.17: Use the configured altitude and shift files when running elev. Index: view.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/view.php,v retrieving revision 1.16.2.2 retrieving revision 1.16.2.3 diff -u -d -r1.16.2.2 -r1.16.2.3 --- view.php 7 Nov 2004 05:50:06 -0000 1.16.2.2 +++ view.php 8 Nov 2004 14:16:15 -0000 1.16.2.3 @@ -108,7 +108,7 @@ } function elev($loc1, $loc2) { - global $ZONE; + global $ZONE, $SHIFTFILE, $ALTFILE; $e1 = doubleval($loc1["e"]); $n1 = doubleval($loc1["n"]); @@ -119,8 +119,12 @@ $h2 = doubleval($loc2["h"]); $info = split(" ", - mybacktick("$BINDIR/elev -z ${ZONE} -a $e1 $n1 $h1" - ." -b $e2 $n2 $h2")); + mybacktick("$BINDIR/elev" + ." -z ${ZONE}" + ." -S ${SHIFTFILE}" + ." -A ${ALTFILE}" + ." -a $e1 $n1 $h1" + ." -b $e2 $n2 $h2")); $distance = $info[0]; $bearing1 = doubleval($info[1]) * 180 / M_PI; |
From: <le...@pr...> - 2004-11-08 13:31:31
|
Update of /cvsroot/meshdb/src/mailt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8917 Modified Files: Tag: leonard-dev util.c Log Message: convert "=?iso-8859-1?q?Tony?" to "Tony" for yahoo emails Index: util.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/util.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -u -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- util.c 8 Nov 2004 12:55:34 -0000 1.1.1.1.2.1 +++ util.c 8 Nov 2004 13:31:20 -0000 1.1.1.1.2.2 @@ -26,6 +26,7 @@ int spaces = 0; /* + * =?iso-8859-1?q?F S?= -> F S * u@h -> u@h * F S <u@h> -> F S * "F S" <u@h> -> F S @@ -42,6 +43,17 @@ *sp = s; *ep = e; + /* Hooray! for! Yahoo! */ + if (s + 15 < e && memcmp(s, "=?iso-8859-1?q?", 15) == 0) { + cstring_t f; + for (f = s + 15; f + 1 < e; f++) + if (f[0] == '?' && f[1] == '=') { + *sp = s + 15; + *ep = f; + return; + } + } + /* Skip, and record text in angled brackets */ if (s < e && *s == '<') { s++; |
From: <le...@pr...> - 2004-11-08 13:21:35
|
Update of /cvsroot/meshdb/src/mailt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6602 Modified Files: Tag: leonard-dev subjects.php Log Message: QUERY_STRING comes from $_SERVER Index: subjects.php =================================================================== RCS file: /cvsroot/meshdb/src/mailt/subjects.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- subjects.php 23 Oct 2003 01:20:02 -0000 1.2 +++ subjects.php 8 Nov 2004 13:21:26 -0000 1.2.2.1 @@ -107,11 +107,11 @@ * of the found [YYYYMMDD]-[YYYYMMDD] */ - if ($QUERY_STRING == "") { + if ($_SERVER[QUERY_STRING] == "") { $start_t = mktime(0,0,0,date("m"), 1, date("Y")); $finish_t= mktime(0,0,0,date("m")+1, 1, date("Y")) - 1; } else { - list($start, $finish) = explode("-", $QUERY_STRING, 2); + list($start, $finish) = explode("-", $_SERVER[QUERY_STRING], 2); if ($start == "") $start_t = $first_m["date"]; else $start_t = parsetime($start); |
Update of /cvsroot/meshdb/src/mailt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv626 Modified Files: Tag: leonard-dev Makefile.am configure.ac datetime.c datetime.h index.c index.h mail.inc mime.c mkill.c msgid.c open.c size.c t.c update.c util.c view.c Log Message: work towards portable index table Index: Makefile.am =================================================================== RCS file: /cvsroot/meshdb/src/mailt/Attic/Makefile.am,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- Makefile.am 7 Nov 2004 12:34:39 -0000 1.1.2.2 +++ Makefile.am 8 Nov 2004 12:55:31 -0000 1.1.2.3 @@ -4,7 +4,8 @@ cgibindir = @cgibindir@ htmlmaildir = @htmlmaildir@ -bin_PROGRAMS = update t mkill size msgid +bin_PROGRAMS = update mkill msgid +noinst_PROGRAMS = size t noinst_LIBRARIES = libmail.a libmail_a_SOURCES = index.c datetime.c open.c util.c mime.c @@ -16,4 +17,4 @@ cgibin_PROGRAMS = view view_LDADD = libmail.a -htmlmail_DATA = subjects.html mail.inc +htmlmail_DATA = subjects.php mail.inc Index: configure.ac =================================================================== RCS file: /cvsroot/meshdb/src/mailt/Attic/configure.ac,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- configure.ac 7 Nov 2004 12:34:21 -0000 1.1.2.2 +++ configure.ac 8 Nov 2004 12:55:31 -0000 1.1.2.3 @@ -24,7 +24,16 @@ AC_PROG_CC AC_PROG_RANLIB +AC_C_BIGENDIAN + AC_HEADER_STDC -AC_CHECK_HEADERS(err.h inttypes.h) +AC_CHECK_HEADERS(fcntl.h,, + [AC_MSG_ERROR([could not find fcntl.h])]) +AC_CHECK_HEADERS(sys/mman.h) + +AC_FUNC_MMAP +AC_FUNC_STAT +AC_CHECK_FUNCS(open,, + [AC_MSG_ERROR([could not find open syscall])]) AC_OUTPUT Index: datetime.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/datetime.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- datetime.c 12 Mar 2004 11:33:38 -0000 1.3 +++ datetime.c 8 Nov 2004 12:55:31 -0000 1.3.2.1 @@ -1,10 +1,15 @@ /* Parse dates in a much more releaxed manner than RFC2822... */ -#include <ctype.h> -#include <string.h> -#include <stdlib.h> -#include <time.h> +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <ctype.h> +# include <string.h> +# include <stdlib.h> +#endif + #include "datetime.h" /* skip over white space and comments in parentheses */ Index: datetime.h =================================================================== RCS file: /cvsroot/meshdb/src/mailt/datetime.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- datetime.h 10 Aug 2002 03:45:14 -0000 1.1.1.1 +++ datetime.h 8 Nov 2004 12:55:34 -0000 1.1.1.1.2.1 @@ -1,2 +1,14 @@ /* $Id$ */ + +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + void parse_datetime(const char *, const char *, struct tm *); Index: index.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/index.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- index.c 24 Nov 2003 05:57:18 -0000 1.3 +++ index.c 8 Nov 2004 12:55:34 -0000 1.3.2.1 @@ -1,11 +1,24 @@ /* $Id$ */ /* Operations to open and map an mailbox index aux file */ -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/mman.h> +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <string.h> +#endif +#if defined(HAVE_UNISTD_H) +# include <sys/types.h> +# include <unistd.h> +#endif +#if defined(HAVE_SYS_MMAN_H) +# include <sys/mman.h> +#endif + +#if !defined(HAVE_MMAP) +# error "no mmap on this system, and no support for not having it" +#endif #include "index.h" Index: index.h =================================================================== RCS file: /cvsroot/meshdb/src/mailt/index.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- index.h 10 Aug 2002 03:45:14 -0000 1.1.1.1 +++ index.h 8 Nov 2004 12:55:34 -0000 1.1.1.1.2.1 @@ -5,35 +5,39 @@ * The first record (mail0) is treated specially. */ -typedef unsigned long msgid_t; +#if defined(HAVE_INTTYPES_H) +#include <inttypes.h> +#endif + +typedef uint32_t msgid_t; typedef const char *cstring_t; typedef char *string_t; struct mail { - size_t hdrlen; /* incl. last blank line */ - size_t bodylen; - off_t pos; /* start of headers in file */ - time_t date; + uint32_t hdrlen; /* incl. last blank line */ + uint32_t bodylen; + uint64_t pos; /* start of headers in file */ + int32_t date; char from[40]; /* Sender's name */ char subject[60]; /* Subject text */ msgid_t parent, child, sibling; /* Thread tree */ - int flags; + uint16_t flags; #define FLAGS_KILLED 0x0001 /* Message has been killed */ }; /* First entry */ struct mail0 { - size_t size; /* size of each entry */ - size_t version; /* version check */ + uint32_t size; /* size of each entry */ + uint32_t version; /* version check */ #define MAIL0_VERSION 1 - off_t end; /* total size of mbox */ - time_t date; /* index update time */ + uint64_t end; /* total size of mbox */ + int32_t date; /* index update time */ char ign4[40]; char ign5[60]; msgid_t msgs; /* number of messages */ msgid_t child; /* first unparented child */ msgid_t ign8; - int flags; + uint16_t flags; }; int index_create(int fd); @@ -42,7 +46,7 @@ struct mail *index_loadn(int fd, int msgs, int readonly); void index_unloadn(struct mail *mail, int msgs); int index_resize(int fd, int msgs); -cstring_t mbox_map(struct mail0 *m0, int mboxfd); +cstring_t mbox_map(struct mail0 *m0, int mboxfd); void mbox_unmap(struct mail0 *m0, cstring_t base); #define READONLY 1 Index: mail.inc =================================================================== RCS file: /cvsroot/meshdb/src/mailt/mail.inc,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- mail.inc 10 Aug 2002 03:45:14 -0000 1.1.1.1 +++ mail.inc 8 Nov 2004 12:55:34 -0000 1.1.1.1.2.1 @@ -3,6 +3,11 @@ /* Utility functions to access mail indices */ + /* + * The following lines should be replaced by what the 'size' + * program reports, ideally when it is run on the same host + * as the web server. + */ $FMT = "Lhdrlen/Lbodylen/Lpos/Ldate/a40from" ."/a60subject/Lparent/Lchild/Lsibling/Lflags"; $FMT0 = "Lsize/Lversion/Lend/Ldate/a40ign4" Index: mime.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/mime.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- mime.c 10 Aug 2002 03:45:14 -0000 1.1.1.1 +++ mime.c 8 Nov 2004 12:55:34 -0000 1.1.1.1.2.1 @@ -1,8 +1,14 @@ /* $Id$ */ -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> -#include <sys/types.h> + +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <stdlib.h> +# include <ctype.h> +# include <sys/types.h> +#endif #include "index.h" #include "mime.h" Index: mkill.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/mkill.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- mkill.c 24 Nov 2003 06:23:01 -0000 1.2 +++ mkill.c 8 Nov 2004 12:55:34 -0000 1.2.2.1 @@ -5,11 +5,28 @@ * and removes the message from the reply-tree * - or list the messages that are currently killed */ -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> + +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <unistd.h> +# include <stdlib.h> +# include <string.h> +#endif + +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + #include "index.h" #include "open.h" #include "util.h" Index: msgid.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/msgid.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- msgid.c 24 Nov 2003 06:27:28 -0000 1.2 +++ msgid.c 8 Nov 2004 12:55:34 -0000 1.2.2.1 @@ -4,11 +4,26 @@ * This program searches for an (unkilled) message with the given * message id. */ -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <unistd.h> +# include <stdlib.h> +# include <string.h> +#endif +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + #include "index.h" #include "open.h" #include "util.h" Index: open.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/open.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- open.c 12 Mar 2004 11:33:38 -0000 1.3 +++ open.c 8 Nov 2004 12:55:34 -0000 1.3.2.1 @@ -1,15 +1,22 @@ /* $Id$ */ /* Operations to open a mailbox and its index file */ +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif #include <stdio.h> -#include <stdlib.h> -#include <unistd.h> +#if defined(HAVE_STDLIB_H) +# include <stdlib.h> +#endif +#if defined(HAVE_UNISTD_H) +# include <unistd.h> +#endif #include <fcntl.h> #include "index.h" #include "open.h" -#ifndef __FreeBSD__ +#ifndef O_EXLOCK #define O_EXLOCK 0 #endif Index: size.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/size.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- size.c 24 Nov 2003 06:19:54 -0000 1.2 +++ size.c 8 Nov 2004 12:55:34 -0000 1.2.2.1 @@ -1,7 +1,28 @@ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <time.h> +/* + * Dump the format of the index structure for use in accessing the + * file structure from PHP. + */ + +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <stdlib.h> +# include <unistd.h> +#endif + +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + #include "index.h" #define P(t,n) switch(sizeof ((struct t *)0)->n) { \ Index: t.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/t.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- t.c 24 Nov 2003 06:23:53 -0000 1.2 +++ t.c 8 Nov 2004 12:55:34 -0000 1.2.2.1 @@ -1,8 +1,28 @@ /* $Id$ */ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <time.h> + +/* Dumps the message tree index file for debugging */ + + +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <stdlib.h> +# include <unistd.h> +#endif + +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + #include "index.h" #include "open.h" Index: update.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/update.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- update.c 24 Nov 2003 06:26:01 -0000 1.3 +++ update.c 8 Nov 2004 12:55:34 -0000 1.3.2.1 @@ -6,12 +6,19 @@ * - extracts dates, subject and from lines * - constructs or augments an 'In-reply-to' tree. */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <ctype.h> + +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +# include <unistd.h> +# include <ctype.h> +#endif #include <sys/stat.h> + #include "index.h" #include "datetime.h" #include "open.h" Index: util.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/util.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- util.c 10 Aug 2002 03:45:14 -0000 1.1.1.1 +++ util.c 8 Nov 2004 12:55:34 -0000 1.1.1.1.2.1 @@ -1,8 +1,14 @@ /* $Id$ */ -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> -#include <sys/types.h> + +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <stdlib.h> +# include <ctype.h> +# include <sys/types.h> +#endif #include "index.h" #include "util.h" Index: view.c =================================================================== RCS file: /cvsroot/meshdb/src/mailt/view.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- view.c 22 Oct 2003 06:24:34 -0000 1.4 +++ view.c 8 Nov 2004 12:55:34 -0000 1.4.2.1 @@ -1,9 +1,25 @@ /* $Id$ */ -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> +#if defined(HAVE_CONFIG_H) +# include "config.h" +#endif +#if defined(STDC_HEADERS) +# include <stdio.h> +# include <unistd.h> +# include <stdlib.h> +# include <string.h> +#endif + +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + #include "index.h" #include "open.h" #include "util.h" |
From: <il...@pr...> - 2004-11-08 08:35:25
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7645 Modified Files: view.php Log Message: Use the configured altitude and shift files when running elev. Index: view.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/view.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- view.php 28 Jul 2004 07:28:53 -0000 1.16 +++ view.php 8 Nov 2004 08:35:00 -0000 1.17 @@ -105,7 +105,7 @@ } function elev($loc1, $loc2) { - global $ZONE; + global $ZONE, $SHIFTFILE, $ALTFILE; $e1 = doubleval($loc1["e"]); $n1 = doubleval($loc1["n"]); @@ -116,8 +116,12 @@ $h2 = doubleval($loc2["h"]); $info = split(" ", - mybacktick("bin/elev -z ${ZONE} -a $e1 $n1 $h1" - ." -b $e2 $n2 $h2")); + mybacktick("bin/elev" + ." -z ${ZONE}" + ." -S ${SHIFTFILE}" + ." -A ${ALTFILE}" + ." -a $e1 $n1 $h1" + ." -b $e2 $n2 $h2")); $distance = $info[0]; $bearing1 = doubleval($info[1]) * 180 / M_PI; |
From: <le...@pr...> - 2004-11-07 12:34:48
|
Update of /cvsroot/meshdb/src/mailt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12895 Modified Files: Tag: leonard-dev Makefile.am Log Message: fix install. tidy. Index: Makefile.am =================================================================== RCS file: /cvsroot/meshdb/src/mailt/Attic/Makefile.am,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- Makefile.am 7 Nov 2004 12:16:36 -0000 1.1.2.1 +++ Makefile.am 7 Nov 2004 12:34:39 -0000 1.1.2.2 @@ -4,16 +4,16 @@ cgibindir = @cgibindir@ htmlmaildir = @htmlmaildir@ -bin_PROGRAMS= update t mkill size msgid -lib_LIBRARIES= libmail.a -libmail_a_SOURCES= index.c datetime.c open.c util.c mime.c +bin_PROGRAMS = update t mkill size msgid +noinst_LIBRARIES = libmail.a +libmail_a_SOURCES = index.c datetime.c open.c util.c mime.c -update_LDADD= libmail.a -t_LDADD= libmail.a -mkill_LDADD= libmail.a -size_LDADD= libmail.a -msgid_LDADD= libmail.a +update_LDADD = libmail.a +t_LDADD = libmail.a +mkill_LDADD = libmail.a +size_LDADD = libmail.a +msgid_LDADD = libmail.a -cgibin_PROGRAMS= view -view_LDADD= libmail.a -htmlmail_EXTRAS= subjects.html mail.inc +cgibin_PROGRAMS = view +view_LDADD = libmail.a +htmlmail_DATA = subjects.html mail.inc |
From: <le...@pr...> - 2004-11-07 12:34:30
|
Update of /cvsroot/meshdb/src/mailt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12850 Modified Files: Tag: leonard-dev configure.ac Log Message: add cgibindir and htmlmaildir Index: configure.ac =================================================================== RCS file: /cvsroot/meshdb/src/mailt/Attic/configure.ac,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- configure.ac 7 Nov 2004 12:16:36 -0000 1.1.2.1 +++ configure.ac 7 Nov 2004 12:34:21 -0000 1.1.2.2 @@ -6,7 +6,21 @@ AM_INIT_AUTOMAKE(foreign) AM_CONFIG_HEADER(config.h) AC_CONFIG_FILES([Makefile]) - + +AC_ARG_WITH(cgibindir, + AC_HELP_STRING([--with-cgibindir=PATH], + [path to cgi-bin (default PREFIX/cgi-bin)]), + [cgibindir=$withval], + [cgibindir='$(prefix)/cgi-bin']) +AC_SUBST(cgibindir) + +AC_ARG_WITH(htmlmaildir, + AC_HELP_STRING([--with-htmlmaildir=PATH], + [path to htmlmail (default PREFIX/www)]), + [htmlmaildir=$withval], + [htmlmaildir='$(prefix)/www']) +AC_SUBST(htmlmaildir) + AC_PROG_CC AC_PROG_RANLIB |
From: <le...@pr...> - 2004-11-07 12:17:13
|
Update of /cvsroot/meshdb/src/geo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1924/geo Modified Files: Tag: leonard-dev Makefile.am Removed Files: Tag: leonard-dev configure.ac libpng.m4 Log Message: more autoconf Index: Makefile.am =================================================================== RCS file: /cvsroot/meshdb/src/geo/Attic/Makefile.am,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- Makefile.am 7 Nov 2004 11:07:08 -0000 1.1.2.2 +++ Makefile.am 7 Nov 2004 12:16:31 -0000 1.1.2.3 @@ -8,5 +8,3 @@ SUBDIRS += make-alt-qt SUBDIRS += make-hgt-qt SUBDIRS += httphead - -ACLOCAL_AMFLAGS = -I . --- configure.ac DELETED --- --- libpng.m4 DELETED --- |
From: <le...@pr...> - 2004-11-07 12:17:13
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1924/geo/alt Modified Files: Tag: leonard-dev Makefile.am Log Message: more autoconf Index: Makefile.am =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/Attic/Makefile.am,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- Makefile.am 7 Nov 2004 09:49:42 -0000 1.1.2.1 +++ Makefile.am 7 Nov 2004 12:16:31 -0000 1.1.2.2 @@ -1,6 +1,6 @@ # $Id$ -AM_CPPFLAGS = -I$(top_srcdir) +AM_CPPFLAGS = -I$(srcdir)/.. bin_PROGRAMS = alt alt_SOURCES = main.c |
From: <le...@pr...> - 2004-11-07 12:16:50
|
Update of /cvsroot/meshdb/src/vpf/libvpf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1924/vpf/libvpf Modified Files: Tag: leonard-dev vpf.h vpfint.h Added Files: Tag: leonard-dev Makefile.am Removed Files: Tag: leonard-dev BSDmakefile GNUmakefile Makefile.common Log Message: more autoconf --- NEW FILE: Makefile.am --- # $Id: Makefile.am,v 1.1.2.1 2004/11/07 12:16:38 leonard Exp $ # David Leonard, 2004. Public domain. AM_CPPFLAGS = -I$(srcdir)/../../geo noinst_LIBRARIES= libvpf.a libvpf_a_SOURCES= vpf.c vpf_join.c vpf_select.c vpf_si.c vpf_theme.c Index: vpf.h =================================================================== RCS file: /cvsroot/meshdb/src/vpf/libvpf/vpf.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- vpf.h 15 Sep 2002 13:55:42 -0000 1.2 +++ vpf.h 7 Nov 2004 12:16:38 -0000 1.2.2.1 @@ -4,7 +4,7 @@ #ifndef _h_vpf_ #define _h_vpf_ -#include "compat.h" +#include "compat/compat.h" /*------------------------------------------------------------ * types Index: vpfint.h =================================================================== RCS file: /cvsroot/meshdb/src/vpf/libvpf/vpfint.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- vpfint.h 15 Sep 2002 13:55:42 -0000 1.2 +++ vpfint.h 7 Nov 2004 12:16:38 -0000 1.2.2.1 @@ -1,7 +1,7 @@ /* $Id$ */ /* David Leonard, 2002. Public domain. */ -#include "compat.h" +#include "compat/compat.h" /* integer endian conversion macros */ #define H(e,lsb,msb,i) ((e) == ENDIAN_MSB ? msb(i) : lsb(i)) --- BSDmakefile DELETED --- --- GNUmakefile DELETED --- --- Makefile.common DELETED --- |