[mapcode] 24/32: Added newest C lib
Stefan Fritsch
sf at moszumanska.debian.org
Wed Nov 2 23:27:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
sf pushed a commit to annotated tag v1.33
in repository mapcode.
commit 7cbd9b7b0e4e9237153e97bafd22419d0d2f65b8
Author: Rijn Buve <rijn at buve.nl>
Date: Mon Sep 1 15:48:51 2014 +0200
Added newest C lib
---
mapcode.c | 4 ++--
mapcoder/basics.h | 2 +-
mapcoder/mapcode_library.doc | Bin 84992 -> 61440 bytes
mapcoder/mapcoder.c | 11 ++++++-----
mapcoder/readme.txt | 1 +
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/mapcode.c b/mapcode.c
index 1081560..8115e85 100644
--- a/mapcode.c
+++ b/mapcode.c
@@ -27,7 +27,7 @@
#include <math.h>
#include "mapcoder/mapcoder.c"
-static const char* VERSION = "1.01";
+static const char* VERSION = "1";
static const int SELF_CHECK = 1;
static const int SELF_CHECK_EXIT = 0;
@@ -61,7 +61,7 @@ static double lonLargestNrOfResults = 0.0;
* whenever a incorrect amount or combination of parameters is entered.
*/
static void usage(const char* appName) {
- printf("MAPCODE %s (C library version %s)%s\n", VERSION, mapcode_cversion, SELF_CHECK ? " (self-checking)" : "");
+ printf("MAPCODE (version %s.%s%s)\n", mapcode_cversion, VERSION, SELF_CHECK ? ", self-checking" : "");
printf("Copyright (C) 2014 Stichting Mapcode Foundation\n");
printf("\n");
printf("Usage:\n");
diff --git a/mapcoder/basics.h b/mapcoder/basics.h
index 8610179..1dbb933 100755
--- a/mapcoder/basics.h
+++ b/mapcoder/basics.h
@@ -1,6 +1,6 @@
#define UWORD unsigned short int // 2-byte unsigned integer
-#define mapcode_cversion "1.32"
+#define mapcode_cversion "1.33"
#define MAXWIDE 10
#define BASEX 31
#define MAXFITLONG 6
diff --git a/mapcoder/mapcode_library.doc b/mapcoder/mapcode_library.doc
index fd2b885..aa0eba1 100755
Binary files a/mapcoder/mapcode_library.doc and b/mapcoder/mapcode_library.doc differ
diff --git a/mapcoder/mapcoder.c b/mapcoder/mapcoder.c
index e46bb33..85dca7c 100755
--- a/mapcoder/mapcoder.c
+++ b/mapcoder/mapcoder.c
@@ -1364,11 +1364,13 @@ int master_decode( long *nx,long *ny, // <- store result in nx,ny
if (isuseless(m)) {
int j,fitssomewhere=0;
for (j=iso_start; (j)<m; j++) { // look in previous rects
- long minx,miny,maxx,maxy;
+ long minx,miny,maxx,maxy,xdiv8;
if (isuseless((j))) continue;
getboundaries((j),minx,miny,maxx,maxy);
- if ( miny<=*ny && *ny<maxy && isInRange(*nx,minx,maxx) ) { fitssomewhere=1; break; }
- }
+ // 1.33 fix to not remove valid results just across the edge of a territory
+ xdiv8 = x_divider(miny,maxy)/4; // should be /8 but there's some extra margin
+ if ( miny-60<=*ny && *ny<maxy+60 && isInRange(*nx,minx-xdiv8,maxx+xdiv8) ) { fitssomewhere=1; break; }
+ }
if (!fitssomewhere) {
err=-1234;
}
@@ -1629,8 +1631,7 @@ void master_encode( char *resultbuffer, int the_ctry, long x, long y, int forcec
#ifdef VERSION_1_32 // 1.32 true recursive processing
- if (!stop_with_one_result)
- master_encode( resultbuffer, the_ctry, x,y, forcecoder, 0,0,1 );
+ master_encode( resultbuffer, the_ctry, x,y, forcecoder, stop_with_one_result,/*allow-world*/0,1 );
result_override=-1;
return; /**/
#else
diff --git a/mapcoder/readme.txt b/mapcoder/readme.txt
index ff205bf..eea3784 100755
--- a/mapcoder/readme.txt
+++ b/mapcoder/readme.txt
@@ -24,3 +24,4 @@ version history
1.30 updated the documentation and extended it with examples and suggestions
1.31 added lookslikemapcode();
1.32 added coord2mc1(); fixed 1.29 so no country-wide alternative is produced in edge cases; prevent FIJI failing to decode at exactly 180 degrees;
+1.33 fix to not remove valid results just across the edge of a territory
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapcode.git
More information about the Pkg-grass-devel
mailing list