From f4f5381f66f460525ec7571f193967335a378602 Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Mon, 3 Aug 2015 17:46:24 +0200 Subject: [PATCH 1/2] Release 2.0.1 --- README.md | 59 +-- ctrynams.js | 268 +++++------ ctrynams_short.js | 551 +++++++++++++++++++++++ mapcode.js | 993 +++++++++++++++++++---------------------- mapcode_library_js.doc | Bin 77824 -> 93184 bytes ndata.js | 7 +- sample.html | 10 +- 7 files changed, 1184 insertions(+), 704 deletions(-) create mode 100644 ctrynams_short.js diff --git a/README.md b/README.md index 192be86..8d3faad 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,15 @@ Copyright (C) 2014 Stichting Mapcode Foundation (http://www.mapcode.com) **Online documentation can be found at: http://mapcode-foundation.github.io/mapcode-js/** If you plan to use mapcodes in HTML/Javascript extensively, you may be interested in -looking at running an instance of a Mapcode REST API server in your applications -landscape. +looking at running an instance of a Mapcode REST API server in your applications +landscape. -This reduces the payload the HTML/Javascript tremendously, as the mapcode tables will +This reduces the payload the HTML/Javascript tremendously, as the mapcode tables will not need to be transported to the client. You can find the Mapcode REST API sources, ready to be deployed on any JVM server, like Tomcat or Jetty, on: **https://github.com/mapcode-foundation/mapcode-rest-service** - ## License Licensed under the Apache License, Version 2.0 (the "License"); @@ -46,6 +45,10 @@ of the Mapcode library by Rijn Buve and Matthew Lowden. * July 2015 + * 2.0.1 + + Prettyfied source and minor fixes. + * 2.0.0 Fixes to the data rectangles (primarily intended for ISO proposal), see Word document for details. @@ -59,15 +62,15 @@ of the Mapcode library by Rijn Buve and Matthew Lowden. * May 2015 * 1.50.3 - + Redesign of the API to conform to Javascript standards and match the Java implementation of the mapcode system * 1.50.1 - + Bugfix for mapcodes in IN-DD (in India). - * 1.50 - + * 1.50 + Major release. This version is not backwards compatible with mapcode 1.4x: is has dropped support for Antartica AT0-8 codes and has a changed (improved) way of dealing with the Greek alphabet. @@ -79,49 +82,49 @@ of the Mapcode library by Rijn Buve and Matthew Lowden. * January 2015 - * 1.41 - + * 1.41 + Added the India state Telangana (IN-TG), until 2014 a region in Adhra Pradesh. * August 2014 - * 1.33 - + * 1.33 + Normalise results when longitude below -180 degrees. - * 1.32 - + * 1.32 + Prevent FIJI failing to decode at exactly 180 degrees; prevent invalid filtering near the territory bounding rectangle. * April 2014 - * 1.31 - + * 1.31 + Make iso2ccode() even more forgiving by allowing a state alias to be recognized in context. - * 1.3 - + * 1.3 + Disable 7-char state codes for large states in India, and instead generate country mapcodes for states. - * 1.28 - + * 1.28 + Fix for starpipe "zoning" error, causing the last 2 mapcode characters to be ignored in certain areas. - * 1.27 - + * 1.27 + Support undefined ranges in data array (useful for partial JavaScript builds). * May 2013 - * 1.26 - + * 1.26 + Added alias OD for India, and 2.3 code for Daman and Diu. - * 1.25 - + * 1.25 + Ccode2iso(c,2) support added. - * 1.24 - + * 1.24 + Public domain release. diff --git a/ctrynams.js b/ctrynams.js index b2a1862..229fdbb 100644 --- a/ctrynams.js +++ b/ctrynams.js @@ -15,138 +15,138 @@ */ var isofullname = [ - 'Vatican City (Holy See)', 'Monaco', 'Gibraltar', 'Tokelau', - 'Cocos Islands (Keeling Islands)', 'Saint-Barthelemy', 'Nauru', 'Tuvalu', - 'Macau (Aomen)', 'Sint Maarten', 'Saint-Martin', 'Norfolk and Philip Island (Philip Island)', - 'Pitcairn Islands', 'Bouvet Island', 'Bermuda', 'British Indian Ocean Territory', - 'San Marino', 'Guernsey', 'Anguilla', 'Montserrat', - 'Jersey', 'Christmas Island', 'Wallis and Futuna (Futuna)', 'British Virgin Islands (Virgin Islands, British)', - 'Liechtenstein', 'Aruba', 'Marshall Islands', 'American Samoa (Samoa, American)', - 'Cook Islands', 'Saint Pierre and Miquelon (Miquelon)', 'Niue', 'Saint Kitts and Nevis (Nevis)', - 'Cayman islands', 'Bonaire, St Eustasuis and Saba (Saba) (St Eustasius)', 'Maldives', 'Saint Helena, Ascension and Tristan da Cunha (Ascension) (Tristan da Cunha)', - 'Malta', 'Grenada', 'US Virgin Islands (Virgin Islands, US)', 'Mayotte', - 'Svalbard and Jan Mayen (Jan Mayen) (Spitsbergen)', 'Saint Vincent and the Grenadines (Grenadines)', 'Heard Island and McDonald Islands (McDonald Islands)', 'Barbados', - 'Antigua and Barbuda (Barbuda)', 'Curacao', 'Seychelles', 'Palau', - 'Northern Mariana Islands', 'Andorra', 'Guam', 'Isle of Man', - 'Saint Lucia', 'Micronesia (Federated States of Micronesia)', 'Singapore', 'Tonga', - 'Dominica', 'Bahrain', 'Kiribati', 'Turks and Caicos Islands (Caicos Islands)', - 'Sao Tome and Principe (Principe)', 'Hong Kong (Xianggang)', 'Martinique', 'Faroe Islands', - 'Guadeloupe', 'Comoros', 'Mauritius', 'Reunion', - 'Luxembourg', 'Samoa', 'South Georgia and the South Sandwich Islands (South Sandwich Islands)', 'French Polynesia', - 'Cape Verde', 'Trinidad and Tobago (Tobago)', 'Brunei', 'French Southern and Antarctic Lands', - 'Puerto Rico', 'Cyprus', 'Lebanon', 'Jamaica', - 'Gambia (The Gambia)', 'Qatar', 'Falkland Islands', 'Vanuatu', - 'Montenegro', 'Bahamas', 'East Timor', 'Swaziland', - 'Kuwait', 'Fiji', 'New Caledonia', 'Slovenia', - 'Israel', 'Palestinian territories', 'El Salvador', 'Belize', - 'Djibouti', 'Macedonia', 'Rwanda', 'Haiti', - 'Burundi', 'Equatorial Guinea', 'Albania', 'Solomon Islands', - 'Armenia', 'Lesotho', 'Belgium', 'Moldova', - 'Guinea-Bissau', 'Taiwan', 'Bhutan', 'Switzerland', - 'Netherlands', 'Denmark', 'Estonia', 'Dominican Republic', - 'Slovakia', 'Costa Rica', 'Bosnia and Herzegovina', 'Croatia', - 'Togo', 'Latvia', 'Lithuania', 'Sri Lanka', - 'Georgia', 'Ireland', 'Sierra Leone', 'Panama', - 'Czech Republic', 'French Guiana', 'United Arab Emirates', 'Austria', - 'Azerbaijan', 'Serbia', 'Jordan', 'Portugal', - 'Hungary', 'South Korea', 'Iceland', 'Guatemala', - 'Cuba', 'Bulgaria', 'Liberia', 'Honduras', - 'Benin', 'Eritrea', 'Malawi', 'North Korea', - 'Nicaragua', 'Greece', 'Tajikistan', 'Bangladesh', - 'Nepal', 'Tunisia', 'Suriname', 'Uruguay', - 'Cambodia', 'Syria', 'Senegal', 'Kyrgyzstan', - 'Belarus', 'Guyana', 'Laos', 'Romania', - 'Ghana', 'Uganda', 'United Kingdom (Scotland) (Great Britain) (Northern Ireland) (Ireland, Northern)', 'Guinea', - 'Ecuador', 'Western Sahara (Sahrawi)', 'Gabon', 'New Zealand', - 'Burkina Faso', 'Philippines', 'Italy', 'Oman', - 'Poland', 'Ivory Coast', 'Norway', 'Malaysia', - 'Vietnam', 'Finland', 'Congo-Brazzaville', 'Germany', - 'Japan', 'Zimbabwe', 'Paraguay', 'Iraq', - 'Morocco', 'Uzbekistan', 'Sweden', 'Papua New Guinea', - 'Cameroon', 'Turkmenistan', 'Spain', 'Thailand', - 'Yemen', 'France', 'Aaland Islands', 'Kenya', - 'Botswana', 'Madagascar', 'Ukraine', 'South Sudan', - 'Central African Republic', 'Somalia', 'Afghanistan', 'Myanmar (Burma)', - 'Zambia', 'Chile', 'Turkey', 'Pakistan', - 'Mozambique', 'Namibia', 'Venezuela', 'Nigeria', - 'Tanzania', 'Egypt', 'Mauritania', 'Bolivia', - 'Ethiopia', 'Colombia', 'South Africa', 'Mali', - 'Angola', 'Niger', 'Chad', 'Peru', - 'Mongolia', 'Iran', 'Libya', 'Sudan', - 'Indonesia', 'Federal District', 'Tlaxcala', 'Morelos', - 'Aguascalientes', 'Colima', 'Queretaro', 'Hidalgo', - 'Mexico State', 'Tabasco', 'Nayarit', 'Guanajuato', - 'Puebla', 'Yucatan', 'Quintana Roo', 'Sinaloa', - 'Campeche', 'Michoacan', 'San Luis Potosi', 'Guerrero', - 'Nuevo Leon', 'Baja California', 'Veracruz', 'Chiapas', - 'Baja California Sur', 'Zacatecas', 'Jalisco', 'Tamaulipas', - 'Oaxaca', 'Durango', 'Coahuila', 'Sonora', - 'Chihuahua', 'Greenland', 'Saudi Arabia', 'Congo-Kinshasa', - 'Algeria', 'Kazakhstan', 'Argentina', 'Daman and Diu', - 'Dadra and Nagar Haveli', 'Chandigarh', 'Andaman and Nicobar', 'Lakshadweep', - 'Delhi', 'Meghalaya', 'Nagaland', 'Manipur', - 'Tripura', 'Mizoram', 'Sikkim', 'Punjab', - 'Haryana', 'Arunachal Pradesh', 'Assam', 'Bihar', - 'Uttarakhand', 'Goa', 'Kerala', 'Tamil Nadu', - 'Himachal Pradesh', 'Jammu and Kashmir', 'Chhattisgarh', 'Jharkhand', - 'Karnataka', 'Rajasthan', 'Odisha (Orissa)', 'Gujarat', - 'West Bengal', 'Madhya Pradesh', 'Telangana', 'Andhra Pradesh', - 'Maharashtra', 'Uttar Pradesh', 'Puducherry', 'New South Wales', - 'Australian Capital Territory', 'Jervis Bay Territory', 'Northern Territory', 'South Australia', - 'Tasmania', 'Victoria', 'Western Australia', 'Queensland', - 'Distrito Federal', 'Sergipe', 'Alagoas', 'Rio de Janeiro', - 'Espirito Santo', 'Rio Grande do Norte', 'Paraiba', 'Santa Catarina', - 'Pernambuco', 'Amapa', 'Ceara', 'Acre', - 'Parana', 'Roraima', 'Rondonia', 'Sao Paulo', - 'Piaui', 'Tocantins', 'Rio Grande do Sul', 'Maranhao', - 'Goias', 'Mato Grosso do Sul', 'Bahia', 'Minas Gerais', - 'Mato Grosso', 'Para', 'Amazonas', 'District of Columbia', - 'Rhode Island', 'Delaware', 'Connecticut', 'New Jersey', - 'New Hampshire', 'Vermont', 'Massachusetts', 'Hawaii', - 'Maryland', 'West Virginia', 'South Carolina', 'Maine', - 'Indiana', 'Kentucky', 'Tennessee', 'Virginia', - 'Ohio', 'Pennsylvania', 'Mississippi', 'Louisiana', - 'Alabama', 'Arkansas', 'North Carolina', 'New York', - 'Iowa', 'Illinois', 'Georgia', 'Wisconsin', - 'Florida', 'Missouri', 'Oklahoma', 'North Dakota', - 'Washington', 'South Dakota', 'Nebraska', 'Kansas', - 'Idaho', 'Utah', 'Minnesota', 'Michigan', - 'Wyoming', 'Oregon', 'Colorado', 'Nevada', - 'Arizona', 'New Mexico', 'Montana', 'California', - 'Texas', 'Alaska', 'British Columbia', 'Alberta', - 'Ontario', 'Quebec', 'Saskatchewan', 'Manitoba', - 'Newfoundland and Labrador (Labrador)', 'New Brunswick', 'Nova Scotia', 'Prince Edward Island', - 'Yukon', 'Northwest Territories', 'Nunavut', 'India', - 'Australia', 'Brazil', 'USA (United States of America) (America)', 'Mexico', - 'Moscow', 'Saint Petersburg', 'Kaliningrad Oblast', 'Ingushetia Republic', - 'Adygea Republic', 'North Ossetia-Alania Republic', 'Kabardino-Balkar Republic', 'Karachay-Cherkess Republic', - 'Chechen Republic', 'Chuvash Republic', 'Ivanovo Oblast', 'Lipetsk Oblast', - 'Oryol Oblast', 'Tula Oblast', 'Belgorod Oblast', 'Vladimir Oblast', - 'Kursk Oblast', 'Kaluga Oblast', 'Tambov Oblast', 'Bryansk Oblast', - 'Yaroslavl Oblast', 'Ryazan Oblast', 'Astrakhan Oblast', 'Moscow Oblast', - 'Smolensk Oblast', 'Dagestan Republic', 'Voronezh Oblast', 'Novgorod Oblast', - 'Pskov Oblast', 'Kostroma Oblast', 'Stavropol Krai', 'Krasnodar Krai', - 'Kalmykia Republic', 'Tver Oblast', 'Leningrad Oblast', 'Rostov Oblast', - 'Volgograd Oblast', 'Vologda Oblast', 'Murmansk Oblast', 'Karelia Republic', - 'Nenets Autonomous Okrug', 'Komi Republic', 'Arkhangelsk Oblast', 'Mordovia Republic', - 'Nizhny Novgorod Oblast', 'Penza Oblast', 'Kirov Oblast', 'Mari El Republic', - 'Orenburg Oblast', 'Ulyanovsk Oblast', 'Perm Krai', 'Bashkortostan Republic', - 'Udmurt Republic', 'Tatarstan Republic', 'Samara Oblast', 'Saratov Oblast', - 'Yamalo-Nenets', 'Khanty-Mansi', 'Sverdlovsk Oblast', 'Tyumen Oblast', - 'Kurgan Oblast', 'Chelyabinsk Oblast', 'Buryatia Republic', 'Zabaykalsky Krai', - 'Irkutsk Oblast', 'Novosibirsk Oblast', 'Tomsk Oblast', 'Omsk Oblast', - 'Khakassia Republic', 'Kemerovo Oblast', 'Altai Republic', 'Altai Krai', - 'Tuva Republic', 'Krasnoyarsk Krai', 'Magadan Oblast', 'Chukotka Okrug', - 'Kamchatka Krai', 'Sakhalin Oblast', 'Primorsky Krai', 'Jewish Autonomous Oblast', - 'Khabarovsk Krai', 'Amur Oblast', 'Sakha Republic (Yakutia Republic)', 'Canada', - 'Russia', 'Shanghai', 'Tianjin', 'Beijing', - 'Hainan', 'Ningxia Hui', 'Chongqing', 'Zhejiang', - 'Jiangsu', 'Fujian', 'Anhui', 'Liaoning', - 'Shandong', 'Shanxi', 'Jiangxi', 'Henan', - 'Guizhou', 'Guangdong', 'Hubei', 'Jilin', - 'Hebei', 'Shaanxi', 'Nei Mongol (Inner Mongolia)', 'Heilongjiang', - 'Hunan', 'Guangxi Zhuang', 'Sichuan', 'Yunnan', - 'Xizang (Tibet)', 'Gansu', 'Qinghai', 'Xinjiang Uyghur', - 'China', 'United States Minor Outlying Islands', 'Clipperton Island', 'Antarctica', - 'International (Worldwide) (Earth)', '?']; + "Vatican City State (Holy See)", "Monaco (Principality of _)", "Gibraltar", "Tokelau", + "Cocos Islands (Keeling Islands)", "Saint-Barthelemy (Collectivity of _)", "Nauru (Republic of _)", "Tuvalu", + "Macau (Aomen)", "Sint Maarten", "Saint Martin (Collectivity of _)", "Norfolk and Philip Island (Philip Island)", + "Pitcairn Group of Islands", "Bouvet Island", "Bermuda (Somers Isles)", "British Indian Ocean Territory", + "San Marino (Republic of _)", "Guernsey (Bailiwick of _)", "Anguilla", "Montserrat", + "Jersey (Bailiwick of _)", "Christmas Island", "Wallis and Futuna (Futuna) (Collectivity of the _ Islands)", "British Virgin Islands (Virgin Islands, British)", + "Liechtenstein (Principality of _)", "Aruba", "Marshall Islands (Republic of the _)", "American Samoa (Samoa, American)", + "Cook Islands", "Saint Pierre and Miquelon (Miquelon) (Collectivity of _)", "Niue", "Saint Kitts and Nevis (Nevis) (Federation of _)", + "Cayman islands", "Bonaire, St Eustasuis and Saba (Saba) (St Eustasius)", "Maldives (Republic of _)", "Saint Helena, Ascension and Tristan da Cunha (Ascension) (Tristan da Cunha)", + "Malta (Republic of _)", "Grenada", "Virgin Islands of the United States (US Virgin Islands) (American Virgin Islands)", "Mayotte (Maore)", + "Svalbard and Jan Mayen (Jan Mayen) (Spitsbergen)", "Saint Vincent and the Grenadines (Grenadines)", "Heard Island and McDonald Islands (McDonald Islands)", "Barbados", + "Antigua and Barbuda (Barbuda)", "Curacao", "Seychelles (Republic of _)", "Palau (Republic of _)", + "Northern Mariana Islands (Commonwealth of the _)", "Andorra (Principality of _) (Principality of the Valleys of _)", "Guam", "Isle of Mann (Mann)", + "Saint Lucia", "Micronesia (Federated States of Micronesia)", "Singapore (Republic of _)", "Tonga (Kingdom of _)", + "Dominica (Commonwealth of _)", "Bahrain (Kingdom of _)", "Kiribati (Republic of _)", "Turks and Caicos Islands (Caicos Islands)", + "Sao Tome and Principe (Principe) (Democratic Republic of _)", "Hong Kong (Xianggang)", "Martinique", "Faroe Islands", + "Guadeloupe", "Comoros (Union of the _)", "Mauritius (Republic of _)", "Reunion", + "Luxembourg (Grand Duchy of _)", "Samoa (Independent State of _)", "South Georgia and the South Sandwich Islands (South Sandwich Islands)", "French Polynesia (Collectivity of _)", + "Cape Verde (Cabo Verde) (Republic of Cabo Verde)", "Trinidad and Tobago (Republic of _) (Tobago)", "Brunei (Nation of _, the Abode of Peace)", "French Southern and Antarctic Lands", + "Puerto Rico (Commonwealth of _)", "Cyprus (Republic of _)", "Lebanon (Lebanese Republic)", "Jamaica", + "Gambia (The Gambia) (Republic of the _)", "Qatar (State of _)", "Falkland Islands", "Vanuatu (Republic of _)", + "Montenegro", "Bahamas (Commonwealth of the _)", "Timor-Leste (Democratic Republic of _) (East Timor)", "Swaziland (Kingdom of _)", + "Kuwait (State of _)", "Fiji (Republic of _)", "New Caledonia", "Slovenia (Republic of _)", + "Israel (State of _)", "Palestinian territories (State of Palestine)", "El Salvador (Republic of _)", "Belize", + "Djibouti (Republic of _)", "Macedonia (Republic of _) (FYROM) (Former Yugoslav Republic of Macedonia)", "Rwanda (Republic of _)", "Haiti (Republic of _)", + "Burundi (Republic of _)", "Equatorial Guinea (Republic of _)", "Albania (Republic of _)", "Solomon Islands", + "Armenia (Republic of _)", "Lesotho (Kingdom of _)", "Belgium (Kingdom of _)", "Moldova (Republic of _)", + "Guinea-Bissau (Republic of _)", "Taiwan (Republic of China)", "Bhutan (Kingdom of _)", "Switzerland (Swiss Confederation)", + "Netherlands (The Netherlands) (Kingdom of the _)", "Denmark (Kingdom of _)", "Estonia (Republic of _)", "Dominican Republic", + "Slovakia (Slovak Republic)", "Costa Rica (Republic of _)", "Bosnia and Herzegovina", "Croatia (Republic of _)", + "Togo (Togolese Republic)", "Latvia (Republic of _)", "Lithuania (Republic of _)", "Sri Lanka (Democratic Socialist Republic of _)", + "Georgia", "Ireland (Republic of _)", "Sierra Leone (Republic of _)", "Panama (Republic of _)", + "Czech Republic", "French Guiana (Guiana)", "United Arab Emirates (Emirates)", "Austria (Republic of _)", + "Azerbaijan (Republic of _)", "Serbia (Republic of _)", "Jordan (Hashemite Kingdom of _) (Kingdom of _)", "Portugal (Portuguese Republic)", + "Hungary (Republic of _)", "South Korea (Republic of Korea)", "Iceland", "Guatemala (Republic of _)", + "Cuba (Republic of _)", "Bulgaria (Republic of _)", "Liberia (Republic of _)", "Honduras (Republic of _)", + "Benin (Republic of _)", "Eritrea (State of _)", "Malawi (Republic of _)", "North Korea (Democratic People's Republic of Korea)", + "Nicaragua (Republic of _)", "Greece (Hellenic Republic)", "Tajikistan (Republic of _)", "Bangladesh (People's Republic of _)", + "Nepal (Federal Democratic Republic of _)", "Tunisia (Tunisian Republic) (Republic of _)", "Suriname (Republic of _)", "Uruguay (Eastern Republic of _)", + "Cambodia (Kingdom of _)", "Syria (Syrian Arab Republic)", "Senegal (Republic of _)", "Kyrgyzstan (Kyrgyz Republic)", + "Belarus (Republic of _)", "Guyana (Co-operative Republic of _)", "Laos (Lao People's Democratic Republic)", "Romania", + "Ghana (Republic of _)", "Uganda (Republic of _)", "United Kingdom (Scotland) (Great Britain) (Northern Ireland) (Ireland, Northern) (Britain) (United Kingdom of Great Britain and Northern Ireland)", "Guinea (Republic of _) (Guinea-Conakry)", + "Ecuador (Republic of _)", "Western Sahara (Sahrawi Arab Democratic Republic)", "Gabon (Gabonese Republic)", "New Zealand", + "Burkina Faso", "Philippines (Republic of the _)", "Italy (Italian Republic)", "Oman (Sultanate of _)", + "Poland (Republic of _)", "Ivory Coast (Cote d'Ivoire) (Republic of Cote d'Ivoire)", "Norway (Kingdom of _)", "Malaysia", + "Vietnam (Socialist Republic of _)", "Finland (Republic of _)", "Congo-Brazzaville (West Congo) (Republic of the Congo)", "Germany (Federal Republic of _)", + "Japan", "Zimbabwe (Republic of _)", "Paraguay (Republic of _)", "Iraq (Republic of _)", + "Morocco (Kingdom of _)", "Uzbekistan (Republic of _)", "Sweden (Kingdom of _)", "Papua New Guinea (Independent State of _)", + "Cameroon (Republic of _)", "Turkmenistan", "Spain (Kingdom of _)", "Thailand (Kingdom of _)", + "Yemen (Republic of _)", "France (French Republic)", "Aaland Islands", "Kenya (Republic of _)", + "Botswana (Republic of _)", "Madagascar (Republic of _)", "Ukraine", "South Sudan (Republic of _)", + "Central African Republic", "Somalia (Federal Republic of _)", "Afghanistan (Islamic Republic of _)", "Myanmar (Republic of the Union of _) (Burma)", + "Zambia (Republic of _)", "Chile (Republic of _)", "Turkey (Republic of _)", "Pakistan (Islamic Republic of _)", + "Mozambique (Republic of _)", "Namibia (Republic of _)", "Venezuela (Bolivarian Republic of _)", "Nigeria (Federal Republic of _)", + "Tanzania (United Republic of _)", "Egypt (Arab Republic of _)", "Mauritania (Islamic Republic of _)", "Bolivia (Plurinational State of _)", + "Ethiopia (Federal Democratic Republic of _)", "Colombia (Republic of _)", "South Africa (Republic of _)", "Mali (Republic of _)", + "Angola (Republic of _)", "Niger (Republic of _)", "Chad (Republic of _)", "Peru (Republic of _)", + "Mongolia", "Iran (Persia) (Islamic Republic of _)", "Libya", "Sudan (Republic of the _)", + "Indonesia (Republic of _)", "Federal District", "Tlaxcala", "Morelos", + "Aguascalientes", "Colima", "Queretaro", "Hidalgo", + "Mexico State", "Tabasco", "Nayarit", "Guanajuato", + "Puebla", "Yucatan", "Quintana Roo", "Sinaloa", + "Campeche", "Michoacan", "San Luis Potosi", "Guerrero", + "Nuevo Leon (New Leon)", "Baja California", "Veracruz", "Chiapas", + "Baja California Sur", "Zacatecas", "Jalisco", "Tamaulipas", + "Oaxaca", "Durango", "Coahuila", "Sonora", + "Chihuahua", "Greenland", "Saudi Arabia (Kingdom of _)", "Congo-Kinshasa (Democratic Republic of the Congo) (East Congo)", + "Algeria (People's Democratic Republic of _)", "Kazakhstan (Republic of _)", "Argentina (Argentine Republic)", "Daman and Diu", + "Dadra and Nagar Haveli", "Chandigarh", "Andaman and Nicobar", "Lakshadweep", + "Delhi (National Capital Territory of _)", "Meghalaya", "Nagaland", "Manipur", + "Tripura", "Mizoram", "Sikkim", "Punjab", + "Haryana", "Arunachal Pradesh", "Assam", "Bihar", + "Uttarakhand", "Goa", "Kerala", "Tamil Nadu", + "Himachal Pradesh", "Jammu and Kashmir", "Chhattisgarh", "Jharkhand", + "Karnataka", "Rajasthan", "Odisha (Orissa)", "Gujarat", + "West Bengal", "Madhya Pradesh", "Telangana", "Andhra Pradesh", + "Maharashtra", "Uttar Pradesh", "Puducherry", "New South Wales", + "Australian Capital Territory", "Jervis Bay Territory", "Northern Territory", "South Australia", + "Tasmania", "Victoria", "Western Australia", "Queensland", + "Distrito Federal", "Sergipe", "Alagoas", "Rio de Janeiro", + "Espirito Santo", "Rio Grande do Norte", "Paraiba", "Santa Catarina", + "Pernambuco", "Amapa", "Ceara", "Acre", + "Parana", "Roraima", "Rondonia", "Sao Paulo", + "Piaui", "Tocantins", "Rio Grande do Sul", "Maranhao", + "Goias", "Mato Grosso do Sul", "Bahia", "Minas Gerais", + "Mato Grosso", "Para", "Amazonas", "District of Columbia (Washington, D.C.)", + "Rhode Island", "Delaware", "Connecticut", "New Jersey", + "New Hampshire", "Vermont", "Massachusetts (Commonwealth of _)", "Hawaii", + "Maryland", "West Virginia", "South Carolina", "Maine", + "Indiana", "Kentucky (Commonwealth of _)", "Tennessee", "Virginia (Commonwealth of _)", + "Ohio", "Pennsylvania (Commonwealth of _)", "Mississippi", "Louisiana", + "Alabama", "Arkansas", "North Carolina", "New York", + "Iowa", "Illinois", "Georgia", "Wisconsin", + "Florida", "Missouri", "Oklahoma", "North Dakota", + "Washington", "South Dakota", "Nebraska", "Kansas", + "Idaho", "Utah", "Minnesota", "Michigan", + "Wyoming", "Oregon", "Colorado", "Nevada", + "Arizona", "New Mexico", "Montana", "California", + "Texas", "Alaska", "British Columbia", "Alberta", + "Ontario", "Quebec", "Saskatchewan", "Manitoba", + "Newfoundland and Labrador (Labrador)", "New Brunswick", "Nova Scotia", "Prince Edward Island", + "Yukon", "Northwest Territories", "Nunavut", "India (Republic of _)", + "Australia (Commonwealth of _)", "Brazil (Federative Republic of _)", "USA (United States of America) (America)", "Mexico (United Mexican States)", + "Moscow", "Saint Petersburg", "Kaliningrad Oblast", "Ingushetia", + "Adygea Republic", "North Ossetia-Alania Republic", "Kabardino-Balkar Republic", "Karachay-Cherkess Republic", + "Chechen Republic (Chechnya) (Ichkeria)", "Chuvash Republic", "Ivanovo Oblast", "Lipetsk Oblast", + "Oryol Oblast", "Tula Oblast", "Belgorod Oblast", "Vladimir Oblast", + "Kursk Oblast", "Kaluga Oblast", "Tambov Oblast", "Bryansk Oblast", + "Yaroslavl Oblast", "Ryazan Oblast", "Astrakhan Oblast", "Moscow Oblast", + "Smolensk Oblast", "Dagestan Republic", "Voronezh Oblast", "Novgorod Oblast", + "Pskov Oblast", "Kostroma Oblast", "Stavropol Krai", "Krasnodar Krai", + "Kalmykia Republic", "Tver Oblast", "Leningrad Oblast", "Rostov Oblast", + "Volgograd Oblast", "Vologda Oblast", "Murmansk Oblast", "Karelia Republic", + "Nenets Autonomous Okrug", "Komi Republic", "Arkhangelsk Oblast", "Mordovia Republic", + "Nizhny Novgorod Oblast", "Penza Oblast", "Kirov Oblast", "Mari El Republic", + "Orenburg Oblast", "Ulyanovsk Oblast", "Perm Krai", "Bashkortostan Republic", + "Udmurt Republic", "Tatarstan Republic", "Samara Oblast", "Saratov Oblast", + "Yamalo-Nenets", "Khanty-Mansi", "Sverdlovsk Oblast", "Tyumen Oblast", + "Kurgan Oblast", "Chelyabinsk Oblast", "Buryatia Republic", "Zabaykalsky Krai", + "Irkutsk Oblast", "Novosibirsk Oblast", "Tomsk Oblast", "Omsk Oblast", + "Khakassia Republic", "Kemerovo Oblast", "Altai Republic", "Altai Krai", + "Tuva Republic", "Krasnoyarsk Krai", "Magadan Oblast", "Chukotka Okrug", + "Kamchatka Krai", "Sakhalin Oblast", "Primorsky Krai", "Jewish Autonomous Oblast", + "Khabarovsk Krai", "Amur Oblast", "Sakha Republic (Yakutia Republic)", "Canada", + "Russia (Russian Federation)", "Shanghai Municipality", "Tianjin Municipality", "Beijing Municipality", + "Hainan Province", "Ningxia Hui Autonomous Region", "Chongqing Municipality", "Zhejiang Province", + "Jiangsu Province", "Fujian Province", "Anhui Province", "Liaoning Province", + "Shandong Province", "Shanxi Province", "Jiangxi Province", "Henan Province", + "Guizhou Province", "Guangdong Province", "Hubei Province", "Jilin Province", + "Hebei Province (Yanzhao Province)", "Shaanxi Province", "Nei Mongol Autonomous Region (Inner Mongolia)", "Heilongjiang Province", + "Hunan Province", "Guangxi Zhuang Autonomous Region", "Sichuan Province", "Yunnan Province", + "Xizang Autonomous Region (Tibet)", "Gansu Province", "Qinghai Province (Tsinghai Province)", "Xinjiang Uyghur Autonomous Region", + "China (People's Republic of _)", "United States Minor Outlying Islands", "Clipperton Island", "Antarctica", + "International (Worldwide) (Earth)", "?"]; diff --git a/ctrynams_short.js b/ctrynams_short.js new file mode 100644 index 0000000..e92a7fd --- /dev/null +++ b/ctrynams_short.js @@ -0,0 +1,551 @@ +/* + * Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var isofullname = [ + "Vatican City State (Holy See)", + "Monaco", + "Gibraltar", + "Tokelau", + "Cocos Islands (Keeling Islands)", + "Saint-Barthelemy", + "Nauru", + "Tuvalu", + "Macau (Aomen)", + "Sint Maarten", + "Saint Martin", + "Norfolk and Philip Island (Philip Island)", + "Pitcairn Group of Islands", + "Bouvet Island", + "Bermuda (Somers Isles)", + "British Indian Ocean Territory", + "San Marino", + "Guernsey", + "Anguilla", + "Montserrat", + "Jersey", + "Christmas Island", + "Wallis and Futuna (Futuna)", + "British Virgin Islands (Virgin Islands, British)", + "Liechtenstein", + "Aruba", + "Marshall Islands", + "American Samoa (Samoa, American)", + "Cook Islands", + "Saint Pierre and Miquelon (Miquelon)", + "Niue", + "Saint Kitts and Nevis (Nevis)", + "Cayman islands", + "Bonaire, St Eustasuis and Saba (Saba) (St Eustasius)", + "Maldives", + "Saint Helena, Ascension and Tristan da Cunha (Ascension) (Tristan da Cunha)", + "Malta", + "Grenada", + "Virgin Islands of the United States (US Virgin Islands) (American Virgin Islands)", + "Mayotte (Maore)", + "Svalbard and Jan Mayen (Jan Mayen) (Spitsbergen)", + "Saint Vincent and the Grenadines (Grenadines)", + "Heard Island and McDonald Islands (McDonald Islands)", + "Barbados", + "Antigua and Barbuda (Barbuda)", + "Curacao", + "Seychelles", + "Palau", + "Northern Mariana Islands", + "Andorra", + "Guam", + "Isle of Mann (Mann)", + "Saint Lucia", + "Micronesia (Federated States of Micronesia)", + "Singapore", + "Tonga", + "Dominica", + "Bahrain", + "Kiribati", + "Turks and Caicos Islands (Caicos Islands)", + "Sao Tome and Principe (Principe)", + "Hong Kong (Xianggang)", + "Martinique", + "Faroe Islands", + "Guadeloupe", + "Comoros", + "Mauritius", + "Reunion", + "Luxembourg", + "Samoa", + "South Georgia and the South Sandwich Islands (South Sandwich Islands)", + "French Polynesia", + "Cape Verde (Cabo Verde) (Republic of Cabo Verde)", + "Trinidad and Tobago (Tobago)", + "Brunei", + "French Southern and Antarctic Lands", + "Puerto Rico", + "Cyprus", + "Lebanon (Lebanese Republic)", + "Jamaica", + "Gambia (The Gambia)", + "Qatar", + "Falkland Islands", + "Vanuatu", + "Montenegro", + "Bahamas", + "Timor-Leste (East Timor)", + "Swaziland", + "Kuwait", + "Fiji", + "New Caledonia", + "Slovenia", + "Israel", + "Palestinian territories (State of Palestine)", + "El Salvador", + "Belize", + "Djibouti", + "Macedonia (FYROM) (Former Yugoslav Republic of Macedonia)", + "Rwanda", + "Haiti", + "Burundi", + "Equatorial Guinea", + "Albania", + "Solomon Islands", + "Armenia", + "Lesotho", + "Belgium", + "Moldova", + "Guinea-Bissau", + "Taiwan (Republic of China)", + "Bhutan", + "Switzerland (Swiss Confederation)", + "Netherlands (The Netherlands)", + "Denmark", + "Estonia", + "Dominican Republic", + "Slovakia (Slovak Republic)", + "Costa Rica", + "Bosnia and Herzegovina", + "Croatia", + "Togo (Togolese Republic)", + "Latvia", + "Lithuania", + "Sri Lanka", + "Georgia", + "Ireland", + "Sierra Leone", + "Panama", + "Czech Republic", + "French Guiana (Guiana)", + "United Arab Emirates (Emirates)", + "Austria", + "Azerbaijan", + "Serbia", + "Jordan", + "Portugal (Portuguese Republic)", + "Hungary", + "South Korea (Republic of Korea)", + "Iceland", + "Guatemala", + "Cuba", + "Bulgaria", + "Liberia", + "Honduras", + "Benin", + "Eritrea", + "Malawi", + "North Korea (Democratic People's Republic of Korea)", + "Nicaragua", + "Greece (Hellenic Republic)", + "Tajikistan", + "Bangladesh", + "Nepal", + "Tunisia (Tunisian Republic)", + "Suriname", + "Uruguay", + "Cambodia", + "Syria (Syrian Arab Republic)", + "Senegal", + "Kyrgyzstan (Kyrgyz Republic)", + "Belarus", + "Guyana", + "Laos (Lao People's Democratic Republic)", + "Romania", + "Ghana", + "Uganda", + "United Kingdom (Scotland) (Great Britain) (Northern Ireland) (Ireland, Northern) (Britain) (United Kingdom of Great Britain and Northern Ireland)", + "Guinea (Guinea-Conakry)", + "Ecuador", + "Western Sahara (Sahrawi Arab Democratic Republic)", + "Gabon (Gabonese Republic)", + "New Zealand", + "Burkina Faso", + "Philippines", + "Italy (Italian Republic)", + "Oman", + "Poland", + "Ivory Coast (Cote d'Ivoire) (Republic of Cote d'Ivoire)", + "Norway", + "Malaysia", + "Vietnam", + "Finland", + "Congo-Brazzaville (West Congo) (Republic of the Congo)", + "Germany", + "Japan", + "Zimbabwe", + "Paraguay", + "Iraq", + "Morocco", + "Uzbekistan", + "Sweden", + "Papua New Guinea", + "Cameroon", + "Turkmenistan", + "Spain", + "Thailand", + "Yemen", + "France (French Republic)", + "Aaland Islands", + "Kenya", + "Botswana", + "Madagascar", + "Ukraine", + "South Sudan", + "Central African Republic", + "Somalia", + "Afghanistan", + "Myanmar (Burma)", + "Zambia", + "Chile", + "Turkey", + "Pakistan", + "Mozambique", + "Namibia", + "Venezuela", + "Nigeria", + "Tanzania", + "Egypt", + "Mauritania", + "Bolivia", + "Ethiopia", + "Colombia", + "South Africa", + "Mali", + "Angola", + "Niger", + "Chad", + "Peru", + "Mongolia", + "Iran (Persia)", + "Libya", + "Sudan", + "Indonesia", + "Federal District", + "Tlaxcala", + "Morelos", + "Aguascalientes", + "Colima", + "Queretaro", + "Hidalgo", + "Mexico State", + "Tabasco", + "Nayarit", + "Guanajuato", + "Puebla", + "Yucatan", + "Quintana Roo", + "Sinaloa", + "Campeche", + "Michoacan", + "San Luis Potosi", + "Guerrero", + "Nuevo Leon (New Leon)", + "Baja California", + "Veracruz", + "Chiapas", + "Baja California Sur", + "Zacatecas", + "Jalisco", + "Tamaulipas", + "Oaxaca", + "Durango", + "Coahuila", + "Sonora", + "Chihuahua", + "Greenland", + "Saudi Arabia", + "Congo-Kinshasa (Democratic Republic of the Congo) (East Congo)", + "Algeria", + "Kazakhstan", + "Argentina (Argentine Republic)", + "Daman and Diu", + "Dadra and Nagar Haveli", + "Chandigarh", + "Andaman and Nicobar", + "Lakshadweep", + "Delhi", + "Meghalaya", + "Nagaland", + "Manipur", + "Tripura", + "Mizoram", + "Sikkim", + "Punjab", + "Haryana", + "Arunachal Pradesh", + "Assam", + "Bihar", + "Uttarakhand", + "Goa", + "Kerala", + "Tamil Nadu", + "Himachal Pradesh", + "Jammu and Kashmir", + "Chhattisgarh", + "Jharkhand", + "Karnataka", + "Rajasthan", + "Odisha (Orissa)", + "Gujarat", + "West Bengal", + "Madhya Pradesh", + "Telangana", + "Andhra Pradesh", + "Maharashtra", + "Uttar Pradesh", + "Puducherry", + "New South Wales", + "Australian Capital Territory", + "Jervis Bay Territory", + "Northern Territory", + "South Australia", + "Tasmania", + "Victoria", + "Western Australia", + "Queensland", + "Distrito Federal", + "Sergipe", + "Alagoas", + "Rio de Janeiro", + "Espirito Santo", + "Rio Grande do Norte", + "Paraiba", + "Santa Catarina", + "Pernambuco", + "Amapa", + "Ceara", + "Acre", + "Parana", + "Roraima", + "Rondonia", + "Sao Paulo", + "Piaui", + "Tocantins", + "Rio Grande do Sul", + "Maranhao", + "Goias", + "Mato Grosso do Sul", + "Bahia", + "Minas Gerais", + "Mato Grosso", + "Para", + "Amazonas", + "District of Columbia (Washington, D.C.)", + "Rhode Island", + "Delaware", + "Connecticut", + "New Jersey", + "New Hampshire", + "Vermont", + "Massachusetts", + "Hawaii", + "Maryland", + "West Virginia", + "South Carolina", + "Maine", + "Indiana", + "Kentucky", + "Tennessee", + "Virginia", + "Ohio", + "Pennsylvania", + "Mississippi", + "Louisiana", + "Alabama", + "Arkansas", + "North Carolina", + "New York", + "Iowa", + "Illinois", + "Georgia", + "Wisconsin", + "Florida", + "Missouri", + "Oklahoma", + "North Dakota", + "Washington", + "South Dakota", + "Nebraska", + "Kansas", + "Idaho", + "Utah", + "Minnesota", + "Michigan", + "Wyoming", + "Oregon", + "Colorado", + "Nevada", + "Arizona", + "New Mexico", + "Montana", + "California", + "Texas", + "Alaska", + "British Columbia", + "Alberta", + "Ontario", + "Quebec", + "Saskatchewan", + "Manitoba", + "Newfoundland and Labrador (Labrador)", + "New Brunswick", + "Nova Scotia", + "Prince Edward Island", + "Yukon", + "Northwest Territories", + "Nunavut", + "India", + "Australia", + "Brazil", + "USA (United States of America) (America)", + "Mexico (United Mexican States)", + "Moscow", + "Saint Petersburg", + "Kaliningrad Oblast", + "Ingushetia", + "Adygea Republic", + "North Ossetia-Alania Republic", + "Kabardino-Balkar Republic", + "Karachay-Cherkess Republic", + "Chechen Republic (Chechnya) (Ichkeria)", + "Chuvash Republic", + "Ivanovo Oblast", + "Lipetsk Oblast", + "Oryol Oblast", + "Tula Oblast", + "Belgorod Oblast", + "Vladimir Oblast", + "Kursk Oblast", + "Kaluga Oblast", + "Tambov Oblast", + "Bryansk Oblast", + "Yaroslavl Oblast", + "Ryazan Oblast", + "Astrakhan Oblast", + "Moscow Oblast", + "Smolensk Oblast", + "Dagestan Republic", + "Voronezh Oblast", + "Novgorod Oblast", + "Pskov Oblast", + "Kostroma Oblast", + "Stavropol Krai", + "Krasnodar Krai", + "Kalmykia Republic", + "Tver Oblast", + "Leningrad Oblast", + "Rostov Oblast", + "Volgograd Oblast", + "Vologda Oblast", + "Murmansk Oblast", + "Karelia Republic", + "Nenets Autonomous Okrug", + "Komi Republic", + "Arkhangelsk Oblast", + "Mordovia Republic", + "Nizhny Novgorod Oblast", + "Penza Oblast", + "Kirov Oblast", + "Mari El Republic", + "Orenburg Oblast", + "Ulyanovsk Oblast", + "Perm Krai", + "Bashkortostan Republic", + "Udmurt Republic", + "Tatarstan Republic", + "Samara Oblast", + "Saratov Oblast", + "Yamalo-Nenets", + "Khanty-Mansi", + "Sverdlovsk Oblast", + "Tyumen Oblast", + "Kurgan Oblast", + "Chelyabinsk Oblast", + "Buryatia Republic", + "Zabaykalsky Krai", + "Irkutsk Oblast", + "Novosibirsk Oblast", + "Tomsk Oblast", + "Omsk Oblast", + "Khakassia Republic", + "Kemerovo Oblast", + "Altai Republic", + "Altai Krai", + "Tuva Republic", + "Krasnoyarsk Krai", + "Magadan Oblast", + "Chukotka Okrug", + "Kamchatka Krai", + "Sakhalin Oblast", + "Primorsky Krai", + "Jewish Autonomous Oblast", + "Khabarovsk Krai", + "Amur Oblast", + "Sakha Republic (Yakutia Republic)", + "Canada", + "Russia (Russian Federation)", + "Shanghai", + "Tianjin", + "Beijing", + "Hainan", + "Ningxia Hui", + "Chongqing", + "Zhejiang", + "Jiangsu", + "Fujian", + "Anhui", + "Liaoning", + "Shandong", + "Shanxi", + "Jiangxi", + "Henan", + "Guizhou", + "Guangdong", + "Hubei", + "Jilin", + "Hebei (Yanzhao)", + "Shaanxi", + "Nei Mongol (Inner Mongolia)", + "Heilongjiang", + "Hunan", + "Guangxi Zhuang", + "Sichuan", + "Yunnan", + "Xizang (Tibet)", + "Gansu", + "Qinghai (Tsinghai)", + "Xinjiang Uyghur", + "China", + "United States Minor Outlying Islands", + "Clipperton Island", + "Antarctica", + "International (Worldwide) (Earth)", + "?"]; + diff --git a/mapcode.js b/mapcode.js index 769ed7c..1917ae2 100644 --- a/mapcode.js +++ b/mapcode.js @@ -14,7 +14,6 @@ * limitations under the License. */ - var entity_iso = [ 'VAT', 'MCO', 'GIB', 'TKL', 'CCK', 'BLM', 'NRU', 'TUV', 'MAC', 'SXM', 'MAF', 'NFK', 'PCN', 'BVT', 'BMU', 'IOT', 'SMR', 'GGY', 'AIA', 'MSR', @@ -71,27 +70,20 @@ var entity_iso = [ '8HN', '8GX', '8SC', '8YN', '8XZ', '8GS', '8QH', '8XJ', 'CHN', 'UMI', 'CPT', 'ATA', 'AAA', '?']; - var 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,"; var dependency = [ 27, 410, 50, 410, 26, 410, 53, 410, 48, 410, 47, 410, 76, 410, 529, 410, 38, 410, 21, 408, 4, 408, 42, 408, 11, 408, + 18, 166, 14, 166, 15, 166, 23, 166, 32, 166, 82, 166, 2, 166, 17, 166, 51, 166, 20, 166, 19, 166, 12, 166, 35, 166, 70, 166, 59, 166, 61, 528, 8, 528, 109, 528, 63, 113, 265, 113, 198, 181, - 530, 197, 129, 197, 71, 197, 75, 197, 64, 197, 62, 197, 90, 197, 67, 197, 29, 197, 5, 197, 10, 197, 22, 197, - 18, 166, 14, 166, 15, 166, 23, 166, 32, 166, 82, 166, 2, 166, 17, 166, 51, 166, 20, 166, 19, 166, 12, 166, 35, 166, 70, 166, 59, 166, - 18, 166, 14, 166, 15, 166, 23, 166, 32, 166, 82, 166, 2, 166, 17, 166, 51, 166, 20, 166, 19, 166, 12, 166, 35, 166, 70, 166, 59, 166, + 530, 197, 129, 197, 71, 197, 75, 197, 64, 197, 62, 197, 90, 197, 67, 197, 10, 197, 29, 197, 5, 197, 22, 197, + 13, 178, 40, 178, 25, 112, 33, 112, 45, 112, 9, 112, 28, 171, 30, 171, 3, 171, - 18, 166, 14, 166, 15, 166, 23, 166, 32, 166, 82, 166, 2, 166, 17, 166, 51, 166, 20, 166, 19, 166, 12, 166, 35, 166, 70, 166, 59, 166, - 13, 178, 40, 178, - 18, 166, 14, 166, 15, 166, 23, 166, 32, 166, 82, 166, 2, 166, 17, 166, 51, 166, 20, 166, 19, 166, 12, 166, 35, 166, 70, 166, 59, 166, 77, 210, - 18, 166, 14, 166, 15, 166, 23, 166, 32, 166, 82, 166, 2, 166, 17, 166, 51, 166, 20, 166, 19, 166, 12, 166, 35, 166, 70, 166, 59, 166, - 27, 410, 50, 410, 26, 410, 53, 410, 48, 410, 47, 410, 76, 410, 529, 410, 38, 410, - 27, 410, 50, 410, 26, 410, 53, 410, 48, 410, 47, 410, 76, 410, 529, 410, 38, 410, -1]; var usa_from = 343; @@ -118,19 +110,18 @@ var ccode_chn = 528; var rus_from = 412; var rus_upto = 494; var ccode_rus = 496; -var ccode_ata = 531; var ccode_earth = 532; var parents3 = "USA,IND,CAN,AUS,MEX,BRA,RUS,CHN,"; var parents2 = "US,IN,CA,AU,MX,BR,RU,CN,"; - var ccode_start = 112; // NLD -var mapcode_cversion = "2.0.0"; +var mapcode_cversion = "2.0.2"; +var mapcode_dataversion = "2.0"; // *************************** mapcode_org ********************* -var mapcode_javaversion = '2.0.0/C' + mapcode_cversion; +var mapcode_javaversion = '2.0.1/Data2.0'; /// PRIVATE returns string without leading spaces and plus-signs, and trailing spaces function trim(str) { @@ -187,7 +178,7 @@ function alias2iso(territoryAlphaCode) { /// PRIVATE given ISO code, return territoryNumber (or negative if error) function iso2ccode(territoryAlphaCode) { - if (territoryAlphaCode == "" || typeof territoryAlphaCode == "undefined") { + if (typeof territoryAlphaCode == "undefined") { return undefined; } if (!isNaN(territoryAlphaCode)) { @@ -323,8 +314,7 @@ function isSubdivision(territory) { /// PUBLIC returns true iff territoryNumber is a country that has states function hasSubdivision(territory) { - var territoryNumber = getTerritoryNumber(territory); - return (territoryNumber == ccode_usa || territoryNumber == ccode_ind || territoryNumber == ccode_can || territoryNumber == ccode_aus || territoryNumber == ccode_mex || territoryNumber == ccode_bra || territoryNumber == ccode_chn || territoryNumber == ccode_rus); + return (parents3.indexOf(getTerritoryAlphaCode(getTerritoryNumber(territory), 0)) >= 0); } /// PRIVATE returns true iff x in range (all values in millionths) @@ -336,7 +326,7 @@ function isInRangeX(x, minx, maxx) { x += 360000000; } else { x -= 360000000; - } // 1.32 fix FIJI edge case + } if (minx <= x && x < maxx) { return true; } @@ -344,76 +334,76 @@ function isInRangeX(x, minx, maxx) { } /// PRIVATE returns true iff coordinate inside rectangle (all values in millionths) -function fitsInside(y, x, minx, maxx, miny, maxy) { - return ( miny <= y && y < maxy && isInRangeX(x, minx, maxx) ); +function fitsInside(coord, mm) { + return ( mm.miny <= coord.y && coord.y < mm.maxy && isInRangeX(coord.x, mm.minx, mm.maxx) ); } /// PRIVATE returns true iff coordinate inside rectangle with some room to spare (all values in millionths) -function fitsInsideWithRoom(coord, minx, maxx, miny, maxy) { - if ((( miny - 45) > coord.y) || (coord.y >= (maxy + 45))) { +function fitsInsideWithRoom(coord, mm) { + if ((( mm.miny - 45) > coord.y) || (coord.y >= (mm.maxy + 45))) { return false; } - var xroom = xDivider4(miny, maxy) / 4; - return isInRangeX(coord.x, minx - xroom, maxx + xroom); + var xroom = xDivider4(mm.miny, mm.maxy) / 4; + return isInRangeX(coord.x, mm.minx - xroom, mm.maxx + xroom); } - /// PUBLIC return the AlphaCode (usually an ISO 3166 code) of a territory /// format: 0=local (often ambiguous), 1=international (full and unambiguous, DEFAULT), 2=shortest (shortest non-ambiguous abbreviation) -function getTerritoryAlphaCode(territoryNumber, format) { +function getTerritoryAlphaCode(territory, format) { if (format == undefined) { format = 1; } - if (territoryNumber >= 0 && territoryNumber <= ccode_earth) { - var n = entity_iso[territoryNumber]; - if (/^[0-9]/.test(n)) { - n = n.substring(1); - } - if (format) { - var parent = getParentOf(territoryNumber); - if (parent >= 0) { - if (format == 2) { - // see if n occurs multiple times, if not, don't bother with parent - var count = 0; - var i = aliases.indexOf(n + '='); - if (i >= 0) { - count = 2; - } else if (n.length == 2) { - for (i = 0; i < entity_iso.length; i++) { - if (entity_iso[i].substr(1) == n) { - if (entity_iso[i].charAt(0) >= '0') { - if (entity_iso[i].charAt(0) <= '9') { - count++; - if (count > 1) { - break; - } + var territoryNumber = getTerritoryNumber(territory); + if (territoryNumber < 0 || territoryNumber > ccode_earth) { + return -1; + } + var n = entity_iso[territoryNumber]; + if (/^[0-9]/.test(n)) { + n = n.substring(1); + } + if (format) { + var parent = getParentOf(territoryNumber); + if (parent >= 0) { + if (format == 2) { + // see if n occurs multiple times, if not, don't bother with parent + var count = 0; + var i = aliases.indexOf(n + '='); + if (i >= 0) { + count = 2; + } else if (n.length == 2) { + for (i = 0; i < entity_iso.length; i++) { + if (entity_iso[i].substr(1) == n) { + if (entity_iso[i].charAt(0) >= '0') { + if (entity_iso[i].charAt(0) <= '9') { + count++; + if (count > 1) { + break; } } } } - } else { - for (i = 0; i < entity_iso.length; i++) { - if (entity_iso[i] == n) { - count++; - if (count > 1) { - break; - } + } + } else { + for (i = 0; i < entity_iso.length; i++) { + if (entity_iso[i] == n) { + count++; + if (count > 1) { + break; } } } - if (count == 1) { - return n; - } } - return parentname2(parentletter(entity_iso[parent])) + '-' + n; + if (count == 1) { + return n; + } } + return parentname2(parentletter(entity_iso[parent])) + '-' + n; } - return n; } + return n; } /// PRIVATE low-level routines for data access -var minx, miny, maxx, maxy; // GLOBAL function dataFirstRecord(territoryNumber) { return data_start[territoryNumber]; } @@ -421,38 +411,17 @@ function dataLastRecord(territoryNumber) { return data_start[++territoryNumber] - 1; } function minmaxSetup(i) { - miny = data_miny[i]; var d = data_maxy[i]; if (d < 10) { var shortmaxy = [0, 122309, 27539, 27449, 149759, 2681190, 60119, 62099, 491040, 86489]; d = shortmaxy[d]; } - maxy = miny + d; - minx = data_minx[i]; - maxx = minx + data_maxx[i]; -} - -/// DEPRECATED return a territoryNumber which could PROBABLY encode coordinate (y,x) in degrees; optional preferredTerritoryNumber is returned if possible; returns "international" if all else fails; -function find_bestiso(y, x, preferredTerritoryNumber) { - var ox = Math.round(x * 1000000); - var oy = Math.round(y * 1000000); - // see if inside preferredTerritoryNumber? - if (preferredTerritoryNumber && preferredTerritoryNumber >= 0 && preferredTerritoryNumber <= ccode_earth) { - minmaxSetup(dataLastRecord(preferredTerritoryNumber)); // get encompassing rectangle - if (fitsInside(oy, ox, minx, maxx, miny, maxy)) { - return preferredTerritoryNumber; - } - } - // find first fit - var i; - for (i = 0; i < ccode_earth; i++) { - minmaxSetup(dataLastRecord(i)); // get encompassing rectangle - if (fitsInside(oy, ox, minx, maxx, miny, maxy)) { - return i; - } - } - // assume earth - return ccode_earth; + return { + minx: data_minx[i], + miny: data_miny[i], + maxx: data_minx[i] + data_maxx[i], + maxy: data_miny[i] + d + }; } /// low-level tables for mapcode encoding and decoding @@ -534,11 +503,10 @@ function decodeBase31(str) { return value; } - -function decodeTriple(result) { +function decodeTriple(input) { var triplex, tripley; - var c1 = decodeChar[result.charCodeAt(0)]; - var x = decodeBase31(result.substr(1)); + var c1 = decodeChar[input.charCodeAt(0)]; + var x = decodeBase31(input.substr(1)); if (c1 < 24) { triplex = (c1 % 6) * 28 + Math.floor(x / 34); tripley = Math.floor(c1 / 6) * 34 + Math.floor(x % 34); @@ -579,6 +547,7 @@ var getDebugInfo; // caller must set this to 1 to get debug info about first var mcInfo; /* type: 1=topdown nameless, 2=sixwide nameless, 3=regulargrid 4=irregular grid 5=rounded groups 6=unrounded groups + record: rectangle record used to encode rectangles: rectEncompassing : encompassing rectangle of country or subdivision rectArea : area of the encoding record @@ -602,19 +571,17 @@ function asDegreeRect(minx, miny, dx, dy) { function maxMapcodePrecision() { return 8; } -var use_high_precision = 0; // nr of letters of high-precision postfix (if any) // GLOBAL -var extrapostfix = ''; // GLOBAL -var fraclat = 0, fraclon = 0; -function encodeExtension(result, extrax4, extray, dividerx4, dividery, extraDigits, ydirection) { + +function encodeExtension(result, enc, extrax4, extray, dividerx4, dividery, extraDigits, ydirection) { if (!extraDigits) { return result; } if (extraDigits > maxMapcodePrecision()) { extraDigits = maxMapcodePrecision(); } - var encx = (extrax4 + 4 * fraclon) / (dividerx4); - var ency = (extray + fraclat * ydirection) / (dividery ); - extrapostfix = ''; + var encx = (extrax4 + 4 * enc.fraclon) / (dividerx4); + var ency = (extray + enc.fraclat * ydirection) / (dividery ); + result += '-'; while (extraDigits-- > 0) { encx *= 30; var gx = Math.floor(encx); @@ -635,40 +602,39 @@ function encodeExtension(result, extrax4, extray, dividerx4, dividery, extraDigi var row1 = Math.floor(gy / 5); var row2 = (gy % 5); // add postfix: - extrapostfix += encodeChar[row1 * 5 + column1]; + result += encodeChar[row1 * 5 + column1]; if (extraDigits-- > 0) { - extrapostfix += encodeChar[row2 * 6 + column2]; + result += encodeChar[row2 * 6 + column2]; } encx -= gx; ency -= gy; - } // while - return result + '-' + extrapostfix; + } + return result; } -function decodeExtension(y, x, dividerx4, dividery, ydirection, orginput) { +function decodeExtension(extensionchars, y, x, dividerx4, dividery, ydirection) { var extrax, extray; var dividerx = dividerx4 / 4; var processor = 1.0; extrax = 0; extray = 0; var idx = 0; - while (idx < extrapostfix.length) { + if (extensionchars.length > 8) { + return false; + } + while (idx < extensionchars.length) { var column1, row1, column2, row2; var halfcolumn = 0; - var c1 = decodeChar[extrapostfix.charCodeAt(idx++)]; - if (c1 < 0) { - c1 = 0; - } else if (c1 > 29) { - c1 = 29; + var c1 = decodeChar[extensionchars.charCodeAt(idx++)]; + if (c1 < 0 || c1 == 30) { + return false; } row1 = Math.floor(c1 / 5); column1 = (c1 % 5); - if (idx < extrapostfix.length) { - var c2 = decodeChar[extrapostfix.charCodeAt(idx++)]; - if (c2 < 0) { - c2 = 0; - } else if (c2 > 29) { - c2 = 29; + if (idx < extensionchars.length) { + var c2 = decodeChar[extensionchars.charCodeAt(idx++)]; + if (c2 < 0 || c2 == 30) { + return false; } row2 = Math.floor(c2 / 6); column2 = (c2 % 6); @@ -690,16 +656,15 @@ function decodeExtension(y, x, dividerx4, dividery, ydirection, orginput) { return {y: extray, x: extrax} } -function decodeGrid(result, minx, miny, maxx, maxy, headerletter, territoryNumber, m) // for a well-formed result, and integer variables // returns millionths +function decodeGrid(input, extensionchars, headerletter, m) // for a well-formed input, and integer variables // returns millionths { var relx, rely; - var orgresult = result; - var prefixlength = result.indexOf('.'); - var postfixlength = result.length - 1 - prefixlength; + var prefixlength = input.indexOf('.'); + var postfixlength = input.length - 1 - prefixlength; if (prefixlength == 1 && postfixlength == 4) { prefixlength++; postfixlength--; - result = result.charAt(0) + result.charAt(2) + '.' + result.substring(3); + input = input.charAt(0) + input.charAt(2) + '.' + input.substring(3); } divy = smartdiv(m); @@ -710,16 +675,15 @@ function decodeGrid(result, minx, miny, maxx, maxy, headerletter, territoryNumbe divx = Math.floor(nc[prefixlength] / divy); } - if (prefixlength == 4 && divx == xside[4] && divy == yside[4]) { - result = result.charAt(0) + result.charAt(2) + result.charAt(1) + result.substr(3); + if (prefixlength == 4 && divx == 961 && divy == 961) { + input = input.charAt(0) + input.charAt(2) + input.charAt(1) + input.substr(3); } - var d; - var v = decodeBase31(result); + var v = decodeBase31(input); if (divx != divy && prefixlength > 2) // D==6 { - d = decodeSixWide(v, divx, divy); + var d = decodeSixWide(v, divx, divy); relx = d.x; rely = d.y; } @@ -729,22 +693,25 @@ function decodeGrid(result, minx, miny, maxx, maxy, headerletter, territoryNumbe rely = divy - 1 - rely; } - var ygridsize = Math.floor((maxy - miny + divy - 1) / divy); - var xgridsize = Math.floor((maxx - minx + divx - 1) / divx); + var mm = minmaxSetup(m); + var ygridsize = Math.floor((mm.maxy - mm.miny + divy - 1) / divy); + var xgridsize = Math.floor((mm.maxx - mm.minx + divx - 1) / divx); - rely = miny + (rely * ygridsize); - relx = minx + (relx * xgridsize); + rely = mm.miny + (rely * ygridsize); + relx = mm.minx + (relx * xgridsize); - var dividery = Math.floor(( (((ygridsize)) + yside[postfixlength] - 1) / yside[postfixlength] )); - var dividerx = Math.floor(( (((xgridsize)) + xside[postfixlength] - 1) / xside[postfixlength] )); + var xp = xside[postfixlength]; + var dividerx = Math.floor((xgridsize + xp - 1) / xp); + var yp = yside[postfixlength]; + var dividery = Math.floor((ygridsize + yp - 1) / yp); - var rest = result.substr(prefixlength + 1); + var rest = input.substr(prefixlength + 1); // decoderelative (postfix vs rely,relx) var difx; var dify; if (postfixlength == 3) { - d = decodeTriple(rest); + var d = decodeTriple(rest); difx = d.x; dify = d.y; } @@ -753,18 +720,17 @@ function decodeGrid(result, minx, miny, maxx, maxy, headerletter, territoryNumbe rest = rest.charAt(0) + rest.charAt(2) + rest.charAt(1) + rest.charAt(3); } v = decodeBase31(rest); - difx = Math.floor(v / yside[postfixlength]); - dify = Math.floor(v % yside[postfixlength]); + difx = Math.floor(v / yp); + dify = Math.floor(v % yp); } - dify = yside[postfixlength] - 1 - dify; + dify = yp - 1 - dify; var cornery = rely + (dify * dividery); var cornerx = relx + (difx * dividerx); - return decodeExtension(cornery, cornerx, dividerx << 2, dividery, 1, headerletter + result) + return decodeExtension(extensionchars, cornery, cornerx, dividerx << 2, dividery, 1) } - function encodeBase31(value, nrchars) { var result = ''; while (nrchars-- > 0) { @@ -795,12 +761,16 @@ function encodeTriple(difx, dify, dividerx, dividery) { } } - -function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territoryNumber) { - var orgcodex = codex; +function encodeGrid(enc, m, mm, headerletter, extraDigits) { + var orgcodex = Codex(m); + var codex = orgcodex; + if (codex == 21) { + codex = 22; + } if (codex == 14) { codex = 23; } + var prefixlength = Math.floor(codex / 10); var postfixlength = (codex % 10); @@ -809,7 +779,7 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ divx = xside[prefixlength]; divy = yside[prefixlength]; if (getDebugInfo) { - mcInfo = {type: 3, regular: true, form: (prefixlength == 2 ? 'rr' : 'rrrr')}; + mcInfo = {type: 3, record: m, regular: true, form: (prefixlength == 2 ? 'rr' : 'rrrr')}; } } else { @@ -817,6 +787,7 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ if (getDebugInfo) { mcInfo = { type: 4, + record: m, regular: false, form: (prefixlength == 2 ? 'ss' : prefixlength == 3 ? 'sss' : 'ssss') }; @@ -834,12 +805,13 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ mcInfo.prefixDivy = divy; } - var ygridsize = Math.floor((maxy - miny + divy - 1) / divy); - var rely = y - miny; + var ygridsize = Math.floor((mm.maxy - mm.miny + divy - 1) / divy); + var rely = enc.coord32.y - mm.miny; rely = Math.floor(rely / ygridsize); - var xgridsize = Math.floor((maxx - minx + divx - 1) / divx); + var xgridsize = Math.floor((mm.maxx - mm.minx + divx - 1) / divx); - var relx = x - minx; + var x = enc.coord32.x; + var relx = x - mm.minx; if (relx < 0) { x += 360000000; relx += 360000000; @@ -856,7 +828,7 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ } var v; - if (divx != divy && codex > 24) // D==6 + if (divx != divy && prefixlength > 2) // D==6 { v = encodeSixWide(relx, rely, divx, divy); } @@ -865,17 +837,16 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ } result = encodeBase31(v, prefixlength); - if (prefixlength == 4 && divx == 961 && divy == 961) { result = result.charAt(0) + result.charAt(2) + result.charAt(1) + result.charAt(3); } if (getDebugInfo && prefixlength == 4 && divx == 961 && divy == 961) { - mcInfo.rectZone = asDegreeRect(minx + 31 * xgridsize * Math.floor(relx / 31), miny + 31 * ygridsize * Math.floor(rely / 31), xgridsize * 31, ygridsize * 31); + mcInfo.rectZone = asDegreeRect(mm.minx + 31 * xgridsize * Math.floor(relx / 31), mm.miny + 31 * ygridsize * Math.floor(rely / 31), xgridsize * 31, ygridsize * 31); } - rely = miny + (rely * ygridsize); - relx = minx + (relx * xgridsize); + rely = mm.miny + (rely * ygridsize); + relx = mm.minx + (relx * xgridsize); var dividery = Math.floor((((ygridsize)) + yside[postfixlength] - 1) / yside[postfixlength]); var dividerx = Math.floor((((xgridsize)) + xside[postfixlength] - 1) / xside[postfixlength]); @@ -885,7 +856,7 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ // encoderelative var difx = x - relx; - var dify = y - rely; + var dify = enc.coord32.y - rely; var extrax = difx % dividerx; var extray = dify % dividery; difx = Math.floor(difx / dividerx); @@ -921,10 +892,9 @@ function encodeGrid(m, y, x, codex, minx, miny, maxx, maxy, headerletter, territ } } - return encodeExtension(headerletter + result, extrax << 2, extray, dividerx << 2, dividery, use_high_precision, 1); // grid + return encodeExtension(headerletter + result, enc, extrax << 2, extray, dividerx << 2, dividery, extraDigits, 1); // grid } - /// alphabet support var MAXLANS = 14; @@ -933,16 +903,16 @@ var asc2lan = [ [913, 914, 926, 916, 63, 917, 915, 919, 921, 928, 922, 923, 924, 925, 927, 929, 920, 936, 931, 932, 63, 934, 937, 935, 933, 918, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Greek [1040, 1042, 1057, 1044, 1045, 1046, 1043, 1053, 1048, 1055, 1050, 1051, 1052, 1047, 1054, 1056, 1060, 1071, 1062, 1058, 1069, 1063, 1064, 1061, 1059, 1041, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Cyrillic [1488, 1489, 1490, 1491, 1507, 1492, 1494, 1495, 1493, 1496, 1497, 1498, 1499, 1500, 1505, 1501, 1502, 1504, 1506, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Hebrew - [2309, 2325, 2327, 2328, 2319, 2330, 2332, 2335, 63, 2336, 2339, 2340, 2342, 2343, 63, 2344, 2346, 2349, 2350, 2352, 2347, 2354, 2357, 2360, 2361, 2337, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415], // Hindi + [2309, 2325, 2327, 2328, 2319, 2330, 2332, 2335, 73, 2336, 2339, 2340, 2342, 2343, 79, 2344, 2346, 2349, 2350, 2352, 2347, 2354, 2357, 2360, 2361, 2337, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415], // Hindi [3346, 3349, 3350, 3351, 3339, 3354, 3356, 3359, 3335, 3361, 3364, 3365, 3366, 3367, 3360, 3368, 3374, 3376, 3377, 3378, 3337, 3380, 3381, 3382, 3384, 3385, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439], // Malay [4256, 4257, 4259, 4262, 4260, 4265, 4267, 4268, 4275, 4270, 4272, 4273, 4274, 4276, 4269, 4277, 4278, 4279, 4280, 4281, 4264, 4282, 4283, 4285, 4286, 4287, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Georgian [12450, 12459, 12461, 12463, 12458, 12465, 12467, 12469, 12452, 12473, 12481, 12488, 12490, 12492, 12454, 12498, 12501, 12504, 12507, 12513, 12456, 12514, 12520, 12521, 12525, 12530, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Katakana [3632, 3585, 3586, 3588, 3634, 3591, 3592, 3593, 3633, 3594, 3601, 3604, 3606, 3607, 3597, 3608, 3610, 3612, 3617, 3619, 3628, 3621, 3623, 3629, 3630, 3631, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673], // Thai [3760, 3713, 3714, 3716, 3779, 3719, 3720, 3722, 3780, 3725, 3732, 3735, 3737, 3738, 3782, 3740, 3742, 3745, 3746, 3747, 3773, 3751, 3754, 3755, 3757, 3759, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Lao [1366, 1330, 1331, 1332, 1333, 1336, 1337, 1338, 1339, 1341, 1343, 1344, 1345, 1347, 1365, 1351, 1352, 1354, 1357, 1358, 1349, 1359, 1360, 1361, 1362, 1363, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], // Armenian - [2437, 2444, 2453, 2454, 2447, 2455, 2457, 2458, 63, 2461, 2464, 2465, 2466, 2467, 63, 2468, 2469, 2470, 2472, 2474, 2451, 2476, 2477, 2479, 2482, 2489, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543], // Bengali - [2565, 2581, 2583, 2584, 2575, 2586, 2588, 2591, 63, 2592, 2595, 2596, 2598, 2599, 63, 2600, 2602, 2605, 2606, 2608, 2603, 2610, 2613, 2616, 2617, 2593, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671], // Gurmukhi - [3928, 3904, 3905, 3906, 3940, 3908, 3909, 3910, 63, 3911, 3914, 3916, 3918, 3919, 63, 3921, 3923, 3924, 3926, 3934, 3941, 3935, 3937, 3938, 3939, 3942, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881] // Tibetan + [2437, 2444, 2453, 2454, 2447, 2455, 2457, 2458, 73, 2461, 2464, 2465, 2466, 2467, 79, 2468, 2469, 2470, 2472, 2474, 2451, 2476, 2477, 2479, 2482, 2489, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543], // Bengali + [2565, 2581, 2583, 2584, 2575, 2586, 2588, 2591, 73, 2592, 2595, 2596, 2598, 2599, 79, 2600, 2602, 2605, 2606, 2608, 2603, 2610, 2613, 2616, 2617, 2593, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671], // Gurmukhi + [3928, 3904, 3905, 3906, 3940, 3908, 3909, 3910, 73, 3911, 3914, 3916, 3918, 3919, 79, 3921, 3923, 3924, 3926, 3934, 3941, 3935, 3937, 3938, 3939, 3942, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881] // Tibetan ]; // *UI* @@ -981,20 +951,26 @@ var lanlannam = [ ["དབུ་ཅན་"] ]; - /// PRIVATE substitute characters in str with characters form the specified language (pass asHTML=1 to explicitly HTML-encode characters) function showinlan(str, lan, asHTML) { + str = to_ascii(str); if (!lan) { return str; } var result = ''; + // skip leading territory + var i = str.indexOf(' '); + if (i > 0) { + result = str.substr(0, ++i); + str = str.substr(i); + } + // unpack for languages that do not support E and U - if (asc2lan[lan][4] == 63) { // is there no equivalent for the letter E in this language? + if (asc2lan[lan][4] == 63) { if (str.indexOf('E') >= 0 || str.indexOf('U') >= 0) { str = aeu_pack(aeu_unpack(str), true); - /* v1.50 repack! */ } } @@ -1024,24 +1000,22 @@ function to_ascii(str) { var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; var result = ''; str = trim(str).toUpperCase(); + var len = str.length; - var i; - var trans = 0; for (i = 0; i < len; i++) { var c = str.charCodeAt(i); if (c > 0 && c < 127) { result += str.charAt(i); } else { + var found = 0; var lan; for (lan = 0; lan < MAXLANS; lan++) { var nrc = asc2lan[lan].length; - var found = 0; var j; for (j = 0; j < nrc; j++) { if (c == asc2lan[lan][j]) { result += letters.charAt(j); found = 1; - trans = 1; break; } } @@ -1061,31 +1035,7 @@ function to_ascii(str) { return result; } - /// PRIVATE lowest-level data access - -var flags, codex, codexlo, codexhi, codexlen; // GLOBAL -var isnameless, isrestricted, recType, isSpecialShape22; // GLOBAL - -function dataSetup(i) { - flags = data_flags[i]; - codexhi = Math.floor((flags & 31) / 5); - codexlo = ((flags & 31) % 5) + 1; - codexlen = codexlo + codexhi; - codex = 10 * codexhi + codexlo; - // iscountry = (flags & 32); - isnameless = (flags & 64); - isrestricted = (flags & 512); - isSpecialShape22 = (flags & 1024); - recType = ((flags >> 7) & 3); // 1=pipe 2=plus 3=star - if (codex == 21 && isnameless == 0) { - codex++; - codexlo++; - codexlen++; - } - minmaxSetup(i); -} - function headerLetter(i) { var flags = data_flags[i]; if (((flags >> 7) & 3) == 1) { @@ -1106,164 +1056,165 @@ function isAutoHeader(i) { return data_flags[i] & (8 << 5); } function CodexLen(i) { - flags = data_flags[i]; - codexhi = Math.floor((flags & 31) / 5); - return codexhi + ((flags & 31) % 5) + 1; + var flags = data_flags[i] & 31; + return Math.floor(flags / 5) + (flags % 5) + 1; } function Codex(i) { - flags = data_flags[i]; - codexhi = Math.floor((flags & 31) / 5); - return 10 * codexhi + ((flags & 31) % 5) + 1; + var flags = data_flags[i] & 31; + return 10 * Math.floor(flags / 5) + (flags % 5) + 1; } function isSpecialShape(i) { return data_flags[i] & 1024; } +function recType(i) { + return ((data_flags[i] >> 7) & 3); // 1=pipe 2=plus 3=star +} -function firstNamelessRecord(samecodex, index, firstcode) { +function firstNamelessRecord(index, firstcode) { var i = index; - while (i >= firstcode && Codex(i) == samecodex && isNameless(i)) { + var codex = Codex(i); + while (i >= firstcode && Codex(i) == codex && isNameless(i)) { i--; } i++; return i; } -function countNamelessRecords(samecodex, index, firstcode) { - var i = firstNamelessRecord(samecodex, index, firstcode); +function countNamelessRecords(index, firstcode) { + var i = firstNamelessRecord(index, firstcode); var e = index; - while (Codex(e) == samecodex) { + var codex = Codex(e); + while (Codex(e) == codex) { e++; } return (e - i); } - // mid-level encode/decode -function encodeNameless(x, y, index, firstcode) { - var A = countNamelessRecords(codex, index, firstcode); +function encodeNameless(enc, m, firstcode, extraDigits) { + var A = countNamelessRecords(m, firstcode); + if (A < 1) { + return ''; + } var p = Math.floor(31 / A); var r = (31 % A); - var X = index - firstNamelessRecord(codex, index, firstcode); + var codex = Codex(m); + var codexlen = CodexLen(m); + var X = m - firstNamelessRecord(m, firstcode); - if (A > 1) { - var storage_offset = 0; + var storage_offset; - if (codex != 21 && A <= 31) { - storage_offset = (X * p + (X < r ? X : r)) * (961 * 961); - } - else if (codex != 21 && A < 62) { - if (X < (62 - A)) { - storage_offset = X * (961 * 961); - } - else { - storage_offset = (62 - A + Math.floor((X - 62 + A) / 2) ) * (961 * 961); - if ((X + A) & 1) { - storage_offset += (16 * 961 * 31); - } - } + if (codex != 21 && A <= 31) { + storage_offset = (X * p + (X < r ? X : r)) * (961 * 961); + } + else if (codex != 21 && A < 62) { + if (X < (62 - A)) { + storage_offset = X * (961 * 961); } else { - var BASEPOWER = (codex == 21) ? 961 * 961 : 961 * 961 * 31; - var BASEPOWERA = Math.floor(BASEPOWER / A); - if (A == 62) { - BASEPOWERA++; - } else { - BASEPOWERA = (961) * Math.floor(BASEPOWERA / 961); + storage_offset = (62 - A + Math.floor((X - 62 + A) / 2) ) * (961 * 961); + if ((X + A) & 1) { + storage_offset += (16 * 961 * 31); } - - storage_offset = X * BASEPOWERA; } - - var SIDE = smartdiv(index); - var orgSIDE = SIDE; - var xSIDE = SIDE; - if (isSpecialShape22) { - xSIDE *= SIDE; - SIDE = 1 + Math.floor((maxy - miny) / 90); - xSIDE = Math.floor(xSIDE / SIDE); + } + else { + var BASEPOWER = (codex == 21) ? 961 * 961 : 961 * 961 * 31; + var BASEPOWERA = Math.floor(BASEPOWER / A); + if (A == 62) { + BASEPOWERA++; + } else { + BASEPOWERA = (961) * Math.floor(BASEPOWERA / 961); } - var dividerx4 = xDivider4(miny, maxy); // note that xDivider4 is 4 times too large - var xFracture = Math.floor(4 * fraclon); - var dx = Math.floor((4 * (x - minx) + xFracture) / dividerx4); // dx is in millionths - var extrax4 = (x - minx) * 4 - dx * dividerx4; // extrax4 is in quarter-millionths + storage_offset = X * BASEPOWERA; + } - var dividery = 90; - var dy = Math.floor((maxy - y) / dividery); - var extray = (maxy - y) % dividery; + var mm = minmaxSetup(m); + var SIDE = smartdiv(m); + var orgSIDE = SIDE; + var xSIDE = SIDE; + if (isSpecialShape(m)) { + xSIDE *= SIDE; + SIDE = 1 + Math.floor((mm.maxy - mm.miny) / 90); + xSIDE = Math.floor(xSIDE / SIDE); + } - if (extray == 0 && fraclat > 0) { - dy--; - extray += dividery; - } + var dividerx4 = xDivider4(mm.miny, mm.maxy); // note that xDivider4 is 4 times too large + var xFracture = Math.floor(4 * enc.fraclon); + var dx = Math.floor((4 * (enc.coord32.x - mm.minx) + xFracture) / dividerx4); // dx is in millionths + var extrax4 = (enc.coord32.x - mm.minx) * 4 - dx * dividerx4; // extrax4 is in quarter-millionths - var v = storage_offset; - if (isSpecialShape22) { - v += encodeSixWide(dx, SIDE - 1 - dy, xSIDE, SIDE); - } - else { - v += (dx * SIDE + dy); - } + var dividery = 90; + var dy = Math.floor((mm.maxy - enc.coord32.y) / dividery); + var extray = (mm.maxy - enc.coord32.y) % dividery; - if (getDebugInfo) { - mcInfo = {type: (isSpecialShape22 ? 2 : 1), regular: false}; - mcInfo.rectCell = asDegreeRect(minx + dx * (dividerx4 / 4), maxy - (dy + 1) * dividery, dividerx4 / 4, dividery); - mcInfo.prefixDivx = xSIDE; - mcInfo.prefixDivy = SIDE; - mcInfo.dotPosition = (codex == 22 ? 3 : 2); - mcInfo.form = (codexlen == 3 ? 'nnnn' : 'nnnnn'); - mcInfo.postfixType = 0; - } + if (extray == 0 && enc.fraclat > 0) { + dy--; + extray += dividery; + } - var result = encodeBase31(v, codexlen + 1); + var v = storage_offset; + if (isSpecialShape(m)) { + v += encodeSixWide(dx, SIDE - 1 - dy, xSIDE, SIDE); + } + else { + v += (dx * SIDE + dy); + } - if (codexlen == 3) { - result = result.substr(0, 2) + '.' + result.substr(2); - } - else if (codexlen == 4) { - if (codex == 22 && orgSIDE == 961 && !isSpecialShape22) { - if (getDebugInfo) { - mcInfo.form = 'hrrpp'; - mcInfo.headerletter = encodeChar[storage_offset / (961 * 961)]; - mcInfo.postfixType = 2; - mcInfo.regular = true; - mcInfo.rectRegion = asDegreeRect((minx + (31 * Math.floor(dx / 31) * dividerx4 / 4)), maxy - (31 * dividery) * (1 + Math.floor(dy / 31)), 31 * dividerx4 / 4, 31 * dividery); - } - result = result.charAt(0) + result.charAt(1) + result.charAt(3) + result.charAt(2) + result.charAt(4); - } - if (codex == 13) { - result = result.substr(0, 2) + '.' + result.substr(2); - } else { - result = result.substr(0, 3) + '.' + result.substr(3); + if (getDebugInfo) { + mcInfo = {type: (isSpecialShape(m) ? 2 : 1), regular: false, record: m}; + mcInfo.rectCell = asDegreeRect(mm.minx + dx * (dividerx4 / 4), mm.maxy - (dy + 1) * dividery, dividerx4 / 4, dividery); + mcInfo.prefixDivx = xSIDE; + mcInfo.prefixDivy = SIDE; + mcInfo.dotPosition = (codex == 22 ? 3 : 2); + mcInfo.form = (codexlen == 3 ? 'nnnn' : 'nnnnn'); + mcInfo.postfixType = 0; + } + + var result = encodeBase31(v, codexlen + 1); + + if (codexlen == 3) { + result = result.substr(0, 2) + '.' + result.substr(2); + } + else if (codexlen == 4) { + if (codex == 22 && orgSIDE == 961 && !isSpecialShape(m)) { + if (getDebugInfo) { + mcInfo.form = 'hrrpp'; + mcInfo.headerletter = encodeChar[storage_offset / (961 * 961)]; + mcInfo.postfixType = 2; + mcInfo.regular = true; + mcInfo.rectRegion = asDegreeRect((mm.minx + (31 * Math.floor(dx / 31) * dividerx4 / 4)), mm.maxy - (31 * dividery) * (1 + Math.floor(dy / 31)), 31 * dividerx4 / 4, 31 * dividery); } + result = result.charAt(0) + result.charAt(1) + result.charAt(3) + '.' + result.charAt(2) + result.charAt(4); + } else if (codex == 13) { + result = result.substr(0, 2) + '.' + result.substr(2); + } else { + result = result.substr(0, 3) + '.' + result.substr(3); } - - return encodeExtension(result, extrax4, extray, dividerx4, dividery, use_high_precision, -1); // nameless } -} + return encodeExtension(result, enc, extrax4, extray, dividerx4, dividery, extraDigits, -1); // nameless +} -function decodeNameless(result, firstrec) // returns millionths -{ +function decodeNameless(input, extensionchars, m, firstindex) { + var codex = Codex(m); if (codex == 22) { - result = result.substr(0, 3) + result.substr(4); + input = input.substr(0, 3) + input.substr(4); } else { - result = result.substr(0, 2) + result.substr(3); + input = input.substr(0, 2) + input.substr(3); } - var A = countNamelessRecords(codex, firstrec, firstrec); - if (A < 2) { - A = 1; - } // paranoia - + var A = countNamelessRecords(m, firstindex); + var F = firstNamelessRecord(m, firstindex); var p = Math.floor(31 / A); var r = (31 % A); - var v; - var X = -1; + var v = 0; + var X; var swapletters = 0; if (codex != 21 && A <= 31) { - var offset = decodeChar[result.charCodeAt(0)]; + var offset = decodeChar[input.charCodeAt(0)]; if (offset < r * (p + 1)) { X = Math.floor(offset / (p + 1)); @@ -1274,12 +1225,11 @@ function decodeNameless(result, firstrec) // returns millionths } } else if (codex != 21 && A < 62) { - X = decodeChar[result.charCodeAt(0)]; + X = decodeChar[input.charCodeAt(0)]; if (X < (62 - A)) { swapletters = (codex == 22); - } - else { - X = X + (X - (62 - A)); + } else { + X += (X - (62 - A)); } } else // codex==21 || A>=62 @@ -1292,26 +1242,29 @@ function decodeNameless(result, firstrec) // returns millionths BASEPOWERA = 961 * Math.floor(BASEPOWERA / 961); } - // decode and determine x - v = decodeBase31(result); + // decode + v = decodeBase31(input); + X = Math.floor(v / BASEPOWERA); v %= BASEPOWERA; } if (swapletters) { - if (!isSpecialShape(firstrec + X)) { - result = result.charAt(0) + result.charAt(1) + result.charAt(3) + result.charAt(2) + result.charAt(4); + if (!isSpecialShape(m + X)) { + input = input.charAt(0) + input.charAt(1) + input.charAt(3) + input.charAt(2) + input.charAt(4); } } if (codex != 21 && A <= 31) { - v = decodeBase31(result); + v = decodeBase31(input); + if (X > 0) { v -= ( (X * p + (X < r ? X : r)) * (961 * 961) ); } } else if (codex != 21 && A < 62) { - v = decodeBase31(result.substr(1)); + v = decodeBase31(input.substr(1)); + if (X >= (62 - A)) { if (v >= (16 * 961 * 31)) { v -= (16 * 961 * 31); @@ -1323,19 +1276,20 @@ function decodeNameless(result, firstrec) // returns millionths if (X > A) { return false; } // past end! - dataSetup(firstrec + X); + m = F + X; + var mm = minmaxSetup(m); - SIDE = smartdiv(firstrec + X); + SIDE = smartdiv(m); var xSIDE = SIDE; - if (isSpecialShape22) { + if (isSpecialShape(m)) { xSIDE *= SIDE; - SIDE = 1 + Math.floor((maxy - miny) / 90); + SIDE = 1 + Math.floor((mm.maxy - mm.miny) / 90); xSIDE = Math.floor(xSIDE / SIDE); } var dx, dy; - if (isSpecialShape22) { + if (isSpecialShape(m)) { var d = decodeSixWide(v, xSIDE, SIDE); dx = d.x; dy = SIDE - 1 - d.y; @@ -1345,154 +1299,146 @@ function decodeNameless(result, firstrec) // returns millionths dx = Math.floor(v / SIDE); } - if (dx >= xSIDE) // else out-of-range! - { + if (dx >= xSIDE) { // else out-of-range! return false; } - var dividerx4 = xDivider4(miny, maxy); // 4 times too large! + var dividerx4 = xDivider4(mm.miny, mm.maxy); // 4 times too large! var dividery = 90; - var cornerx = minx + Math.floor((dx * dividerx4) / 4); // FIRST multiply, THEN divide! - var cornery = maxy - (dy * dividery); - var ret = decodeExtension(cornery, cornerx, dividerx4, dividery, -1, result); - ret.x += ((dx * dividerx4) % 4) / 4.0; + var cornerx = mm.minx + Math.floor((dx * dividerx4) / 4); // FIRST multiply, THEN divide! + var cornery = mm.maxy - (dy * dividery); + var ret = decodeExtension(extensionchars, cornery, cornerx, dividerx4, dividery, -1); + if (ret) { + ret.x += ((dx * dividerx4) % 4) / 4.0; + } return ret; } - -function encodeAutoHeader(y, x, thiscodexlen, thisindex, territoryNumber) { +function encodeAutoHeader(enc, m, extraDigits) { var STORAGE_START = 0; // search back to first of the group - var firstindex = thisindex; - while (isAutoHeader(firstindex - 1) && CodexLen(firstindex - 1) == thiscodexlen) { + var codex = Codex(m); + var codexlen = CodexLen(m); + var firstindex = m; + while (isAutoHeader(firstindex - 1) && Codex(firstindex - 1) == codex) { firstindex--; } var i; - for (i = firstindex; CodexLen(i) == thiscodexlen; i++) { - dataSetup(i); - var H = Math.floor((maxy - miny + 89) / 90); - var xdiv = xDivider4(miny, maxy); - var W = Math.floor(( (maxx - minx) * 4 + (xdiv - 1) ) / xdiv); + for (i = firstindex; Codex(i) == codex; i++) { + var mm = minmaxSetup(i); + var H = Math.floor((mm.maxy - mm.miny + 89) / 90); + var xdiv = xDivider4(mm.miny, mm.maxy); + var W = Math.floor(( (mm.maxx - mm.minx) * 4 + (xdiv - 1) ) / xdiv); H = 176 * Math.floor((H + 176 - 1) / 176); W = 168 * Math.floor((W + 168 - 1) / 168); var product = Math.floor(W / 168) * Math.floor(H / 176) * 961 * 31; - if (recType == 2) { // *+ + if (recType(i) == 2) { // *+ var GOODROUNDER = codex >= 23 ? (961 * 961 * 31) : (961 * 961); product = Math.floor((STORAGE_START + product + GOODROUNDER - 1) / GOODROUNDER) * GOODROUNDER - STORAGE_START; } - if (i == thisindex) { - if (fitsInside(y, x, minx, maxx, miny, maxy)) { - var dividerx = Math.floor((maxx - minx + W - 1) / W); - var vx = Math.floor((x - minx) / dividerx); - var extrax = ((x - minx) % dividerx); + if (i == m && fitsInside(enc.coord32, mm)) { + var dividerx = Math.floor((mm.maxx - mm.minx + W - 1) / W); + var vx = Math.floor((enc.coord32.x - mm.minx) / dividerx); + var extrax = ((enc.coord32.x - mm.minx) % dividerx); - var dividery = Math.floor((maxy - miny + H - 1) / H); - var vy = Math.floor((maxy - y) / dividery); - var extray = ((maxy - y) % dividery); + var dividery = Math.floor((mm.maxy - mm.miny + H - 1) / H); + var vy = Math.floor((mm.maxy - enc.coord32.y) / dividery); + var extray = ((mm.maxy - enc.coord32.y) % dividery); - var spx = vx % 168; - var spy = vy % 176; + var spx = vx % 168; + var spy = vy % 176; - vx = Math.floor(vx / 168); - var value = vx * Math.floor(H / 176); + vx = Math.floor(vx / 168); + var value = vx * Math.floor(H / 176); - if (extray == 0 && fraclat > 0) { - if (vy == 0) { - STORAGE_START += product; - continue; - } - vy--; - extray += dividery; + if (extray == 0 && enc.fraclat > 0) { + if (vy == 0) { + STORAGE_START += product; + continue; } + vy--; + extray += dividery; + } - vy = Math.floor(vy / 176); - value += vy; - + vy = Math.floor(vy / 176); + value += vy; - if (getDebugInfo) { - mcInfo = {type: (recType == 2 ? 6 : 5), regular: false}; // 5=unrounded groups / 6=rounded groups - mcInfo.form = (codexlen == 4 ? 'ggppp' : 'gggppp'); - mcInfo.postfixType = 3; - mcInfo.dotPosition = codexlen - 2; - mcInfo.prefixDivx = Math.floor(W / 168); - mcInfo.prefixDivy = Math.floor(H / 176); - mcInfo.rectSubarea = asDegreeRect(minx + (vx * 168 ) * dividerx, maxy - ((vy + 1) * 176 ) * dividery, 168 * dividerx, 176 * dividery); - mcInfo.rectCell = asDegreeRect(minx + (vx * 168 + spx) * dividerx, maxy - ((vy ) * 176 + spy + 1) * dividery, dividerx, dividery); - } + if (getDebugInfo) { + mcInfo = {type: (recType(i) == 2 ? 6 : 5), regular: false, record: i}; // 5=unrounded groups / 6=rounded groups + mcInfo.form = (codexlen == 4 ? 'ggppp' : 'gggppp'); + mcInfo.postfixType = 3; + mcInfo.dotPosition = codexlen - 2; + mcInfo.prefixDivx = Math.floor(W / 168); + mcInfo.prefixDivy = Math.floor(H / 176); + mcInfo.rectSubarea = asDegreeRect(mm.minx + (vx * 168 ) * dividerx, mm.maxy - ((vy + 1) * 176 ) * dividery, 168 * dividerx, 176 * dividery); + mcInfo.rectCell = asDegreeRect(mm.minx + (vx * 168 + spx) * dividerx, mm.maxy - ((vy ) * 176 + spy + 1) * dividery, dividerx, dividery); + } - var mapc = encodeBase31(Math.floor(STORAGE_START / (961 * 31)) + value, codexlen - 2) + '.' + encodeTriple(spx, spy, dividerx, dividery); + var mapc = encodeBase31(Math.floor(STORAGE_START / (961 * 31)) + value, codexlen - 2) + '.' + encodeTriple(spx, spy, dividerx, dividery); - return encodeExtension(mapc, extrax << 2, extray, dividerx << 2, dividery, use_high_precision, -1); // autoheader - } + return encodeExtension(mapc, enc, extrax << 2, extray, dividerx << 2, dividery, extraDigits, -1); // autoheader } STORAGE_START += product; } return ''; // fail } -function decodeAutoHeader(input, firstindex, territoryNumber) { +function decodeAutoHeader(input, extensionchars, m) { var STORAGE_START = 0; - var thiscodexlen = codexlen; + var codex = Codex(m); + + var value = decodeBase31(input); // decode (before dot) - var value = decodeBase31(input); // decode top (before dot) value *= (961 * 31); var triple = decodeTriple(input.substr(input.length - 3)); // decode bottom 3 chars - var i; - for (i = firstindex; ; i++) { - if (CodexLen(i) != thiscodexlen) { - return false; - } - if (i > firstindex) { - dataSetup(i); - } + for (; Codex(m) == codex && recType(m) > 1; m++) { + var mm = minmaxSetup(m); - var H = Math.floor((maxy - miny + 89) / 90); - var xdiv = xDivider4(miny, maxy); - var W = Math.floor(( (maxx - minx) * 4 + (xdiv - 1) ) / xdiv); + var H = Math.floor((mm.maxy - mm.miny + 89) / 90); + var xdiv = xDivider4(mm.miny, mm.maxy); + var W = Math.floor(( (mm.maxx - mm.minx) * 4 + (xdiv - 1) ) / xdiv); H = 176 * Math.floor((H + 176 - 1) / 176); W = 168 * Math.floor((W + 168 - 1) / 168); var product = Math.floor(W / 168) * Math.floor(H / 176) * 961 * 31; - if (recType == 2) { // *+ + if (recType(m) == 2) { var GOODROUNDER = codex >= 23 ? (961 * 961 * 31) : (961 * 961); product = Math.floor((STORAGE_START + product + GOODROUNDER - 1) / GOODROUNDER) * GOODROUNDER - STORAGE_START; } if (value >= STORAGE_START && value < STORAGE_START + product) // code belongs here? { - var dividerx = Math.floor((maxx - minx + W - 1) / W); - var dividery = Math.floor((maxy - miny + H - 1) / H); + var dividerx = Math.floor((mm.maxx - mm.minx + W - 1) / W); + var dividery = Math.floor((mm.maxy - mm.miny + H - 1) / H); value -= STORAGE_START; value = Math.floor(value / (961 * 31)); - var vx = Math.floor(value / Math.floor(H / 176)) * 168 + triple.x; - var vy = (value % Math.floor(H / 176)) * 176 + triple.y; - - var cornery = maxy - vy * dividery; - var cornerx = minx + vx * dividerx; + var vx = triple.x + 168 * Math.floor(value / Math.floor(H / 176)); + var vy = triple.y + 176 * (value % Math.floor(H / 176)); - var retval = decodeExtension(cornery, cornerx, dividerx << 2, dividery, -1, input); - if (retval.x < minx || retval.x >= maxx || retval.y < miny || retval.y > maxy) { + var cornery = mm.maxy - vy * dividery; + var cornerx = mm.minx + vx * dividerx; + if (cornerx < mm.minx || cornerx >= mm.maxx || cornery < mm.miny || cornery > mm.maxy) { return false; } - return retval; + return decodeExtension(extensionchars, cornery, cornerx, dividerx << 2, dividery, -1); } STORAGE_START += product; } + return false; } - /// PRIVATE add vowels to prevent a mapcode r from being all-digit function aeu_pack(r, short) /* v1.50 */ { var dotpos = -9; @@ -1502,9 +1448,8 @@ function aeu_pack(r, short) /* v1.50 */ { for (d = 0; d < rlen; d++) { if (r.charAt(d) < '0' || r.charAt(d) > '9') // not digit? { - if (r.charAt(d) == '.' && dotpos < 0) // first dot? - { - dotpos = d; + if (r.charAt(d) == '.' && dotpos < 0) { + dotpos = d; // first dot? } else if (r.charAt(d) == '-') { rest = r.substring(d); r = r.substring(0, d); @@ -1514,7 +1459,7 @@ function aeu_pack(r, short) /* v1.50 */ { return r; } } - } // not alldigit (or multiple dots) + } var v; if (rlen - 2 > dotpos) { // does r have a dot, AND at least 2 chars after the dot? @@ -1533,72 +1478,66 @@ function aeu_pack(r, short) /* v1.50 */ { // PRIVATE (defaults for last 4 are false,false,false,-1) var debugStopRecord = -1; // GLOBAL /// returns result, or empty if error -var results; // GLOBAL -function mapcoderEngine(orgy, orgx, tn, getshortest, isrecursive, state_override) { - // round to millionths and normalise - if (isNaN(orgx)) { - orgx = 0; - } - if (isNaN(orgy)) { - orgy = 0; - } - orgy = Number(orgy); - orgx = Number(orgx); - if (orgy > 90) { - orgy = 90; - } else if (orgy < -90) { - orgy = -90; - } // cut within [-90..+90] - if (orgx >= 180) { - orgx -= 360; - } else if (orgx < -180) { - orgx += 360; - } // move within [-180..+180> - - { // seperate out the fraction - var y = orgy + 90; - var x = orgx + 180; - y *= 1000000; - x *= 1000000; - var lat32 = Math.floor(y); - var lon32 = Math.floor(x); - fraclat = y - lat32; // get fraction - fraclon = x - lon32; // get fraction - - // for 8-digit precision, cells are divided into 810,000 by 810,000 minicells. So take care of math errors - fraclat *= 810000; - if (fraclat < 1) { - fraclat = 0; - } else { - if (fraclat > 809999) { - fraclat = 0; - lat32++; - } else { - fraclat /= 810000; - } - } - fraclon *= 810000; - if (fraclon < 1) { - fraclon = 0; - } else { - if (fraclon > 809999) { - fraclon = 0; - lon32++; - } else { - fraclon /= 810000; - } - } +function getEncodeRec(lat, lon) { + + if (isNaN(lat)) { + lat = 0; + } + lat = Number(lat); + if (lat > 90) { + lat = 90; + } else if (lat < -90) { + lat = -90; + } + // seperate out the fraction + var y = lat + 90; + y *= 1000000; + var lat32 = Math.floor(y); + fraclat = y - lat32; // get fraction + // solve math errors for 810,000 minicells (30^4) + fraclat *= 810000; + if (fraclat < 1) { + fraclat = 0; + } else if (fraclat > 809999) { + fraclat = 0; + lat32++; + } else { + fraclat /= 810000; + } + + if (isNaN(lon)) { + lon = 0; + } + lon = Number(lon); + if (lon >= 180) { + lon -= 360; + } else if (lon < -180) { + lon += 360; + } + // seperate out the fraction + var x = lon + 180; + x *= 1000000; + var lon32 = Math.floor(x); + fraclon = x - lon32; // get fraction + // solve math errors for 810,000 minicells (30^4) + fraclon *= 810000; + if (fraclon < 1) { + fraclon = 0; + } else if (fraclon > 809999) { + fraclon = 0; + lon32++; + } else { + fraclon /= 810000; + } - y = lat32 - 90000000; - x = lon32 - 180000000; - } // + return {coord32: {y: lat32 - 90000000, x: lon32 - 180000000}, fraclat: fraclat, fraclon: fraclon}; +} - mcInfo = {type: 0}; +function mapcoderEngine(enc, tn, getshortest, isrecursive, state_override, extraDigits) { + var results = []; - if (!isrecursive) { - results = []; - } + mcInfo = {type: 0}; var fromTerritory = 0; var uptoTerritory = ccode_earth; @@ -1622,37 +1561,40 @@ function mapcoderEngine(orgy, orgx, tn, getshortest, isrecursive, state_override // make sure it fits the country if (territoryNumber != ccode_earth) { - minmaxSetup(upto); // find encompassing rect - if (!(fitsInside(y, x, minx, maxx, miny, maxy))) { // does not fit? + if (!(fitsInside(enc.coord32, minmaxSetup(upto)))) { // does not fit encompassing rect? if (isrecursive) { return; } - from = upto + 1; // empty the range + continue; } } for (var i = from; i <= upto; i++) { - dataSetup(i); - if (codex < 54) // exlude 54 and 55 + + if (Codex(i) < 54) // exlude 54 and 55 { - if (fitsInside(y, x, minx, maxx, miny, maxy)) { + var mm = minmaxSetup(i); + if (fitsInside(enc.coord32, mm)) { var r; - if (isnameless) { - r = encodeNameless(x, y, i, from); + if (isNameless(i)) { + r = encodeNameless(enc, i, from, extraDigits); } - else if (recType > 1) { - r = encodeAutoHeader(y, x, codexlen, i, territoryNumber); + else if (recType(i) > 1) { + r = encodeAutoHeader(enc, i, extraDigits); } - else if (isrestricted && i == upto && getParentOf(territoryNumber) >= 0) { - mapcoderEngine(orgy, orgx, getParentOf(territoryNumber), getshortest, true/*recursive*/, territoryNumber); + else if (isRestricted(i) && i == upto && getParentOf(territoryNumber) >= 0) { + moreresults = mapcoderEngine(enc, getParentOf(territoryNumber), getshortest, true/*recursive*/, territoryNumber, extraDigits); + if (moreresults && moreresults.length > 0) { + results = results.concat(moreresults); + } continue; } else { - if (isrestricted && results.length == original_length) { + if (isRestricted(i) && results.length == original_length) { r = ''; // restricted, and no shorter mapcodes exist: do not generate mapcodes } else { - r = encodeGrid(i, y, x, codex, minx, miny, maxx, maxy, headerLetter(i), territoryNumber); + r = encodeGrid(enc, i, mm, headerLetter(i), extraDigits); } } @@ -1669,14 +1611,13 @@ function mapcoderEngine(orgy, orgx, tn, getshortest, isrecursive, state_override results.length = 0; // clear all other results } - if (getDebugInfo) { mcInfo.mapcode = r; mcInfo.record = i; - mcInfo.rectArea = asDegreeRect(minx, miny, maxx - minx, maxy - miny); + mcInfo.rectArea = asDegreeRect(mm.minx, mm.miny, mm.maxx - mm.minx, mm.maxy - mm.miny); mcInfo.form = mcInfo.form.substr(0, mcInfo.dotPosition) + '.' + mcInfo.form.substr(mcInfo.dotPosition); - dataSetup(upto); - mcInfo.rectEncompassing = asDegreeRect(minx, miny, maxx - minx, maxy - miny); + var mm = minmaxSetup(upto); + mcInfo.rectEncompassing = asDegreeRect(mm.minx, mm.miny, mm.maxx - mm.minx, mm.maxy - mm.miny); } else { mcInfo = {mapcode: r}; @@ -1702,7 +1643,6 @@ function mapcoderEngine(orgy, orgx, tn, getshortest, isrecursive, state_override return results; } - /// PRIVATE remove vowels from mapcode str into an all-digit mapcode (assumes str is already uppercase!) function aeu_unpack(str) { var voweled = 0; @@ -1781,7 +1721,6 @@ function aeu_unpack(str) { } } // nonodigit! - return str; } @@ -1789,13 +1728,11 @@ function aeu_unpack(str) { function master_decode(mapcode, territoryNumber) // returns object with y and x fields, or false { mapcode = to_ascii(mapcode); - + var extensionchars = ''; var minpos = mapcode.indexOf('-'); if (minpos > 0) { - extrapostfix = trim(mapcode.substring(minpos + 1)); + extensionchars = trim(mapcode.substring(minpos + 1)); mapcode = trim(mapcode.substring(0, minpos)); - } else { - extrapostfix = ''; } mapcode = aeu_unpack(mapcode); @@ -1803,7 +1740,6 @@ function master_decode(mapcode, territoryNumber) // returns object with y and x return false; } // failed to decode! - var mclen = mapcode.length; if (mclen >= 10) { @@ -1825,24 +1761,23 @@ function master_decode(mapcode, territoryNumber) // returns object with y and x var prefixlength = mapcode.indexOf('.'); var postfixlength = mclen - 1 - prefixlength; + var incodex = prefixlength * 10 + postfixlength; var result; - var i; - for (i = from; i <= upto; i++) { - dataSetup(i); - if (recType == 0 && isnameless == 0 && codexhi == prefixlength && codexlo == postfixlength) { - result = decodeGrid(mapcode, minx, miny, maxx, maxy, '', territoryNumber, i); - if (isrestricted && result) { + var m; + for (m = from; m <= upto; m++) { + var codex = Codex(m); + if (recType(m) == 0 && isNameless(m) == 0 && (incodex == codex || (incodex == 22 && codex == 21))) { + result = decodeGrid(mapcode, extensionchars, '', m); + if (result && isRestricted(m)) { var fitssomewhere = 0; var j; for (j = upto - 1; j >= from; j--) { // look in previous rects - dataSetup(j); - if (isrestricted) { - continue; - } - if (fitsInsideWithRoom(result, minx, maxx, miny, maxy)) { - fitssomewhere = 1; - break; + if (!isRestricted(j)) { + if (fitsInsideWithRoom(result, minmaxSetup(j))) { + fitssomewhere = 1; + break; + } } } if (!fitssomewhere) { @@ -1851,16 +1786,16 @@ function master_decode(mapcode, territoryNumber) // returns object with y and x } break; } - else if (recType == 1 && codexlo == postfixlength && codexhi + 1 == prefixlength && headerLetter(i) == mapcode.charAt(0)) { - result = decodeGrid(mapcode.substr(1), minx, miny, maxx, maxy, mapcode.substr(0, 1), territoryNumber, i); + else if (recType(m) == 1 && codex + 10 == incodex && headerLetter(m) == mapcode.charAt(0)) { + result = decodeGrid(mapcode.substr(1), extensionchars, mapcode.substr(0, 1), m); break; } - else if (isnameless && ((codex == 21 && prefixlength == 2 && postfixlength == 2 ) || (codex == 22 && prefixlength == 3 && postfixlength == 2) || (codex == 13 && prefixlength == 2 && postfixlength == 3))) { - result = decodeNameless(mapcode, i); + else if (isNameless(m) && ((codex == 21 && incodex == 22 ) || (codex == 22 && incodex == 32) || (codex == 13 && incodex == 23))) { + result = decodeNameless(mapcode, extensionchars, m, from); break; } - else if (recType > 1 && postfixlength == 3 && codexlo + codexhi == prefixlength + 2) { - result = decodeAutoHeader(mapcode, i, territoryNumber); + else if (recType(m) > 1 && postfixlength == 3 && CodexLen(m) == prefixlength + 2) { + result = decodeAutoHeader(mapcode, extensionchars, m); break; } } @@ -1870,20 +1805,17 @@ function master_decode(mapcode, territoryNumber) // returns object with y and x result.x -= 360000000; } else if (result.x < -180000000) { result.x += 360000000; - } // 1.33 normalize <-180 + } // make sure result is in the country if (territoryNumber != ccode_earth) { - minmaxSetup(upto); // find encompassing rect - if (!(fitsInsideWithRoom(result, minx, maxx, miny, maxy))) { // does not fit? + if (!(fitsInsideWithRoom(result, minmaxSetup(upto)))) { return false; } } - } - if (result) { - result.x = result.x / 1000000.0; - result.y = result.y / 1000000.0; + result.x /= 1000000.0; + result.y /= 1000000.0; if (result.y > 90) { result.y = 90; } @@ -1912,9 +1844,10 @@ function fullname(territoryNumber, keepindex) { return getTerritoryFullname(territoryNumber); } function master_encode(orgy, orgx, tn, isrecursive, stop_with_one_result, allowworld, state_override) { - mapcoderEngine(orgy, orgx, tn, stop_with_one_result, isrecursive, state_override); + var enc = getEncodeRec(lat, lon); + mapcoderEngine(enc, tn, stop_with_one_result, isrecursive, state_override, 0); if (allowworld && !isrecursive && tn != ccode_earth && (results.length == 0 || results[results.length - 1].territoryNumber != ccode_earth)) { - mapcoderEngine(orgy, orgx, ccode_earth, stop_with_one_result, true/*recursive*/, -1); + mapcoderEngine(enc, ccode_earth, stop_with_one_result, true/*recursive*/, -1, 0); } var strArray = []; for (var i = 0; i < results.length; i++) { @@ -1928,34 +1861,38 @@ function master_encode(orgy, orgx, tn, isrecursive, stop_with_one_result, alloww /// PUBLIC returns {distance,width,height}, the distance between two coordinates, and the longitudinal distance ("width") and latitudinal distance ("height") - all expressed in meters /// Warning: accurate only for coordinates within a few hundred meters of each other function distanceInMeters(latDeg1, lonDeg1, latDeg2, lonDeg2) { + var worstParallel = 0; // assume equator if (latDeg1 > latDeg2) { - var t = latDeg1; - latDeg1 = latDeg2; - latDeg2 = t; + if (latDeg1 < 0) { + worstParallel = latDeg2; + } else if (latDeg2 > 0) { + worstParallel = latDeg1; + } } - var worstParallel = 0; // assume equator - if (latDeg2 < 0) { - worstParallel = latDeg1; - } else if (latDeg1 > 0) { - worstParallel = latDeg2; + else { + if (latDeg2 < 0) { + worstParallel = latDeg1; + } else if (latDeg1 > 0) { + worstParallel = latDeg2; + } } var dy = (latDeg2 - latDeg1) * 1000000 / 9; var dx = (lonDeg2 - lonDeg1) * Math.cos(Math.PI * worstParallel / 180) * 1000000 / 9; return {distance: Math.sqrt(dx * dx + dy * dy), width: (dx < 0 ? -dx : dx), height: (dy < 0 ? -dy : dy)}; } -/// PUBLIC convert a mapcode (without territory abbreviation) into a particular alphabet +/// PUBLIC convert a mapcode (skipping the territory abbreviation) into a particular alphabet /// targetAlphabet: 0=roman, 1=greek etc. /// returns: string function convertToAlphabet(mapcode, targetAlphabet) { - return showinlan(to_ascii(mapcode), targetAlphabet, false) + return showinlan(mapcode, targetAlphabet, false); } -/// PUBLIC convert a mapcode (without territory abbreviation) into a particular alphabet +/// PUBLIC convert a mapcode (skipping the territory abbreviation) into a particular alphabet /// targetAlphabet: 0=roman, 1=greek etc. /// returns: HTML-encoded string function convertToAlphabetAsHTML(mapcode, targetAlphabet) { - return showinlan(to_ascii(mapcode), targetAlphabet, true) + return showinlan(mapcode, targetAlphabet, true); } /// PUBLIC decode a string (which may contain a full mapcode, including a territory) @@ -1995,12 +1932,11 @@ function decode(mapcodeString, territory) { /// the WithPrecision variants produce mapcodes extended with high-precision letters (the parameter specifies how many letters: 0, 1, or 2). function encodeWithPrecision(latitudeDegrees, longitudeDegrees, precision, territory) { - use_high_precision = precision; - return mapcoderEngine(latitudeDegrees, longitudeDegrees, getTerritoryNumber(territory), false/*getshortest*/, false/*recursive*/, -1/*override*/); + return mapcoderEngine(getEncodeRec(latitudeDegrees, longitudeDegrees), getTerritoryNumber(territory), false/*getshortest*/, false/*recursive*/, -1/*override*/, precision); } function encode(latitudeDegrees, longitudeDegrees, territory) { - return encodeWithPrecision(latitudeDegrees, longitudeDegrees, 0, getTerritoryNumber(territory)) + return encodeWithPrecision(latitudeDegrees, longitudeDegrees, 0, territory) } function encodeInternational(latitudeDegrees, longitudeDegrees) { @@ -2012,10 +1948,9 @@ function encodeInternationalWithPrecision(latitudeDegrees, longitudeDegrees, pre } function encodeShortestWithPrecision(latitudeDegrees, longitudeDegrees, precision, territory) { - use_high_precision = precision; - return mapcoderEngine(latitudeDegrees, longitudeDegrees, getTerritoryNumber(territory), true/*getshortest*/, false/*recursive*/, -1/*override*/); + return mapcoderEngine(getEncodeRec(latitudeDegrees, longitudeDegrees), getTerritoryNumber(territory), true/*getshortest*/, false/*recursive*/, -1/*override*/, precision); } function encodeShortest(latitudeDegrees, longitudeDegrees, territory) { - return encodeShortestWithPrecision(latitudeDegrees, longitudeDegrees, 0, getTerritoryNumber(territory)); + return encodeShortestWithPrecision(latitudeDegrees, longitudeDegrees, 0, territory); } diff --git a/mapcode_library_js.doc b/mapcode_library_js.doc index ba8ab903289d4e8a14d4832f8b2d56b7d5cc66df..7652b4ecabe4590ec17d0092ac53dc48f432a283 100644 GIT binary patch literal 93184 zcmeF431Ae}`M@U!kO(U`0-}zHl3=nV+@MlIxQ~D&oNdKTvPl+_Y~0-tLOp`_(JCr! zz51^QTJdPnTD2bawjQWhQNaVnDqd(o!K1bE|9x-X%+79hLj<)~7Jf7H=FNNaj_-Z% zdvD%MHayq$&1-J!yVZ#MjWyDYulHmc?Oo?nIlj$ycQK6LbDRQS@7c3QPX7+p0nWDH ze@F>zzy2X3`^3z2!}y}x15$~Gk*Bs){GWbk7zY}qOG=kCb#3aZ&cS_EXr)FMfZ-vDW$c{U%C9TFfi#<=2}1 z0Iu773il^qL6c#;jr(iD=dzFg+4=w5@$o*EJ3c-3b@pE3b^q-6?7f{&`xb>1fyO=FiIK?qqptJ{yxf~ANvBzRhpj2 zpZu!1?nlIO#8P^M}HL zV68dCo9E5~Vc z5&syotjbpx@rTUeBqbaPo1tKRBv8v;%l&mBf0-}hFE_)1+A_aM;?(W(y~FdoLys{% zcF++zXrQJp7>f96BPO@-NzApCL{#G|_nQ^LkQwq<`+Z@*N^jmV9#6j4EVS|*sI4>! z5DbRO1GU`J4AfE}KD!7!o~gBFgly;{F~g1Fh`%PsB;lbzBp3=vDTVx`qb48;CfB5$ zq*PY>!#QSckWy_lePxk)U$sd}>VnmQNT3WyDYqnFUP>uIQvJT#Fn97rVw2Mls3u%R zgj#6~_^ZpEgwzGY;Xr9XVj~FwDlJGdh@jRC)^ecJ*XT7T`pT-fuYGwVxeZAgt0k$F zbl6`@=}RV~#gJo`)O;a_e?kubD#vOr=iB*rnZ zNpUW4-80`y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iB(CE=N$uylX!c3Xj;)Z<9T~1 zUNA)BnY%aP;>ySyPxu2cMGuu|CcC~jX{Im50)+F=o31AFUT4I9;gZZxayY{);Hf?0YDUd+Y zirpE#9<-9^Ovs4fnLCpq!3z;Yc`#!&lyQ`F#Aw<~Xz|mTW(z7j7|&80d&ZP0X)elB zIN`;(GjjAFXJ=yaEJ2t&(~Cm~1smiUd%+QJ#(fSQjK|ajNQ5L<3+rG#(CNttQ(z-( zf>cO@bfD9}b=uN7OvimMRS97BGuwQb5IL`LQ-uFBxlIt`%kY^Qf>s35o|yZ!i(nZK zqw)n`dCW3qjUdJkLmLFGeoO)rN&n5U^s+xQTcQsaGyf=kTIO7v5yNovW;x8abVLwy Gjrl(aFZ%od diff --git a/ndata.js b/ndata.js index 5329c70..eaee32d 100644 --- a/ndata.js +++ b/ndata.js @@ -15,6 +15,7 @@ */ var data_start = [ + 0, 3, 6, 10, 14, 17, 19, 20, 31, 32, 34, 36, 38, 43, 45, 48, 52, 59, 63, 65, 67, 71, 73, 81, 87, 95, 97, 132, 139, 149, @@ -70,7 +71,6 @@ var data_start = [ 16094, 16114, 16135, 16153, 16171, 16190, 16206, 16222, 16276, 16302, 16309, 16311, 16312, 16344]; - var data_flags = [ 11, 534, 540, 11, 534, 540, 11, 34956, 12945, 540, 10, 75, 75, 17, 1098, 1098, 12, 11, 12, 11, @@ -892,7 +892,6 @@ var data_flags = [ 16535, 18583, 20631, 22679, 24727, 26775, 28823, 30871, 32919, 34967, 37015, 39063, 41111, 43159, 45207, 47255, 49303, 51351, 53399, 55447, 57495, 59543, 61591, 29, -1]; - var data_minx = [ 12433114, 5850000, 12444000, 7404110, -5200000, 7404110, -5384925, -5734540, -6703000, -5384925, @@ -2531,7 +2530,6 @@ var data_minx = [ -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -180000000, -1]; - var data_miny = [ 41851944, 35450000, 41899000, 43723932, 41310000, 43723932, 36107682, 35987080, 35867000, 36107682, @@ -4170,7 +4168,6 @@ var data_miny = [ 10145275, 14243171, 18420638, 22677675, 27054069, 31589604, 36324066, 41337026, 46668269, 52556508, 59200669, 66998607, 77183669, -90000000, -1]; - var data_maxx = [ 115320, 12710000, 16000, 40362, 14800000, 40362, 63426, 572880, 3277000, 63426, @@ -5809,7 +5806,6 @@ var data_maxx = [ 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, 360000000, -1]; - var data_maxy = [ 86490, 19630000, 9000, 28830, 12247000, 28830, 51894, 8, 2608972, 51894, @@ -7448,7 +7444,6 @@ var data_maxy = [ 4097896, 4177467, 4257037, 4376394, 4535535, 4734462, 5012960, 5331243, 5888239, 6644161, 7797938, 10185062, 12816332, 180000000, -1]; - var data_special1 = [ 1, 1290, 3, 1, 1, 3, 1, 1, 166, 3, 1, 3844, 3721, 167, 679, 679, 1, 1, 1, 1, diff --git a/sample.html b/sample.html index 7cc5b88..3fbac89 100644 --- a/sample.html +++ b/sample.html @@ -65,9 +65,7 @@

Sample mapcode HTML

- -
Enter a territory and enter a mapcode:
- +
Enter a territory and enter a mapcode


@@ -116,13 +114,11 @@

Sample mapcode HTML

Longitude: - Restrict to territory:: + Restrict to territory: - -
Enter a latitude, a longitude, and a default territory context:
- +
Enter a latitude, a longitude, and a default territory context
From 6aae9b27c6d0f5d0e392e640f196343258faef31 Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Tue, 4 Aug 2015 17:13:59 +0200 Subject: [PATCH 2/2] Release 2.0.1 --- README.md | 56 ++++++++++++++++++++--------------------------------- mapcode.js | 4 ++-- sample.html | 12 ++++++++---- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 8d3faad..12ef2ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Mapcode Library for JavaScript -Copyright (C) 2014 Stichting Mapcode Foundation (http://www.mapcode.com) +Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com) ---- @@ -16,7 +16,7 @@ not need to be transported to the client. You can find the Mapcode REST API sources, ready to be deployed on any JVM server, like Tomcat or Jetty, on: **https://github.com/mapcode-foundation/mapcode-rest-service** -## License +# License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ limitations under the License. Original C library created by Pieter Geelen. Work on Java version of the Mapcode library by Rijn Buve and Matthew Lowden. -## Javascript Files for Mapcode Support +# Javascript Files for Mapcode Support mapcode.js - Key routines for mapcode support ndata.js - Data table for mapcode support @@ -41,35 +41,29 @@ of the Mapcode library by Rijn Buve and Matthew Lowden. sample.html - Sample code to interpret / generate mapcodes ctrynams.js - Optional js array with the names of territories (in English) -## Version History +# Version History -* July 2015 +* 2.0.1 - August 2015 - * 2.0.1 + Minor fixes. - Prettyfied source and minor fixes. - - * 2.0.0 +* 2.0.0 - July 2015 Fixes to the data rectangles (primarily intended for ISO proposal), see Word document for details. -* June 2015 - - * 1.54 +* 1.54 - June 2015 Removed unneeded mminfo flags (no effect on functionality). -* May 2015 - - * 1.50.3 +* 1.50.3 - May 2015 Redesign of the API to conform to Javascript standards and match the Java implementation of the mapcode system - * 1.50.1 +* 1.50.1 - May 2015 Bugfix for mapcodes in IN-DD (in India). - * 1.50 +* 1.50 - May 2015 Major release. This version is not backwards compatible with mapcode 1.4x: is has dropped support for Antartica AT0-8 codes and has a changed (improved) way of dealing with the Greek alphabet. @@ -80,51 +74,43 @@ of the Mapcode library by Rijn Buve and Matthew Lowden. Retired legacy Antarctica claims AT0 through AT8. -* January 2015 - - * 1.41 +* 1.41 - January 2015 Added the India state Telangana (IN-TG), until 2014 a region in Adhra Pradesh. -* August 2014 - - * 1.33 +* 1.33 - August 2014 Normalise results when longitude below -180 degrees. - * 1.32 +* 1.32 - August 2014 Prevent FIJI failing to decode at exactly 180 degrees; prevent invalid filtering near the territory bounding rectangle. -* April 2014 - - * 1.31 +* 1.31 - April 2014 Make iso2ccode() even more forgiving by allowing a state alias to be recognized in context. - * 1.3 +* 1.3 - April 2014 Disable 7-char state codes for large states in India, and instead generate country mapcodes for states. - * 1.28 +* 1.28 - April 2014 Fix for starpipe "zoning" error, causing the last 2 mapcode characters to be ignored in certain areas. - * 1.27 +* 1.27 - April 2014 Support undefined ranges in data array (useful for partial JavaScript builds). -* May 2013 - - * 1.26 +* 1.26 - May 2013 Added alias OD for India, and 2.3 code for Daman and Diu. - * 1.25 +* 1.25 - May 2013 Ccode2iso(c,2) support added. - * 1.24 +* 1.24 - May 2013 Public domain release. diff --git a/mapcode.js b/mapcode.js index 1917ae2..2157c49 100644 --- a/mapcode.js +++ b/mapcode.js @@ -70,7 +70,7 @@ var entity_iso = [ '8HN', '8GX', '8SC', '8YN', '8XZ', '8GS', '8QH', '8XJ', 'CHN', 'UMI', 'CPT', 'ATA', 'AAA', '?']; -var 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,"; +var aliases = "2UK=2UT,2CG=2CT,1GU=GUM,1UM=UMI,1VI=VIR,1AS=ASM,1MP=MNP,4CX=CXR,4CC=CCK,4NF=NFK,4HM=HMD,COL=5CL,5ME=5MX,MEX=5MX,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,1PR=PRI,5TM=TAM,TAM=TAM,2OD=2OR,"; var dependency = [ 27, 410, 50, 410, 26, 410, 53, 410, 48, 410, 47, 410, 76, 410, 529, 410, 38, 410, @@ -181,7 +181,7 @@ function iso2ccode(territoryAlphaCode) { if (typeof territoryAlphaCode == "undefined") { return undefined; } - if (!isNaN(territoryAlphaCode)) { + if (!isNaN(territoryAlphaCode) && territoryAlphaCode < 800) { return territoryAlphaCode; } territoryAlphaCode = trim(String(territoryAlphaCode)).toUpperCase(); diff --git a/sample.html b/sample.html index 3fbac89..3f78b92 100644 --- a/sample.html +++ b/sample.html @@ -1,5 +1,5 @@