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.
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,2CG=2CT,1GU=GUM,1UM=UMI,1VI=VIR,1PR=PRI,1AS=ASM,1MP=MNP,4JB=JBT,4QL=QLD,4TS=TAS, 4CX=CXR,4CC=CCK,4NF=NFK,4HM=HMD,4NI=NFK, COL=5CL,5ME=5MX,MEX=5MX,5TM=TAM,5AG=AGU,5BC=BCN,5BS=BCS,5CM=CAM,5CS=CHP,5CH=CHH,5CO=COA,5DF=DIF,5DG=DUR,5GT=GUA,5GR=GRO,5HG=HID,5JA=JAL,5MI=MIC,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,EAZ=TZA,SKM=2SK ,TAA=SHN,ASC=SHN,DGA=IOT,WAK=MHL,JTN=UMI,MID=1HI,2OD=2OR,"
26+ #define ALIASES "2UK=2UT,2CG=2CT,1GU=GUM,1UM=UMI,1VI=VIR,1PR=PRI,1AS=ASM,1MP=MNP,4CX=CXR,4CC=CCK,4NF=NFK,4HM=HMD,COL=5CL,5ME=5MX,MEX=5MX,5TM=TAM,5AG=AGU,5BC=BCN,5BS=BCS,5CM=CAM,5CS=CHP,5CH=CHH,5CO=COA,5DF=DIF,5DG=DUR,5GT=GUA,5GR=GRO,5HG=HID,5JA=JAL,5MI=MIC,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
2929static 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
171170static 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
232230typedef 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