teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

エラーの出る前までの全文を載せました。

2020/10/07 10:03

投稿

proprost
proprost

スコア0

title CHANGED
File without changes
body CHANGED
@@ -17,11 +17,90 @@
17
17
  上記のコードに対して以下のメッセージでした。
18
18
  SyntaxError:invalid character in identifier
19
19
 
20
+ 追記です。10/7 18:58
21
+ エラーが出る最後の行まで全文を載せます。これでわかるでしょうか。
20
22
 
23
+ min_lat =35.357416
24
+ min_lon =138.724022
25
+ max_lat =35.369735
26
+ max_lon =138.737926
27
+
28
+ # AVNIR-2のURL\n",
29
+ url_AVNIR2 = 'https://gisapi.tellusxdp.com/api/v1/av2ori/scene'
30
+ # LandsatのURL\n",
31
+ url_Landsat8 = 'https://gisapi.tellusxdp.com/api/v1/landsat8/scene'
32
+ headers = { 'Authorization': 'Bearer ' + API_TOKEN }
33
+ # パラメータ(緯度、経度の最大値、最小値)を指定\n",
34
+ parameter = { 'min_lat': min_lat, 'min_lon': min_lon,
35
+ 'max_lat': max_lat, 'max_lon': max_lon }
36
+
37
+ # AVNIR-2の検索\n",
38
+ r_AVNIR2 = requests.get(url_AVNIR2,
39
+ params=parameter,
40
+ headers=headers)
41
+
42
+ # Landsat-8の検索\n",
43
+ r_Landsat8 = requests.get(url_Landsat8,
44
+ params=parameter,
45
+ headers=headers)
46
+
47
+ # AVNIR-2の検索結果を表示\n",
48
+ print("AVNIR-2のリスト [撮影日時、rspId、productId]")
49
+ for res in r_AVNIR2.json():
50
+ print(",".join([res['acquisitionDate'],
51
+ res['rspId'], res["productId"]]))
52
+
53
+ # Landsat-8の検索結果を表示\n",
54
+ print("Landsat-8のリスト [撮影日時、path、row、productId]")
55
+ for res in r_Landsat8.json():
56
+ print(", ".join([res['acquisitionDate'],
57
+ str(res["path"]), str(res["row"]),res["productId"]]))
58
+
59
+ # 選択したAVNIR-2衛星画像の productId、rspIdを格納\n",
60
+ AVNIR2_rspId = 'D070P3'
61
+ AVNIR2_productId = 'ALAV2A097002890'
62
+
63
+ # 選択したLandsat-8衛星画像の productId、path、rowを格納\n",
64
+ Landsat8_path = '108'
65
+ Landsat8_row = '35'
66
+ Landsat8_productId = 'LC08_L1TP_108035_20181125_20181210_01_T1'
67
+
68
+ # 緯度経度をタイル座標に変換する関数を定義\n",
69
+ def LatLon2Tile(lat,lon, z):
70
+ L= 85.05112878
71
+ tileX = int( (2**(z+7)) * ((lon/180) + 1) )
72
+
73
+ tileY = int( (2**(z+7)/math.pi) *
74
+ (-1 * np.arctanh(math.sin(lat * math.pi/180)) +
75
+ np.arctanh(math.sin(L * math.pi/180))) )
76
+
77
+ return int(tileX/256), int(tileY/256)
78
+
79
+ # 今回の指定エリアの中心座標(緯度、経度)\n",
80
+ center_lat = ( min_lat + max_lat ) / 2
81
+ center_lon = ( min_lon + max_lon ) / 2
82
+
83
+ # 今回はズームレベル zを 12とします。\n",
84
+ z = 12
85
+ # タイル座標を取得\n",
86
+ x, y = LatLon2Tile(center_lat,center_lon, z)
87
+ print("タイル座標(%d, %d, %d)" % (x, y, z))
88
+
89
+ # AVNIR-2のURL\n",
90
+ url_AVNIR2 = 'https://gisapi.tellusxdp.com/blend/av2ori/'
91
+ # Landsat-8のURL
92
+ url_Landsat8 = 'https://gisapi.tellusxdp.com/blend/landsat8/'
93
+ # ヘッダ\n",
94
+ headers={"Authorization": "Bearer " + API_TOKEN }
95
+
96
+ # AVNIR-2のバンド割り当て(赤:バンド3、緑:バンド2、青:バンド1)\n",
97
+ query_AVNIR2 = __”r=3&g=2&b=1”__
98
+
99
+
21
100
  ```ここに言語名を入力
22
101
  python3
23
102
 
24
- ### 試したこと
103
+ ### 試したこと__イタリックテキスト__
25
104
 
26
105
   ここで、"r=3&g=2&b=1"を ’r=3&g=2&b=1'
27
106
  としたところ、プログラムとしては動きだした。