pygmapsパッケージを使用してGoogleマップにデータをプロットしますか?
Python pygmapsライブラリは、Googleマップのjavascriptapiのラッパーを提供します。このライブラリを使用すると、Pythonユーザーはmatplotlibのようなインターフェイスを作成してhtmlとjavascriptを生成し、ユーザーがGoogleマップに追加したいすべての追加情報を表示できます。
必要なライブラリ
pygmapsライブラリ/パッケージのみを使用します。次のように、pipを使用してpygmapsライブラリをインストールできます。
$pip install pygmaps (windows os) $sudo pip3 install pygmaps (linux os)
-
を表示するプログラムを作成します-
長い、緯度とズームのレベルを提供することにより、pygmapsを使用して地図を作成します。
-
グリッドの開始点と終了点、およびグリッドサイズを指定して、マップ上にグリッドを設定します。
-
地図上にポイントを追加し、色を設定して表示します。
-
メートル単位の半径で地図上の点の周りに円を描きます。
-
長いポイントと遅いポイントのリストを提供して、パスを地図に描画します。
以下は、pygmapsを介してさまざまな機能を取得するための実装です。
import pygmaps
########## CONSTRUCTOR: pygmaps.maps(latitude, longitude, zoom) ##############################
# DESC:initialize a map with latitude and longitude of center point
#and map zoom level "15"
# PARAMETER1:latitude (float) latittude of map center point
# PARAMETER2:longitude (float) latittude of map center point
# PARAMETER3:zoom (int) map zoom level 0~20
# RETURN:the instant of pygmaps
#========================================================================================
mymap = pygmaps.pygmaps(17.45,78.29, 15)
########## FUNCTION: setgrids(start-Lat, end-Lat, Lat-interval, start-Lng, end-Lng, Lng-interval) ######
# DESC:set grids on map
# PARAMETER1:start-Lat (float), start (minimum) latittude of the grids
# PARAMETER2:end-Lat (float), end (maximum) latittude of the grids
# PARAMETER3:Lat-interval (float) grid size in latitude
# PARAMETER4:start-Lng (float), start (minimum) longitude of the grids
# PARAMETER5:end-Lng (float), end (maximum) longitude of the grids
# PARAMETER6:Lng-interval (float) grid size in longitude
# RETURN:no returns
#========================================================================================
mymap.setgrids(17.45, 17.46, 0.001, 78.29,78.30, 0.001)
########## FUNCTION: addpoint(latitude, longitude, [color])#############################
# DESC:add a point into a map and dispaly it, color is optional default is red
# PARAMETER1:latitude (float) latitude of the point
# PARAMETER2:longitude (float) longitude of the point
# PARAMETER3:color (string) color of the point showed in map, using HTML color code
#HTML COLOR CODE: https://www.computerhope.com/htmcolor.htm
#e.g. red "#FF0000", Blue "#0000FF", Green "#00FF00"
# RETURN:no return
#========================================================================================
mymap.addpoint(17.45,78.29, "#FF0000","Hello")
########## FUNCTION: addradpoint(latitude, longitude, radius, [color])##################
# DESC: add a point with a radius (Meter) - Draw cycle
# PARAMETER1:latitude (float) latitude of the point
# PARAMETER2:longitude (float) longitude of the point
# PARAMETER3:radius (float), radius in meter
# PARAMETER4:color (string) color of the point showed in map, using HTML color code
#HTML COLOR CODE: https://www.computerhope.com/htmcolor.htm
#e.g. red "#FF0000", Blue "#0000FF", Green "#00FF00"
# RETURN:no return
#========================================================================================
mymap.addradpoint(17.45,78.29, 150, "#0000FF")
########## FUNCTION: addpath(path,[color])##############################################
# DESC:add a path into map, the data struceture of Path is a list of points
# PARAMETER1:path (list of coordinates) e.g. [(lat1,lng1),(lat2,lng2),...]
# PARAMETER2:color (string) color of the point showed in map, using HTML color code
#HTML COLOR CODE: https://www.computerhope.com/htmcolor.htm
#e.g. red "#FF0000", Blue "#0000FF", Green "#00FF00"
# RETURN:no return
#========================================================================================
path = [(17.45,78.29),
(17.55, 78.39),
(17.65,78.49),
]
mymap.addpath(path,"#00FF00")
########## FUNCTION: draw(file)######################################################
# DESC:create the html map file (.html)
# PARAMETER1:file (string) the map path and file
# RETURN:no return, generate html file in specified directory
#========================================================================================
mymap.draw('./mymap.html')
print('OK') 注 :mymap.addpoint関数の実行中にTypeerrorが発生する可能性があります。
TypeError :addpoint()は3から4の位置引数を取りますが、5つが与えられました
これを回避するために、pygmaps.pyパッケージのaddpoint関数にtitle引数を追加しました。
出力
上記のマップからわかるように、1つのマップで複数の機能を視覚化できます。
-
Google データをダウンロードするには:Google データ エクスポートを使用しますか?
Google は、あなたが思っている以上にあなたのことを知っています。貴重なデータを保存するオンラインの場所は Facebook だけではありません。また、Google アカウントにいくつかの機密データが保存されています。検索結果と広告をターゲットにするために、Google がユーザーを追跡してデータを収集していることは、おそらくご存じでしょう。 何百万人ものユーザーの間で、データのセキュリティとプライバシーの問題に関する懸念が急増しています。 Facebook データをダウンロードする方法については既に説明しました。 ここでは、Google データ エクスポート ツールを使用してデータをダ
-
Google データ エクスポートを使用して Gmail MBOX データをダウンロードする方法
Google の Gmail は、個人的な目的と仕事上の目的の両方で、最も好まれる電子メール クライアントとして広く使用されています。 Gmail には、ドライブ、タスク、ドキュメントなどの数十の Google サポートとサービスが統合されており、ユーザーにとってメール サービスがより柔軟になっています。 ただし、メール、チャット、他のサービスへの添付ファイルなど、Gmail データをバックアップまたはエクスポートしたり、単にオフライン アクセス用に保存したりする場合があります。 Google のおかげで、ユーザーが同じことを行い、Gmail データや他の Google サービスからのデータ