Skip to content

Commit 9666cbf

Browse files
committed
Merge pull request #3 from mapcode-foundation/dev-1.50
Move from dev-1.50 to master
2 parents 9a62279 + c93d215 commit 9666cbf

File tree

6 files changed

+595
-543
lines changed

6 files changed

+595
-543
lines changed

NOTICE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Original C library created by Pieter Geelen. Work on Java version
2-
of the Mapcode library by Rijn Buve and Matthew Lowden.
2+
of the Mapcode library by Rijn Buve (original port by Matthew Lowden).
33

4-
Copyright (C) 2014 Stichting Mapcode Foundation (http://www.mapcode.com)
4+
Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com)

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com)
1111

1212
The directory 'mapcodelib' contains the files:
1313

14-
mapcoder.h <-- Header file with method prototypes and defines for caller.
15-
mapcoder.c
16-
basics.h
14+
mapcoder.h <-- Header file with method prototypes and defines for caller.
15+
mapcoder.c
16+
basics.h
1717

1818
Together these provide routine to encode/decode Mapcodes.
1919

2020
Documentation, including example snippets of C source code, can be found in
2121

22-
mapcode_library.doc (Microsoft Word format).
22+
mapcode_library.doc (Microsoft Word format).
2323

2424
Also see www.mapcode.com for background and reference materials.
2525

2626
Note: this version may be restricted to a particular area of the Earth!
2727
In that case, basics.h will state a version number of the for:
28-
#define mapcode_cversion "1.2xxx"
28+
#define mapcode_cversion "1.2xxx"
2929
where "xxx" states the geographical limitation.
3030

3131

32-
## A Real-Life Example, The 'mapcode' Codec Tool: `example/`
32+
## A Real-Life Example, The 'mapcode' Codec Tool: `utility/`
3333

34-
The directory 'example' contains a Mapcode encoding/decoding utility, as an example
34+
The directory 'utility' contains a Mapcode encoding/decoding utility, as an example
3535
of how to use the library.
3636

3737
To build the original Mapcode tool, execute:
3838

39-
cd example
39+
cd utility
4040
gcc mapcode.cpp -o mapcode
4141

4242
For help, simply execute the binary file 'mapcode' without no arguments.
@@ -46,19 +46,30 @@ decode Mapcodes.
4646

4747
## Release Notes
4848

49+
* 1.50
50+
51+
Major release. This version is not backwards compatible with mapcode 1.4x: is has dropped support for
52+
Antartica AT0-8 codes and has a changed (improved) way of dealing with the Greek alphabet.
53+
54+
Added 22-chararcter post-processing of all-digit mapcodes for the Greek alphabet.
55+
56+
Retired legacy aliases EAZ and SKM, AU-QL, AU-TS, AU-NI and AU-JB.
57+
58+
Retired legacy Antarctica claims AT0 through AT8.
59+
4960
* 1.41.1
5061

51-
Bugfix for “example/mapcode” utility (-d option was case sensitive).
62+
Bugfix for “utility/mapcode” utility (-d option was case sensitive).
5263

5364
* 1.41
5465

5566
Added the India state Telangana (IN-TG), until 2014 a region in Adhra Pradesh.
5667

57-
Fixed a problem with the "extraDigits" parameter of the “example/mapcode" utility (maximum digits is 2, not 3).
68+
Fixed a problem with the "extraDigits" parameter of the “utility/mapcode" utility (maximum digits is 2, not 3).
5869

5970
* 1.40
6071

61-
Added extraDigits parameter to allow high-precision mapcodes to be generated by the “example/mapcode” utility.
72+
Added extraDigits parameter to allow high-precision mapcodes to be generated by the “utility/mapcode” utility.
6273

6374
* 1.33
6475

mapcodelib/basics.h

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2014 Stichting Mapcode Foundation (http://www.mapcode.com)
2+
* Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,16 +16,16 @@
1616

1717
#define UWORD unsigned short int // 2-byte unsigned integer
1818

19-
#define mapcode_cversion "1.41"
19+
#define mapcode_cversion "1.50"
2020
#define MAXWIDE 10
2121
#define BASEX 31
2222
#define MAXFITLONG 6
2323
#define XSIDE3 168
2424
#define YSIDE3 176
2525

26-
#define ALIASES "2UK=2UT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C,5MO=MOR,5NA=NAY,5NL=NLE,5OA=OAX,5PB=PUE,5QE=QUE,5QR=ROO,5SL=SLP,5SI=SIN,5SO=SON,5TB=TAB,5TL=TLA,5VE=VER,5YU=YUC,5ZA=ZAC,811=8BJ,812=8TJ,813=8HE,814=8SX,815=8NM,821=8LN,822=8JL,823=8HL,831=8SH,832=8JS,833=8ZJ,834=8AH,835=8FJ,836=8JX,837=8SD,841=8HA,842=8HB,843=8HN,844=8GD,845=8GX,846=8HI,850=8CQ,851=8SC,852=8GZ,853=8YN,854=8XZ,861=8SN,862=8GS,863=8QH,864=8NX,865=8XJ,871=TWN,891=HKG,892=MAC,8TW=TWN,8HK=HKG,8MC=MAC,BEL=7BE,KIR=7KI,PRI=7PO,CHE=7CH,KHM=7KM,PER=7PM,TAM=7TT,0US=USA,0AU=AUS,0RU=RUS,0CN=CHN,TAA=SHN,ASC=SHN,DGA=IOT,WAK=MHL,JTN=UMI,MID=1HI,2OD=2OR,"
2727

28-
#define MAX_CCODE 542 // total number of areas (i.e. recognised iso codes) in this database
28+
#define MAX_CCODE 533 // total number of areas (i.e. recognised iso codes) in this database
2929
static const char *entity_iso = ""
3030
"VAT,MCO,GIB,TKL,CCK,BLM,NRU,TUV,MAC,SXM,"
3131
"MAF,NFK,PCN,BVT,BMU,IOT,SMR,GGY,AIA,MSR,"
@@ -80,8 +80,7 @@ static const char *entity_iso = ""
8080
"8HI,8NX,8CQ,8ZJ,8JS,8FJ,8AH,8LN,8SD,8SX,"
8181
"8JX,8HA,8GZ,8GD,8HB,8JL,8HE,8SN,8NM,8HL,"
8282
"8HN,8GX,8SC,8YN,8XZ,8GS,8QH,8XJ,CHN,UMI,"
83-
"CPT,AT0,AT1,AT2,AT3,AT4,AT5,AT6,AT7,AT8,"
84-
"ATA,AAA,";
83+
"CPT,ATA,AAA,";
8584

8685
#define usa_from 343
8786
#define usa_upto 393
@@ -107,8 +106,8 @@ static const char *entity_iso = ""
107106
#define rus_from 412
108107
#define rus_upto 494
109108
#define ccode_rus 496
110-
#define ccode_ata 540
111-
#define ccode_earth 541
109+
#define ccode_ata 531
110+
#define ccode_earth 532
112111

113112
#define parents3 "USA,IND,CAN,AUS,MEX,BRA,RUS,CHN,"
114113
#define parents2 "US,IN,CA,AU,MX,BR,RU,CN,"
@@ -161,11 +160,11 @@ static const signed char decode_chars[256] = {
161160
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
162161
};
163162

164-
static const char encode_chars[31] = {
163+
static const char encode_chars[34] = {
165164
'0','1','2','3','4','5','6','7','8','9',
166165
'B','C','D','F','G','H','J','K','L','M',
167166
'N','P','Q','R','S','T','V','W','X','Y','Z'
168-
};
167+
,'A','E','U'};
169168

170169

171170
static const UWORD data_start[MAX_CCODE+1] = {
@@ -222,11 +221,10 @@ static const UWORD data_start[MAX_CCODE+1] = {
222221
15477,15493,15530,15547,15571,15594,15611,15631,15657,15683,
223222
15702,15719,15772,15813,15835,15862,15882,15903,15921,15951,
224223
15977,15997,16018,16036,16054,16073,16089,16105,16133,16159,
225-
16166,16168,16169,16171,16172,16174,16176,16178,16180,16182,
226-
16183,16184,16216
224+
16166,16168,16169,16201
227225
};
228226

229-
#define NR_RECS 16216
227+
#define NR_RECS 16201
230228
#define WORST_RECS_PER_CCODE 195 // 8 Argentina @43
231229

232230
typedef struct { long minx; long miny; long maxx; long maxy; unsigned long flags; } mminforec;
@@ -16401,21 +16399,6 @@ static const mminforec mminfo[NR_RECS+1] = {
1640116399
{-177600000, -600000,-159800000, 18000000,0x0010637},
1640216400
{-109259020, 10252083,-109171569, 10338573,0x001002b},
1640316401
{-109450135, 10049808,-108976207, 10540848,0x001002c},
16404-
{ 158461004, -54885191, 159257828, -54394151,0x001002c},
16405-
{-180000000, -90000000, 180000000, -60000000,0x1860037},
16406-
{ 160000000, -90000000, 210000000, -60000000,0x003023c},
16407-
{ 136183350, -90000000, 142033333, -60000000,0xbb40036},
16408-
{-180000000, -90000000, 180000000, -60000000,0x1860037},
16409-
{ 44633300, -90000000, 160000000, -60000000,0x003023c},
16410-
{-180000000, -90000000, 180000000, -60000000,0x1860037},
16411-
{ -20000000, -90000000, 44633300, -60000000,0x003023c},
16412-
{-180000000, -90000000, 180000000, -60000000,0x1860037},
16413-
{ -80000000, -90000000, -20000000, -60000000,0x003023c},
16414-
{-180000000, -90000000, 180000000, -60000000,0x1860037},
16415-
{ -90000000, -90000000, -53000000, -60000000,0x003023c},
16416-
{-180000000, -90000000, 180000000, -60000000,0x1860037},
16417-
{ -74000000, -90000000, -25000000, -60000000,0x003023c},
16418-
{ -91104216, -69041108, -90099072, -68648276,0x001002c},
1641916402
{-180000000, -90000000, 180000000, -60000000,0x1860037},
1642016403
{-180000000, -90000000, 180000000, -77183669,0x0010497},
1642116404
{-180000000, -77183669, 180000000, -66998607,0x1000c97},

0 commit comments

Comments
 (0)