示例#1
0
 def test_dms8(self):
     #3桁区切り 南緯西経表示
     #南極点
     string = '<text xml:space="preserve">{{Coord|90|S|0|W|display=title}}'
     ans = (-90, 0)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#2
0
 def test_dms7(self):
     #3桁区切り 西経表示
     #サンフランシスコ国際空港 airport
     string = "| coordinates  = {{Coord|37|37|08|N|122|22|30|W|region:US-CA_type:airport|display=inline,title}}"
     ans = (37.618889, -122.375)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#3
0
 def test_dms8(self):
     #3桁区切り 南緯西経表示
     #南極点
     string = '<text xml:space="preserve">{{Coord|90|S|0|W|display=title}}'
     ans = (-90, 0)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#4
0
 def test_dms3(self):
     #3桁区切り
     #欧州中央銀行
     string = "|coordinates = {{Coord|50|6|34|N|8|40|26|E|display=inline,title}}"
     ans = (50.109444, 8.673889)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#5
0
 def test_dms5(self):
     #3桁区切り 3桁目空白
     #蒲郡市 city
     string = "{{Coord|34|50||N|137|13||E|region:JP_type:city|display=title}}"
     ans = (34.833333, 137.216667)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#6
0
 def test_dms4(self):
     #3桁区切り3桁目小数点
     #203高地
     string = "{{Coord|38|49|43.10|N|121|11|36.30|E|display=title}}"
     ans = (38.828639, 121.193417)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#7
0
 def test_dms2(self):
     #2桁区切り
     #デルポイ landmark
     string = "{{Coord|38|29|N|22|30|E|type:landmark_region:GR|display=title}}"
     ans = (38.483333, 22.5)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#8
0
 def test_dms6(self):
     #3桁区切り 南緯表示
     #サボ島
     string = "{{Coord|09|08|00|S|159|49|00|E|display=title}}"
     ans = (-9.133333, 159.816667)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#9
0
 def test_dms6(self):
     #3桁区切り 南緯表示
     #サボ島
     string = "{{Coord|09|08|00|S|159|49|00|E|display=title}}"
     ans = (-9.133333, 159.816667)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#10
0
 def test_dms7(self):
     #3桁区切り 西経表示
     #サンフランシスコ国際空港 airport 
     string = "| coordinates  = {{Coord|37|37|08|N|122|22|30|W|region:US-CA_type:airport|display=inline,title}}"
     ans = (37.618889, -122.375)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#11
0
 def test_dms5(self):
     #3桁区切り 3桁目空白
     #蒲郡市 city
     string = "{{Coord|34|50||N|137|13||E|region:JP_type:city|display=title}}"
     ans = (34.833333, 137.216667)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#12
0
 def test_dms4(self):
     #3桁区切り3桁目小数点
     #203高地 
     string = "{{Coord|38|49|43.10|N|121|11|36.30|E|display=title}}"
     ans = (38.828639, 121.193417)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#13
0
 def test_dms3(self):
     #3桁区切り
     #欧州中央銀行
     string = "|coordinates = {{Coord|50|6|34|N|8|40|26|E|display=inline,title}}"
     ans = (50.109444, 8.673889)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#14
0
 def test_dms2(self):
     #2桁区切り
     #デルポイ landmark
     string = "{{Coord|38|29|N|22|30|E|type:landmark_region:GR|display=title}}"
     ans = (38.483333, 22.5)
     latlng = map(lambda x: round(x, 6), coordinate.get_coord(string))
     self.assertEqual(ans, tuple(latlng))
示例#15
0
 def test_dms1(self):
     #1桁区切り
     #黒海 waterbody
     string = "{{Coord|44|N|35|E|type:waterbody_scale:8000000 |display=title}}"
     ans = (44, 35)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#16
0
 def test_deg4(self):
     #小数点 NE区切り
     #ノートルダム大聖堂 (パリ) landmark
     string = "{{Coord|48.8530|N|2.3498|E|type:landmark_region:FR|display=title}}"
     ans = (48.8530, 2.3498)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#17
0
 def test_deg3(self):
     #小数点 スペースを含む
     #築地
     string = "{{Coord|35.66819| 139.77390|format=dms|display=title}}"
     ans = (35.66819, 139.7739)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#18
0
 def test_deg2(self):
     #小数点マイナス(西系表示)
     #真珠湾
     string = "{{Coord|21.359255|-157.951813|format=dms|display=title}}"
     ans = (21.359255, -157.951813)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#19
0
 def test_deg4(self):
     #小数点 NE区切り
     #ノートルダム大聖堂 (パリ) landmark
     string = "{{Coord|48.8530|N|2.3498|E|type:landmark_region:FR|display=title}}"
     ans = (48.8530, 2.3498)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#20
0
 def test_dms1(self):
     #1桁区切り
     #黒海 waterbody
     string = "{{Coord|44|N|35|E|type:waterbody_scale:8000000 |display=title}}"
     ans = (44, 35)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#21
0
 def test_deg2(self):
     #小数点マイナス(西系表示)
     #真珠湾
     string = "{{Coord|21.359255|-157.951813|format=dms|display=title}}"
     ans = (21.359255, -157.951813)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#22
0
 def test_deg1(self):
     #小数点
     #総務省 landmark
     string = "{{Coord|35.675366|139.7511182|type:landmark_region:JP|display=inline,title|name=MIC}}"
     ans = (35.675366, 139.7511182)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#23
0
 def test_deg1(self):
     #小数点
     #総務省 landmark
     string = "{{Coord|35.675366|139.7511182|type:landmark_region:JP|display=inline,title|name=MIC}}"
     ans = (35.675366, 139.7511182)
     self.assertEqual(ans, coordinate.get_coord(string))
示例#24
0
 def test_deg3(self):
     #小数点 スペースを含む
     #築地
     string = "{{Coord|35.66819| 139.77390|format=dms|display=title}}"
     ans = (35.66819, 139.7739)
     self.assertEqual(ans, coordinate.get_coord(string))