## Library

We release the latest version of sets of functions (library) for calculating world grid square codes (compatible extension to JIS X0410) in various programming languages.

If you use these libraries, you must declare that you include the library developed by Prof. Dr. Aki-Hiro Sato akihiro(at)fttsus.org and distributed from Research Institute for World Grid Squares riwgs(at)fttsus.org and that these libraries have been developed under the R&D project JST PRESTO (JPMJPR1504) and the R&D project JST MIRAI (JPMJMI20B6) funded by the Japan Science and Technology Agency (JST). This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(c) Research Institute for World Grid Squares, 2015-2022, All Right Reserved.

R (Version 1.81 : Released on 12 December 2022)

https://www.fttsus.org/worldmesh/R/worldmesh.R

source("https://www.fttsus.org/worldmesh/R/worldmesh.R")

JavaScript (Version 1.75 : Released on 13 April 2022)

https://www.fttsus.org/worldmesh/js/worldmesh.js

<script src="https://www.fttsus.jp/worldmesh/js/worldmesh.js"></script>

PHP (Version 1.75 : Released on 13 April 2022)

include_once("worldmesh.php");

Python (Version 1.8 : Released on 12 December 2022)

https://www.fttsus.org/worldmesh/python/worldmesh.py

import httpimport
url='https://www.fttsus.org/worldmesh/python/worldmesh.py'
with httpimport.remote_repo(["worldmesh"],url):
import worldmesh

Java (Version 1.65 : Released on 13 April 2022)

https://www.fttsus.org/worldmesh/java/worldmesh.java

### List of Functions

• meshcode_to_latlong(meshcode,  extension = F, spec=””): calculate north-western geographic position of the grid (latitude, longitude) from meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• meshcode_to_latlong_NW(meshcode, extension = F, spec=””): calculate north-western geographic position of the grid (latitude, longitude) from meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• meshcode_to_latlong_SW(meshcode, extension = F, spec=””): calculate the geographic position (latitude, longitude) at the south-western corner of the grid with meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• meshcode_to_latlong_NE(meshcode, extension = F, spec=””): calculate the geographic position (latitude, longitude) at the north-eastern corner of the grid with meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• meshcode_to_latlong_SE(meshcode, extension = F, spec=””): calculate the geographic position (latitude, longitude) at the south-eastern corner of the grid with meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• meshcode_to_latlong_grid(meshcode, extension = F, spec=””): calculate the geographic positions (latitude0, longitude0, latitude1, longitude1) at the north-western and south-eastern corner of the grid with meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• cal_meshcode(latitude,longitude): calculate a basic (third-level) grid square code (10 digits) from a geographical position (latitude, longitude)
• cal_meshcode1(latitude,longitude): calculate a first-level grid square code (6 digits) from a geographical position (latitude, longitude)
• cal_meshcode2(latitude,longitude): calculate a second-level grid square code (8 digits) from a geographical position (latitude, longitude)
• cal_meshcode3(latitude,longitude): calculate a third-level grid square code (10 digits) from a geographical position (latitude, longitude)
• cal_meshcode4(latitude,longitude): calculate a fourth-level grid square code (11 digits) from a geographical position (latitude, longitude)
• cal_meshcode5(latitude,longitude): calculate a fifth-level grid square code (12 digits) from a geographical position (latitude, longitude)
• cal_meshcode6(latitude,longitude): calculate a sixth-level grid square code (13 digits) from a geographical position (latitude, longitude)
• cal_meshcode_ex100m_12(latitude,longitude): calculate an extended 100m (1km / 10) grid square code (12 digits) from a geographical position (latitude, longitude). The grid size is 3 arc-second for latitude and 4.5 arc-second for longitude.
• cal_meshcode_ex100m_13(latitude,longitude): : calculate an extended 100m (500m / 5) grid square code (13 digits) from a geographical position (latitude, longitude) – 3 arc-second for latitude and 4.5 arc-second for longitude.
• cal_meshcode_ex50m_13(latitude,longitude): calculate an extended 50m (100m / 2) grid square code (13 digits) from a geographical position (latitude, longitude) – 1.5 arc-second for latitude and 2.25 arc-second for longitude.
• cal_meshcode_ex50m_14(latitude,longitude): calculate an extended 50m (100m / 2) grid square code (14 digits) from a geographical position (latitude, longitude). The grid size is 1.5 arc-second for latitude and 2.25 arc-second for longitude.
• cal_meshcode_ex10m_14(latitude,longitude): calculate an extended 10m (100m / 10) grid square code (14 digits) from a geographical position (latitude, longitude). The grid size is 0.3 arc-second for latitude and 0.45 arc-second for longitude.
• cal_meshcode_ex1m_16(latitude,longitude): calculate an extended 1m (10m / 10) grid square code (16 digits) from a geographical position (latitude, longitude). The grid size is 0.03 arc-second for latitude and 0.045 arc-second for longitude.
• Vincenty(latitude1, longitude1, latitude2, longitude2): calculate geodesic distance between two point indicated by (I>latitude1, longitude1) and (latitude2, longitude2) based on WGS84 by using the Vincenty formula (1975)
• cal_area_from_meshcode(meshcode, extension=F, spec=””): calculate a size (northern west-to-east span H1, southern west-to-east span H2, north-to-south span W, and a trapezoidal approximation area A) of world grid square indicated by world grid square code meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex50m_13, ex50m_14, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default). Specifically, if you want to use ex100m_13 and ex50m_14, you need to set the spec option as “ex100m_13” and “ex50m_14”, respectively.
• cal_area_from_latlong(latlong): calculate a size (northern west-to-east span H1, southern west-to-east span H2, north-to-south span W, and a trapezoidal approximation area A) of a trapezoidal area indicated by latlong

(c) 2015-2022 Research Institute for World Grid Squares