トップ 一覧 検索 ヘルプ RSS ログイン

PY-quakefeedsの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!! USGS の地震をマッピングする

! モジュールのインストール
 pip3 install quakefeeds

https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php

を使ったものらしい

!sample

 #! /usr/bin/env python3
 # -*- coding: utf-8
 
 from quakefeeds import QuakeFeed
 # データの呼び出 M4.5 以上
 feed = QuakeFeed("4.5", "day")
 # "M4.5" は "M2.5", "M1.0" 以外は NG
 ## feed = QuakeFeed("4.5", "week")
 # feed = QuakeFeed("4.5", "month")
 print ( feed.title )
 
 print ( feed.title )
 print ( feed.time )
 
 # 個数の表示
 print ( len(feed) )
 
 # とりあえず 0 だけ表示
 print ( feed[0] )
 print ( feed.location(0) ) 
 print ( feed.event_title(0) )
 print ( feed.depth(0) )
 
 print ( feed.depths )
 
 print (  list(feed.depths) )
 
 # Google MAP の書式で出せるらしい
 map1 = feed.create_google_map()
 print ( map1 )
 map2 = feed.create_google_map(style="titled")
 print ( map2 )
  
 # ファイルもかける。。
 # Write google map 
 # feed.write_google_map("map.html", style="titled")