88
99----
1010
11- ** Online documentation can be found at: http://mapcode-foundation.github.io/mapcode-ada/ **
12-
1311# License
1412
1513Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,9 +26,12 @@ Original C library created by Pieter Geelen. Work on Java version
2826of the Mapcode library by Rijn Buve and Matthew Lowden. Port into Ada (except
2927multi-language support) by Pascal Malaise.
3028
29+ The original Ada port can be found at:
30+ https://github.com/malaise/ada/tree/master/usr/mapcode
31+
3132# Ada Files for Mapcode Support
3233
33- The following files, in directory src, provide utilities for mapcode processing:
34+ The following files, in directory ` src ` , provide utilities for mapcode processing:
3435
3536 as_u.ads as_u.adb - Unbounded strings
3637 bits.ads bits.adb - Bit operations
@@ -47,28 +48,28 @@ The following file contains the main procedure for testing the interfaces:
4748 t_mapcode.adb - Command line tool to test Ada mapcodes
4849
4950
50- In directory test, the command fulltest launches a complete test of the library.
51+ In directory ` test ` , the command ` fulltest ` launches a complete test of the library.
5152
5253# Using the Library
5354
5455## Operations related to territories
5556
5657A territory is identified by a code (an ISO 3166 code such as “NLD” or "US-DC"), with some
5758possible aliases (example "US" = "USA"), and a unique number, from 0 for "VAT" (Vatican),
58- to 532 for "AAA" (International), defined as Territory_Range.
59+ to 532 for "AAA" (International), defined as ` Territory_Range ` .
5960
6061Large territories (MX, IN, AU, BR, US, CA, RU and CN) are decomposed into subdivisions.
6162
62- ** Get_Territory_Number** returns the territory number of a territory code. An optional context helps to interpret
63+ * ` Get_Territory_Number ` returns the territory number of a territory code. An optional context helps to interpret
6364ambiguous (abbreviated) alphacodes of subdivisions, such as "AL". If several subdivisions match the specification
6465(no context provided) it returns the lowest number that matches.
6566
66- attribute | description
67+ Attribute | Description
6768--- | ---
68- Territory | string, mapcode to decode
69- Context | optional string, (an ISO code such as “US”) territory for a subdivision
70- return value | Territory_Range, territory number
71- exceptions | Unknown_Territory if the territory code is not known
69+ ` Territory ` | string, mapcode to decode
70+ ` Context ` | optional string, (an ISO code such as “US”) territory for a subdivision
71+ return value | ` Territory_Range ` , territory number
72+ exceptions | ` Unknown_Territory ` if the territory code is not known
7273
7374Examples:
7475
@@ -87,12 +88,12 @@ Ambiguous code and context.
8788 Get_Territory_Number ("IN", "AR")
8889 -> 285 // IN-AR/Arunachal Pradesh
8990
90- ** Get_Territory_Alpha_Code** returns the territory ISO 3166 code of a territory.
91+ ` Get_Territory_Alpha_Code ` returns the territory ISO 3166 code of a territory.
9192
92- attribute | description
93+ Attribute | Description
9394--- | ---
94- Territory_Number | Territory_Range
95- Format | Local (often ambiguous), International (full and unambiguous, default), or Shortest
95+ ` Territory_Number ` | ` Territory_Range `
96+ ` Format ` | ` Local ` (often ambiguous), ` International ` (full and unambiguous, default), or ` Shortest `
9697return value | string, territory ISO code
9798
9899Examples:
@@ -111,22 +112,22 @@ Examples:
111112
112113** Get_Territory_Fullname** returns the full common name of a territory
113114
114- attribute | description
115+ Attribute | Description
115116--- | ---
116- Territory_Number | Territory_Range
117+ ` Territory_Number ` | ` Territory_Range `
117118return value | string, territory name
118119
119120Examples:
120121
121122 Get_Territory_Fullname (391)
122123 -> California
123124
124- ** Get_Parent_Of** returns the parent territory number of a subdivision.
125+ ` Get_Parent_Of ` returns the parent territory number of a subdivision.
125126
126- attribute | description
127+ Attribute | Description
127128--- | ---
128- Territory_Number | Territory_Range
129- return value | Territory_Range, parent territory number
129+ ` Territory_Number ` | ` Territory_Range `
130+ return value | ` Territory_Range ` , parent territory number
130131exceptions | Not_A_Subdivision, if the Territory_Number has no parent (i.e. is not a subdivision)
131132
132133** Is_Subdivision** returns True if the provided territory is a subdivision.
@@ -150,7 +151,7 @@ This means that a coordinate will often yield mapcode possibilities in more than
150151Each possibility correctly represents the coordinate, but which one is * politically* correct is a
151152choice that must be made (in advance or afterwards) by the caller or user of the routines.
152153
153- There is only one operation, ** encode** , which generates the possible mapcodes for a coordinate.
154+ There is only one operation, ` encode ` , which generates the possible mapcodes for a coordinate.
154155At least it takes as input a latitude in degrees (all values allowed, maximized by routine to 90.0 and minimized
155156to -90.0) and a longitude in degrees (all values allowed, wrapped to -180.0 and +180.0).
156157
@@ -172,13 +173,13 @@ sometimes called the “default mapcode” for a particular territory.
172173
173174Examples:
174175
175- With a territory specified, and Shortest set, returns the default mapcode for this territory.
176+ With a territory specified, and ` Shortest ` set, returns the default mapcode for this territory.
176177
177178 Encode ( (52.376514000, 4.908543375 40.786245000), "NLD")
178179 -> 49.4V NLD 'NLD 49.4V' 112
179180
180181
181- With a territory specified, and Shortest set to False, returns all the possible mapcodes
182+ With a territory specified, and ` Shortest ` set to ` False ` , returns all the possible mapcodes
182183for this territory.
183184
184185 Encode ( (52.376514000, 4.908543375 40.786245000), "NLD", False)
@@ -187,7 +188,7 @@ for this territory.
187188 -> DL6.H9L NLD 'NLD DL6.H9L' 112
188189 -> P25Z.N3Z NLD 'NLD P25Z.N3Z' 112
189190
190- With no limitation to a territory (and Shortest set), returns at least a worldwide mapcode
191+ With no limitation to a territory (and ` Shortest ` set), returns at least a worldwide mapcode
191192(territory AAA, code 532), and possibly some mapcodes in territories.
192193
193194 Encode ( (52.376514000, 4.908543375 40.786245000) )
@@ -202,18 +203,18 @@ With a precision of 2, returns high precision mapcodes.
202203
203204## Converting a Mapcode into a Coordinate
204205
205- There is only one operation, ** decode** , which gives the coordinate of a mapcode.
206+ There is only one operation, ` decode ` , which gives the coordinate of a mapcode.
206207It accepts an optional argument to define the territoy context of the mapcode.
207208
208209The operation returns the coordinate (latitude and longitude in degrees), or raises the
209210exception Decode_Error if the mapcode is not valid or ambiguous (in the context).
210211
211- attribute | description
212+ Attribute | Description
212213--- | ---
213- Mapcode | string, mapcode to decode
214- Context | optional string, (an ISO code such as “NLD”) territory for the scope of the mapcode
214+ ` Mapcode ` | string, mapcode to decode
215+ ` Context ` | optional string, (an ISO code such as “NLD”) territory for the scope of the mapcode
215216return value | coordinate (latitude and longitude in degrees), reals
216- exceptions | Decode_Error, if the mapcode is invalid or ambiguous in the Context
217+ exceptions | ` Decode_Error ` , if the mapcode is invalid or ambiguous in the Context
217218
218219Examples:
219220
@@ -230,7 +231,7 @@ Without any context, only accept a worldwide mapcode.
230231
231232# Using the testing program
232233
233- The command line testing tool ** t_mapcode** can perform 3 actions:
234+ The command line testing tool ` t_mapcode** can perform 3 actions:
234235
235236* Display information on a territory number or territory ISO 3166 code
236237
0 commit comments