/* * Copyright 2009 mizba.net * * 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. */ // Author: mizba // Created: Thu Jun 11 06:30:31 JST 2009 // Updated: Thu Aug 05 07:18:33 JST 2009 // //////////////////////////////////////////// // BEGIN: define namespace var net; if (!net) net = {} else if (typeof net != "object") throw new Error("Faied to initialize : namespace error."); if (!net.mizba) net.mizba = {} else if (typeof net.mizba != "object") throw new Error("Faied to initialize : namespace error."); if (!net.mizba.geo) net.mizba.geo = {} else if (typeof net.mizba != "object") throw new Error("Faied to initialize : namespace error."); // END: define namespace // //////////////////////////////////////////// // //////////////////////////////////////////// // BEGIN: classes // ///// // net.mizba.geo.GeoPoint represents Geodetic Point // version net.mizba.geo.VERSION = "1.0"; // cunstructor net.mizba.geo.GeoPoint = function(lat, lon, height, datum) { // set geo point parameters this.lat = lat; this.lon = lon; this.height = (height) ? height : 0; this.datum = (datum) ? datum : net.mizba.geo.Datum.WGS84; }; // prototype net.mizba.geo.GeoPoint.prototype = { }; // ///// // net.mizba.geo.Ellipsoid class represents Reference Ellipsoids. // cunstructor net.mizba.geo.Ellipsoid = function(ellipsoidName) { // lookup ellipsoid by name var ellipsoid = net.mizba.geo.Ellipsoid.ELLIPSOID[ellipsoidName]; if (!ellipsoid) throw new Error("ellipsoid \"" + ellipsoidName + "\" not found."); // set ellipsoid parameters this.a = ellipsoid[0]; // semi-major axis this.f = 1.0 / ellipsoid[1]; // inverse of flatting // a divided by b this.adb = 1.0 / (1.0 - this.f); // preparation for Molodensky transformation this.squaredEccentricity = (2.0 * this.f) - (this.f * this.f); }; // prototype net.mizba.geo.Ellipsoid.prototype = { }; // ///// // net.mizba.geo.Datum represents Geodetic Datum Transformation parameters. // cunstructor net.mizba.geo.Datum = function(datumName, regionName){ // lookup datum by name var datum = net.mizba.geo.Datum.DATUM[datumName]; if (!datum) throw new Error("datum \"" + datumName + "\" not found."); // lookup region by name if (!regionName) { regionName = datum._DefaultRegionName; } var region = datum[regionName]; if (!region) throw new Error("region \"" + regionName + "\" not found."); // set datum parameters this.ellipsoid = new net.mizba.geo.Ellipsoid(region[0]); this.dx = region[1]; this.dy = region[2]; this.dz = region[3]; }; // constants net.mizba.geo.Datum.DEG2RAD = Math.PI / 180.0; net.mizba.geo.Datum.RAD2DEG = 180.0 / Math.PI; // prototype net.mizba.geo.Datum.prototype = { // create GeoPoint whose datum is this "createGeoPoint" : function(lat, lon, height) { return new net.mizba.geo.GeoPoint(lat, lon, height, this); }, // Molodensky datum transform algorithm implementation "transform" : function(point) { var fromDatum = point.datum; var toDatum = this; // differential var da = toDatum.ellipsoid.a - fromDatum.ellipsoid.a; var df = toDatum.ellipsoid.f - fromDatum.ellipsoid.f; var dx = - (toDatum.dx - fromDatum.dx); var dy = - (toDatum.dy - fromDatum.dy); var dz = - (toDatum.dz - fromDatum.dz); // transform lat/lon to radian var sinLat = Math.sin(point.lat * net.mizba.geo.Datum.DEG2RAD); var cosLat = Math.cos(point.lat * net.mizba.geo.Datum.DEG2RAD); var sinLon = Math.sin(point.lon * net.mizba.geo.Datum.DEG2RAD); var cosLon = Math.cos(point.lon * net.mizba.geo.Datum.DEG2RAD); // var rn = fromDatum.ellipsoid.a / Math.sqrt(1.0 - fromDatum.ellipsoid.squaredEccentricity * sinLat * sinLat); var rm = fromDatum.ellipsoid.a * (1.0 - fromDatum.ellipsoid.squaredEccentricity) / Math.pow((1.0 - fromDatum.ellipsoid.squaredEccentricity * sinLat * sinLat), 1.5); // var dlat = ( - dx * sinLat * cosLon - dy * sinLat * sinLon + dz * cosLat + da * rn * fromDatum.ellipsoid.squaredEccentricity * sinLat * cosLat / fromDatum.ellipsoid.a + df * (rm * fromDatum.ellipsoid.adb + rn / fromDatum.ellipsoid.adb) * sinLat * cosLat) / (rm + point.height); var dlon = (-dx * sinLon + dy * cosLon) / ((rn + point.height) * cosLat); var dh = (dx * cosLat * cosLon) + (dy * cosLat * sinLon) + (dz * sinLat) - (da * (fromDatum.ellipsoid.a / rn)) + ((df * rn * sinLat * sinLat) / fromDatum.ellipsoid.adb); // result return new net.mizba.geo.GeoPoint( point.lat + dlat * net.mizba.geo.Datum.RAD2DEG, point.lon + dlon * net.mizba.geo.Datum.RAD2DEG, point.height + dh, this); } }; // END: classes // //////////////////////////////////////////// // //////////////////////////////////////////// // BEGIN: constnats // ellipsoid parameters (defined as a class variable) net.mizba.geo.Ellipsoid.ELLIPSOID = { "Airy 1830," : [6377563.396, 299.3249646], "Modified Airy" : [6377340.189, 299.3249646], "Australian National" : [6378160, 298.25], "Bessel 1841 (Namibia)" : [6377483.865, 299.1528128], "Bessel 1841" : [6377397.155, 299.1528128], "Clarke 1866," : [6378206.4, 294.9786982], "Clarke 1880," : [6378249.145, 293.465], "Everest (India 1830)" : [6377276.345, 300.8017], "Everest (Sabah Sarawak) " : [6377298.556, 300.8017], "Everest (India 1956)" : [6377301.243, 300.8017], "Everest (Malaysia 1969) " : [6377295.664, 300.8017], "Everest (Malay. & Sing) " : [6377304.063, 300.8017], "Everest (Pakistan)" : [6377309.613, 300.8017], "Modified Fischer 1960" : [6378155, 298.3], "Helmert 1906" : [6378200, 298.3], "Hough 1960" : [6378270, 297], "Indonesian 1974" : [6378160, 298.247], "International 1924" : [6378388, 297 ], "Krassovsky 1940" : [6378245, 298.3], "GRS 80" : [6378137, 298.257222101], "South American 1969" : [6378160, 298.25 ], "WGS 72" : [6378135, 298.26], "WGS 84" : [6378137, 298.257223563] }; // datum parameters (defined as a class variable) net.mizba.geo.Datum.DATUM = { "Adindan" : { "_DefaultRegionName" : "Burkina Faso", "Burkina Faso" : ["Clarke 1880", -118, -14, 218], "Cameroon" : ["Clarke 1880", -134, -2, 210], "Ethiopia" : ["Clarke 1880", -165, -11, 206], "Mali" : ["Clarke 1880", -123, -20, 220], "MEAN FOR Ethiopia; Sudan" : ["Clarke 1880", -166, -15, 204], "Senegal" : ["Clarke 1880", -128, -18, 224], "Sudan" : ["Clarke 1880", -161, -14, 205] }, "Afgooye" : { "_DefaultRegionName" : "Somalia", "Somalia" : ["Krassovsky 1940", -43, -163, 45] }, "Ain el Abd 1970" : { "_DefaultRegionName" : "Bahrain", "Bahrain" : ["International 1924", -150, -250, -1], "Saudi Arabia" : ["International 1924", -143, -236, 7] }, "American Samoa 1962" : { "_DefaultRegionName" : "American Samoa Islands", "American Samoa Islands" : ["Clarke 1866", -115, 118, 426] }, "Anna 1 Astro 1965" : { "_DefaultRegionName" : "Cocos Islands", "Cocos Islands" : ["Australian National", -491, -22, 435] }, "Antigua Island Astro 1943" : { "_DefaultRegionName" : "Antigua (Leeward Islands)", "Antigua (Leeward Islands)" : ["Clarke 1880", -270, 13, 62] }, "Arc 1950" : { "_DefaultRegionName" : "Botswana", "Botswana" : ["Clarke 1880", -138, -105, -289], "Burundi" : ["Clarke 1880", -153, -5, -292], "Lesotho" : ["Clarke 1880", -125, -108, -295], "Malawi" : ["Clarke 1880", -161, -73, -317], "MEAN FOR Botswana; Lesotho; Malawi; Swaziland; Zaire; Zambia; Zimbabwe" : ["Clarke 1880", -143, -90, -294], "Swaziland" : ["Clarke 1880", -134, -105, -295], "Zaire" : ["Clarke 1880", -169, -19, -278], "Zambia" : ["Clarke 1880", -147, -74, -283], "Zimbabwe" : ["Clarke 1880", -142, -96, -293] }, "Arc 1960" : { "_DefaultRegionName" : "MEAN FOR Kenya; Tanzania", "MEAN FOR Kenya; Tanzania" : ["Clarke 1880", -160, -6, -302], "Kenya" : ["Clarke 1880", -157, -2, -299], "Taanzania" : ["Clarke 1880", -175, -23, -303] }, "Ascension Island 1958" : { "_DefaultRegionName" : "Ascension Island", "Ascension Island" : ["International 1924", -205, 107, 53] }, "Astro Beacon E 1945" : { "_DefaultRegionName" : "Iwo Jima", "Iwo Jima" : ["International 1924", 145, 75, -272] }, "Astro DOS 71/4" : { "_DefaultRegionName" : "St Helena Island", "St Helena Island" : ["International 1924", -320, 550, -494] }, "Astro Tern Island (FRIG) 1961" : { "_DefaultRegionName" : "Tern Island", "Tern Island" : ["International 1924", 114, -116, -333] }, "Astronomical Station 1952" : { "_DefaultRegionName" : "Marcus Island", "Marcus Island" : ["International 1924", 124, -234, -25] }, "Australian Geodetic 1966" : { "_DefaultRegionName" : "Australia; Tasmania", "Australia; Tasmania" : ["Australian National", -133, -48, 148] }, "Australian Geodetic 1984" : { "_DefaultRegionName" : "Australia; Tasmania", "Australia; Tasmania" : ["Australian National", -134, -48, 149] }, "Ayabelle Lighthouse" : { "_DefaultRegionName" : "Djibouti", "Djibouti" : ["Clarke 1880", -79, -129, 145] }, "Bellevue (IGN)" : { "_DefaultRegionName" : "Efate & Erromango Islands", "Efate & Erromango Islands" : ["International 1924", -127, -769, 472] }, "Bermuda 1957" : { "_DefaultRegionName" : "Bermuda", "Bermuda" : ["Clarke 1866", -73, 213, 296] }, "Bissau" : { "_DefaultRegionName" : "Guinea-Bissau", "Guinea-Bissau" : ["International 1924", -173, 253, 27] }, "Bogota Observatory" : { "_DefaultRegionName" : "Colombia", "Colombia" : ["International 1924", 307, 304, -318] }, "Bukit Rimpah" : { "_DefaultRegionName" : "Indonesia (Bangka & Belitung Ids)", "Indonesia (Bangka & Belitung Ids)" : ["Bessel 1841", -384, 664, -48] }, "Camp Area Astro" : { "_DefaultRegionName" : "Antarctica (McMurdo Camp Area)", "Antarctica (McMurdo Camp Area)" : ["International 1924", -104, -129, 239] }, "Campo Inchauspe" : { "_DefaultRegionName" : "Argentina", "Argentina" : ["International 1924", -148, 136, 90] }, "Canton Astro 1966" : { "_DefaultRegionName" : "Phoenix Islands", "Phoenix Islands" : ["International 1924", 298, -304, -375] }, "Cape" : { "_DefaultRegionName" : "South Africa", "South Africa" : ["Clarke 1880", -136, -108, -292] }, "Cape Canaveral" : { "_DefaultRegionName" : "Bahamas; Florida", "Bahamas; Florida" : ["Clarke 1866", -2, 151, 181] }, "Carthage" : { "_DefaultRegionName" : "Tunisia", "Tunisia" : ["Clarke 1880", -263, 6, 431] }, "Chatham Island Astro 1971" : { "_DefaultRegionName" : "New Zealand (Chatham Island)", "New Zealand (Chatham Island)" : ["International 1924", 175, -38, 113] }, "Chua Astro" : { "_DefaultRegionName" : "Paraguay", "Paraguay" : ["International 1924", -134, 229, -29] }, "Corrego Alegre" : { "_DefaultRegionName" : "Brazil", "Brazil" : ["International 1924", -206, 172, -6] }, "Dabola" : { "_DefaultRegionName" : "Guinea", "Guinea" : ["Clarke 1880", -83, 37, 124] }, "Deception Island" : { "_DefaultRegionName" : "Deception Island; Antarctia", "Deception Island; Antarctia" : ["Clarke 1880", 260, 12, -147] }, "Djakarta (Batavia)" : { "_DefaultRegionName" : "Indonesia (Sumatra)", "Indonesia (Sumatra)" : ["Bessel 1841", -377, 681, -50] }, "DOS 1968" : { "_DefaultRegionName" : "New Georgia Islands (Gizo Island)", "New Georgia Islands (Gizo Island)" : ["International 1924", 230, -199, -752] }, "Easter Island 1967" : { "_DefaultRegionName" : "Easter Island", "Easter Island" : ["International 1924", 211, 147, 111] }, "Estonia; Coordinate System 1937" : { "_DefaultRegionName" : "Estonia", "Estonia" : ["Bessel 1841", 374, 150, 588] }, "European 1950" : { "_DefaultRegionName" : "Cyprus", "Cyprus" : ["International 1924", -104, -101, -140], "Egypt" : ["International 1924", -130, -117, -151], "England; Channel Islands; Scotland; Shetland Islands" : ["International 1924", -86, -96, -120], "England; Ireland; Scotland; Shetland Islands" : ["International 1924", -86, -96, -120], "Finland; Norway" : ["International 1924", -87, -95, -120], "Greece" : ["International 1924", -84, -95, -130], "Iran" : ["International 1924", -117, -132, -164], "Italy (Sardinia)" : ["International 1924", -97, -103, -120], "Italy (Sicily)" : ["International 1924", -97, -88, -135], "Malta" : ["International 1924", -107, -88, -149], "MEAN FOR Austria; Belgium; Denmark; Finland; France; W Germany; Gibraltar; Greece; Italy; Luxembourg; Netherlands; Norway; Portugal; Spain; Sweden; Switzerland" : ["International 1924", -87, -98, -121], "MEAN FOR Austria; Denmark; France; W Germany; Netherlands; Switzerland" : ["International 1924", -87, -96, -120], "MEAN FOR Iraq; Israel; Jordan; Lebanon; Kuwait; Saudi Arabia; Syria" : ["International 1924", -103, -106, -141], "Portugal; Spain" : ["International 1924", -84, -107, -120], "Tunisia" : ["International 1924", -112, -77, -145] }, "European 1979" : { "_DefaultRegionName" : "MEAN FOR Austria; Finland; Netherlands; Norway; Spain; Sweden; Switzerland", "MEAN FOR Austria; Finland; Netherlands; Norway; Spain; Sweden; Switzerland" : ["International 1924", -86, -98, -119] }, "Fort Thomas 1955" : { "_DefaultRegionName" : "Nevis; St. Kitts (Leeward Islands)", "Nevis; St. Kitts (Leeward Islands)" : ["Clarke 1880", -7, 215, 225] }, "Gan 1970" : { "_DefaultRegionName" : "Republic of Maldives", "Republic of Maldives" : ["International 1924", -133, -321, 50] }, "Geodetic Datum 1949" : { "_DefaultRegionName" : "New Zealand", "New Zealand" : ["International 1924", 84, -22, 209] }, "Graciosa Base SW 1948" : { "_DefaultRegionName" : "Azores (Faial; Graciosa; Pico; Sao Jorge; Terceira)", "Azores (Faial; Graciosa; Pico; Sao Jorge; Terceira)" : ["International 1924", -104, 167, -38] }, "Guam 1963" : { "_DefaultRegionName" : "Guam", "Guam" : ["Clarke 1866", -100, -248, 259] }, "Gunung Segara" : { "_DefaultRegionName" : "Indonesia (Kalimantan)", "Indonesia (Kalimantan)" : ["Bessel 1841", -403, 684, 41] }, "GUX 1 Astro" : { "_DefaultRegionName" : "Guadalcanal Island", "Guadalcanal Island" : ["International 1924", 252, -209, -751] }, "Herat North" : { "_DefaultRegionName" : "Afghanistan", "Afghanistan" : ["International 1924", -333, -222, 114] }, "Hermannskogel Datum" : { "_DefaultRegionName" : "Croatia -Serbia", "Croatia -Serbia" : ["Bessel 1841 (Namibia)", 653, -212, 449] }, "Hjorsey 1955" : { "_DefaultRegionName" : "Iceland", "Iceland" : ["International 1924", -73, 46, -86] }, "Hong Kong 1963" : { "_DefaultRegionName" : "Hong Kong", "Hong Kong" : ["International 1924", -156, -271, -189] }, "Hu-Tzu-Shan" : { "_DefaultRegionName" : "Taiwan", "Taiwan" : ["International 1924", -637, -549, -203] }, "Indian" : { "_DefaultRegionName" : "Bangladesh", "Bangladesh" : ["Everest (India 1830)", 282, 726, 254], "India; Nepal" : ["Everest (India 1956)", 295, 736, 257], "Pakistan" : ["Everest (Pakistan)", 283, 682, 231] }, "Indian 1954" : { "_DefaultRegionName" : "Thailand", "Thailand" : ["Everest (India 1830)", 217, 823, 299] }, "Indian 1960" : { "_DefaultRegionName" : "Vietnam (Con Son Island)", "Vietnam (Con Son Island)" : ["Everest (India 1830)", 182, 915, 344], "Vietnam (Near 16?N)" : ["Everest (India 1830)", 198, 881, 317] }, "Indian 1975" : { "_DefaultRegionName" : "Thailand", "Thailand" : ["Everest (India 1830)", 210, 814, 289] }, "Indonesian 1974" : { "_DefaultRegionName" : "Indonesia", "Indonesia" : ["Indonesian 1974", -24, -15, 5] }, "Ireland 1965" : { "_DefaultRegionName" : "Ireland", "Ireland" : ["Modified Airy", 506, -122, 611] }, "ISTS 061 Astro 1968" : { "_DefaultRegionName" : "South Georgia Islands", "South Georgia Islands" : ["International 1924", -794, 119, -298] }, "ISTS 073 Astro 1969" : { "_DefaultRegionName" : "Diego Garcia", "Diego Garcia" : ["International 1924", 208, -435, -229] }, "Johnston Island 1961" : { "_DefaultRegionName" : "Johnston Island", "Johnston Island" : ["International 1924", 189, -79, -202] }, "Kandawala" : { "_DefaultRegionName" : "Sri Lanka", "Sri Lanka" : ["Everest (India 1830)", -97, 787, 86] }, "Kerguelen Island 1949" : { "_DefaultRegionName" : "Kerguelen Island", "Kerguelen Island" : ["International 1924", 145, -187, 103] }, "Kertau 1948" : { "_DefaultRegionName" : "West Malaysia & Singapore", "West Malaysia & Singapore" : ["Everest (Malay. & Sing)", -11, 851, 5] }, "Kusaie Astro 1951" : { "_DefaultRegionName" : "Caroline Islands", "Caroline Islands" : ["International 1924", 647, 1777, -1124] }, "Korean Geodetic System" : { "_DefaultRegionName" : "South Korea", "South Korea" : ["GRS 80", 0, 0, 0] }, "L. C. 5 Astro 1961" : { "_DefaultRegionName" : "Cayman Brac Island", "Cayman Brac Island" : ["Clarke 1866", 42, 124, 147] }, "Leigon" : { "_DefaultRegionName" : "Ghana", "Ghana" : ["Clarke 1880", -130, 29, 364] }, "Liberia 1964" : { "_DefaultRegionName" : "Liberia", "Liberia" : ["Clarke 1880", -90, 40, 88] }, "Luzon" : { "_DefaultRegionName" : "Philippines (Excluding Mindanao)", "Philippines (Excluding Mindanao)" : ["Clarke 1866", -133, -77, -51], "Philippines (Mindanao)" : ["Clarke 1866", -133, -79, -72] }, "M_Poraloko" : { "_DefaultRegionName" : "Gabon", "Gabon" : ["Clarke 1880", -74, -130, 42] }, "Mahe 1971" : { "_DefaultRegionName" : "Mahe Island", "Mahe Island" : ["Clarke 1880", 41, -220, -134] }, "Massawa" : { "_DefaultRegionName" : "Ethiopia (Eritrea)", "Ethiopia (Eritrea)" : ["Bessel 1841", 639, 405, 60] }, "Merchich" : { "_DefaultRegionName" : "Morocco", "Morocco" : ["Clarke 1880", 31, 146, 47] }, "Midway Astro 1961" : { "_DefaultRegionName" : "Midway Islands", "Midway Islands" : ["International 1924", 912, -58, 1227] }, "Minna" : { "_DefaultRegionName" : "Cameroon", "Cameroon" : ["Clarke 1880", -81, -84, 115], "Nigeria" : ["Clarke 1880", -92, -93, 122] }, "Montserrat Island Astro 1958" : { "_DefaultRegionName" : "Montserrat (Leeward Islands)", "Montserrat (Leeward Islands)" : ["Clarke 1880", 174, 359, 365] }, "Nahrwan" : { "_DefaultRegionName" : "Oman (Masirah Island)", "Oman (Masirah Island)" : ["Clarke 1880", -247, -148, 369], "Saudi Arabia" : ["Clarke 1880", -243, -192, 477], "United Arab Emirates" : ["Clarke 1880", -249, -156, 381] }, "Naparima BWI" : { "_DefaultRegionName" : "Trinidad & Tobago", "Trinidad & Tobago" : ["International 1924", -10, 375, 165] }, "North American 1927" : { "_DefaultRegionName" : "Alaska (Excluding Aleutian Ids)", "Alaska (Excluding Aleutian Ids)" : ["Clarke 1866", -5, 135, 172], "Alaska (Aleutian Ids East of 180?W)" : ["Clarke 1866", -2, 152, 149], "Alaska (Aleutian Ids West of 180?W)" : ["Clarke 1866", 2, 204, 105], "Bahamas (Except San Salvador Id)" : ["Clarke 1866", -4, 154, 178], "Bahamas (San Salvador Island)" : ["Clarke 1866", 1, 140, 165], "Canada (Alberta; British Columbia)" : ["Clarke 1866", -7, 162, 188], "Canada (Manitoba; Ontario)" : ["Clarke 1866", -9, 157, 184], "Canada (New Brunswick; Newfoundland; Nova Scotia; Quebec)" : ["Clarke 1866", -22, 160, 190], "Canada (Northwest Territories; Saskatchewan)" : ["Clarke 1866", 4, 159, 188], "Canada (Yukon)" : ["Clarke 1866", -7, 139, 181], "Canal Zone" : ["Clarke 1866", 0, 125, 201], "Cuba" : ["Clarke 1866", -9, 152, 178], "Greenland (Hayes Peninsula)" : ["Clarke 1866", 11, 114, 195], "MEAN FOR Antigua; Barbados; Barbuda; Caicos Islands; Cuba; Dominican Republic; Grand Cayman; Jamaica; Turks Islands" : ["Clarke 1866", -3, 142, 183], "MEAN FOR Belize; Costa Rica; El Salvador; Guatemala; Honduras; Nicaragua" : ["Clarke 1866", 0, 125, 194], "MEAN FOR Canada" : ["Clarke 1866", -10, 158, 187], "MEAN FOR CONUS" : ["Clarke 1866", -8, 160, 176], "MEAN FOR CONUS (East of Mississippi; River Including Louisiana; Missouri; Minnesota)" : ["Clarke 1866", -9, 161, 179], "MEAN FOR CONUS (West of Mississippi; River Excluding Louisiana; Minnesota; Missouri)" : ["Clarke 1866", -8, 159, 175], "Mexico" : ["Clarke 1866", -12, 130, 190] }, "North American 1983" : { "_DefaultRegionName" : "Alaska (Excluding Aleutian Ids)", "Alaska (Excluding Aleutian Ids)" : ["GRS 80", 0, 0, 0], "Aleutian Ids" : ["GRS 80", -2, 0, 4], "Canada" : ["GRS 80", 0, 0, 0], "CONUS" : ["GRS 80", 0, 0, 0], "Hawaii" : ["GRS 80", 1, 1, -1], "Mexico; Central America" : ["GRS 80", 0, 0, 0] }, "North Sahara 1959" : { "_DefaultRegionName" : "Algeria", "Algeria" : ["Clarke 1880", -186, -93, 310] }, "Observatorio Meteorologico 1939" : { "_DefaultRegionName" : "Azores (Corvo & Flores Islands)", "Azores (Corvo & Flores Islands)" : ["International 1924", -425, -169, 81] }, "Old Egyptian 1907" : { "_DefaultRegionName" : "Egypt", "Egypt" : ["Helmert 1906", -130, 110, -13] }, "Old Hawaiian" : { "_DefaultRegionName" : "Hawaii", "Hawaii" : ["Clarke 1866", 89, -279, -183], "Kauai" : ["Clarke 1866", 45, -290, -172], "Maui" : ["Clarke 1866", 65, -290, -190], "MEAN FOR Hawaii; Kauai; Maui; Oahu" : ["Clarke 1866", 61, -285, -181], "Oahu" : ["Clarke 1866", 58, -283, -182] }, "Oman" : { "_DefaultRegionName" : "Oman", "Oman" : ["Clarke 1880", -346, -1, 224] }, "Ordnance Survey Great Britain 1936" : { "_DefaultRegionName" : "England", "England" : ["Airy 1830", 371, -112, 434], "England; Isle of Man; Wales" : ["Airy 1830", 371, -111, 434], "MEAN FOR England; Isle of Man; Scotland; Shetland Islands; Wales" : ["Airy 1830", 375, -111, 431], "Scotland; Shetland Islands" : ["Airy 1830", 384, -111, 425], "Wales" : ["Airy 1830", 370, -108, 434] }, "Pico de las Nieves" : { "_DefaultRegionName" : "Canary Islands", "Canary Islands" : ["International 1924", -307, -92, 127] }, "Pitcairn Astro 1967" : { "_DefaultRegionName" : "Pitcairn Island", "Pitcairn Island" : ["International 1924", 185, 165, 42] }, "Point 58" : { "_DefaultRegionName" : "MEAN FOR Burkina Faso & Niger", "MEAN FOR Burkina Faso & Niger" : ["Clarke 1880", -106, -129, 165] }, "Pointe Noire 1948" : { "_DefaultRegionName" : "Congo", "Congo" : ["Clarke 1880", -148, 51, -291] }, "Porto Santo 1936" : { "_DefaultRegionName" : "Porto Santo; Madeira Islands", "Porto Santo; Madeira Islands" : ["International 1924", -499, -249, 314] }, "Provisional South American 1956" : { "_DefaultRegionName" : "Bolivia", "Bolivia" : ["International 1924", -270, 188, -388], "Chile (Northern; Near 19?S)" : ["International 1924", -270, 183, -390], "Chile (Southern; Near 43?S)" : ["International 1924", -305, 243, -442], "Colombia" : ["International 1924", -282, 169, -371], "Ecuador" : ["International 1924", -278, 171, -367], "Guyana" : ["International 1924", -298, 159, -369], "MEAN FOR Bolivia; Chile; Colombia; Ecuador; Guyana; Peru; Venezuela" : ["International 1924", -288, 175, -376], "Peru" : ["International 1924", -279, 175, -379], "Venezuela" : ["International 1924", -295, 173, -371] }, "Provisional South Chilean 1963" : { "_DefaultRegionName" : "Chile (Near 53?S) (Hito XVIII)", "Chile (Near 53?S) (Hito XVIII)" : ["International 1924", 16, 196, 93] }, "Puerto Rico" : { "_DefaultRegionName" : "Puerto Rico; Virgin Islands", "Puerto Rico; Virgin Islands" : ["Clarke 1866", 11, 72, -101] }, "Pulkovo 1942" : { "_DefaultRegionName" : "Russia", "Russia" : ["Krassovsky 1940", 28, -130, -95] }, "Qatar National" : { "_DefaultRegionName" : "Qatar", "Qatar" : ["International 1924", -128, -283, 22] }, "Qornoq" : { "_DefaultRegionName" : "Greenland (South)", "Greenland (South)" : ["International 1924", 164, 138, -189] }, "Reunion" : { "_DefaultRegionName" : "Mascarene Islands", "Mascarene Islands" : ["International 1924", 94, -948, -1262] }, "Rome 1940" : { "_DefaultRegionName" : "Italy (Sardinia)", "Italy (Sardinia)" : ["International 1924", -225, -65, 9] }, "S-42 (Pulkovo 1942)" : { "_DefaultRegionName" : "Hungary", "Hungary" : ["Krassovsky 1940", 28, -121, -77], "Poland" : ["Krassovsky 1940", 23, -124, -82], "Czechoslavakia" : ["Krassovsky 1940", 26, -121, -78], "Latvia" : ["Krassovsky 1940", 24, -124, -82], "Kazakhstan" : ["Krassovsky 1940", 15, -130, -84], "Albania" : ["Krassovsky 1940", 24, -130, -92], "Romania" : ["Krassovsky 1940", 28, -121, -77] }, "S-JTSK" : { "_DefaultRegionName" : "Czechoslavakia (Prior 1 JAN 1993)", "Czechoslavakia (Prior 1 JAN 1993)" : ["Bessel 1841", 589, 76, 480] }, "Santo (DOS) 1965" : { "_DefaultRegionName" : "Espirito Santo Island", "Espirito Santo Island" : ["International 1924", 170, 42, 84] }, "Sao Braz" : { "_DefaultRegionName" : "Azores (Sao Miguel; Santa Maria Ids)", "Azores (Sao Miguel; Santa Maria Ids)" : ["International 1924", -203, 141, 53] }, "Sapper Hill 1943" : { "_DefaultRegionName" : "East Falkland Island", "East Falkland Island" : ["International 1924", -355, 21, 72] }, "Schwarzeck" : { "_DefaultRegionName" : "Namibia", "Namibia" : ["Bessel 1841 (Namibia)", 616, 97, -251] }, "Selvagem Grande 1938" : { "_DefaultRegionName" : "Salvage Islands", "Salvage Islands" : ["International 1924", -289, -124, 60] }, "Sierra Leone 1960" : { "_DefaultRegionName" : "Sierra Leone", "Sierra Leone" : ["Clarke 1880", -88, 4, 101] }, "South American 1969" : { "_DefaultRegionName" : "Argentina", "Argentina" : ["South American 1969", -62, -1, -37], "Bolivia" : ["South American 1969", -61, 2, -48], "Brazil" : ["South American 1969", -60, -2, -41], "Chile" : ["South American 1969", -75, -1, -44], "Colombia" : ["South American 1969", -44, 6, -36], "Ecuador" : ["South American 1969", -48, 3, -44], "Ecuador (Baltra; Galapagos)" : ["South American 1969", -47, 26, -42], "Guyana" : ["South American 1969", -53, 3, -47], "MEAN FOR Argentina; Bolivia; Brazil; Chile; Colombia; Ecuador; Guyana; Paraguay; Peru; Trinidad & Tobago; Venezuela" : ["South American 1969", -57, 1, -41], "Paraguay" : ["South American 1969", -61, 2, -33], "Peru" : ["South American 1969", -58, 0, -44], "Trinidad & Tobago" : ["South American 1969", -45, 12, -33], "Venezuela" : ["South American 1969", -45, 8, -33] }, "South Asia" : { "_DefaultRegionName" : "Singapore", "Singapore" : ["Modified Fischer 1960", 7, -10, -26] }, "Tananarive Observatory 1925" : { "_DefaultRegionName" : "Madagascar", "Madagascar" : ["International 1924", -189, -242, -91] }, "Timbalai 1948" : { "_DefaultRegionName" : "Brunei; E. Malaysia (Sabah Sarawak)", "Brunei; E. Malaysia (Sabah Sarawak)" : ["Everest (Sabah Sarawak)", -679, 669, -48] }, "Tokyo" : { "_DefaultRegionName" : "Japan", "Japan" : ["Bessel 1841", -148, 507, 685], "MEAN FOR Japan; South Korea; Okinawa" : ["Bessel 1841", -148, 507, 685], "Okinawa" : ["Bessel 1841", -158, 507, 676], "South Korea" : ["Bessel 1841", -147, 506, 687] }, "Tristan Astro 1968" : { "_DefaultRegionName" : "Tristan da Cunha", "Tristan da Cunha" : ["International 1924", -632, 438, -609] }, "Viti Levu 1916" : { "_DefaultRegionName" : "Fiji (Viti Levu Island)", "Fiji (Viti Levu Island)" : ["Clarke 1880", 51, 391, -36] }, "Voirol 1960" : { "_DefaultRegionName" : "Algeria", "Algeria" : ["Clarke 1880", -123, -206, 219] }, "Wake Island Astro 1952" : { "_DefaultRegionName" : "Wake Atoll", "Wake Atoll" : ["International 1924", 276, -57, 149] }, "Wake-Eniwetok 1960" : { "_DefaultRegionName" : "Marshall Islands", "Marshall Islands" : ["Hough 1960", 102, 52, -38] }, "WGS 1972" : { "_DefaultRegionName" : "Global Definition", "Global Definition" : ["WGS 72", 0, 0, 0] }, "WGS 1984" : { "_DefaultRegionName" : "Global Definition", "Global Definition" : ["WGS 84", 0, 0, 0] }, "Yacare" : { "_DefaultRegionName" : "Uruguay", "Uruguay" : ["International 1924", -155, 171, 37] }, "Zanderij" : { "_DefaultRegionName" : "Suriname", "Suriname" : ["International 1924", -265, 120, -358] } }; // END: constnats // //////////////////////////////////////////// // //////////////////////////////////////////// // BEGIN: frequentrly used datum net.mizba.geo.Datum.WGS84 = new net.mizba.geo.Datum("WGS 1984"); net.mizba.geo.Datum.TOKYO = new net.mizba.geo.Datum("Tokyo"); // END: frequentrly used datum // //////////////////////////////////////////// // // Maps Redirector. // // (C) 2020 Seesaa Inc. // (function (){ function tokyo2wgs ( lat, lon ) { var point = net.mizba.geo.Datum.TOKYO.createGeoPoint(lat, lon); return net.mizba.geo.Datum.WGS84.transform(point); } function renderYMapJavascript (args) { var div = document.getElementById(args.id); var finished = "data-rendered"; if (div && !div.getAttribute(finished)) { div.setAttribute(finished, true); div.style.width = args.width; div.style.height = args.height; div.style.padding = "10px"; div.style.border = 'solid 1px'; /* ここに地図が表示されます。を除去 */ if (div.firstChild) { div.removeChild(div.firstChild); } /* 文字列は UTF-16でないといけない(過去の呼び出し方まで調査できないので) escape("...") をブラウザのdevtoolsで突っ込んで、 "s/%/\\/g" */ var T = function(s) { return document.createTextNode(s) }; var wgs = tokyo2wgs(args.lat, args.lon); var zoom = 21 - args.layer; var link = document.createElement("a"); link.setAttribute("href", `https://www.openstreetmap.org/#map=${zoom}/${wgs.lat}/${wgs.lon}`); link.setAttribute("target", "blank"); link.appendChild(T("\u30EA\u30F3\u30AF")); /* リンク */ div.appendChild(T("API\u63D0\u4F9B\u5143\u306E\u30B5\u30FC\u30D3\u30B9\u7D42\u4E86\u306B\u3088\u308A\u5730\u56F3\u306F\u8868\u793A\u3067\u304D\u307E\u305B\u3093\u3002")); /* API提供元のサービス終了により地図は表示できません。 */ div.appendChild(document.createElement("br")); div.appendChild(T("\u3053\u3061\u3089\u306E")); /* こちらの */ div.appendChild(link); div.appendChild(T("\u304B\u3089OpenStreetMap\u3067\u306E\u8868\u793A\u304C\u3067\u304D\u307E\u3059\u3002")); /* からOpenStreetMapでの表示ができます。 */ div.appendChild(document.createElement("br")); div.appendChild(T("\u306A\u304A\u30EA\u30F3\u30AF\u5148\u8868\u793A\u5185\u5BB9\u306E\u6B63\u78BA\u6027\u306F\u4FDD\u969C\u3044\u305F\u3057\u304B\u306D\u307E\u3059\u306E\u3067\u4E88\u3081\u3054\u4E86\u627F\u304F\u3060\u3055\u3044\u3002")); /* なおリンク先表示内容の正確性は保障いたしかねますので予めご了承ください。 */ } } var ss1 = document.getElementsByTagName("script"); var ss2 = new Array(); for (var i = 0; i < ss1.length; i++) { var s = ss1[i]; if (s.src && s.src.match(/yahoo_maps\.js(\?.*)?$/)) ss2.push(s); } var pl = /\+/g; var search = /([^&=]+)=?([^&]*)/g; var decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }; for (var i = 0; i < ss2.length; i++) { var s = ss2[i]; var conf = s.src.split('?'); if (conf[1]) { var query = conf[1]; var param = {}; while (match = search.exec(query)) { param[decode(match[1])] = decode(match[2]); } param.lat = parseFloat(param.lat); param.lon = parseFloat(param.lon); } else { if (window.YMapConfig) { param = window.YMapConfig; } } if (typeof param == 'object') { window.addEventListener('DOMContentLoaded', function () { renderYMapJavascript(param); }); } } })();