Table of Contents
The EMTools consists of several programs useful for geosciences.
Python code to create a KMZ file to plot colored circle icons in Google Earth by using the lists of longitudes, latitudes and values.
- Python 3.9.15
- matplotlib 3.6.3
- numpy 1.23.5
- pillow 9.4.0
Just import MakeKMZ
and call the make_kmz
function.
import makeKMZ
makeKMZ.make_kmz(kmzname, lon, lat, values, list_label)
where parameters are
kmzname (str): Name of the output KMZ file.
lon ([float]): Array of longitudes.
lat ([float]): Array of latitudes.
values ([float]): Array of values used for the color scale.
list_label ([str]): List of labels of icons.
See example/earthquakes.py
, which creates a map of the 20 largest earthquakes listed on the USGS website.
The screenshot of the output kmz file opened in Google Earth is
Python code to download tile images of GSI Maps. Downloaded image can be used to plot the map by GMT (PyGMT) as the background.
- Python 3.9.16
- numpy 1.23.3
- pillow 9.3.0
- pygmt 0.8.0 (to run the example code)
Just import getGSIMaps
and call the create_image
function.
import getGSIMaps
getGSIMaps.create_image(out_image_name, lon1, lat1, lon2, lat2, zoom = None, map_type = 'std'):
where parameters are
out_image_name (str): Output image name
lon1 (float): Longitude of the bottom left corner of the region
lat1 (float): Latitude of the bottom left corner of the region
lon2 (float): Longitude of the top right corner of the region
lat2 (float): Latitude of the top right corner of the region
zoom (int, optional): Zoom level of the tile. 1:global to 18:local. Defaults to None.
map_type (str, optional): Tile ID of the map type. 'std', 'pale', 'english', 'seamlessphoto', and etc. (See https://maps.gsi.go.jp/development/ichiran.html). Defaults to 'std'.
See example/plotGSIMaps.py
, which plot a map of Shimabara Penuinsula by PyGMT with the satellite image as the background.
The output image of this demo is
Distributed under the MIT License. See LICENSE
for more information.
Kentaro Emoto - emoto.kentaro.430@m.kyushu-u.ac.jp
Project Link: https://github.com/KentaroEmoto/EMTools