 ## Library

We release the latest version of sets of functions 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@fttsus.org and distributed from Research Institute for World Grid Squares riwgs@fttsus.org. 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-2021, All Right Reserved.

R (Version 1.7 : Released on 19 June 2021)

http://www.fttsus.jp/worldmesh/R/worldmesh.R

Javascript (Version 1.6 : Released on 09 October 2020)

http://www.fttsus.jp/worldmesh/js/worldmesh.js

PHP (Version 1.7 : Released on 10 October 2021)

http://www.fttsus.jp/worldmesh/php/worldmesh.phps

Python (Version 1.7 : Released on 20 June 2021)

http://www.fttsus.jp/worldmesh/python/worldmesh.py

Java (Version 1.6 : Released on 15 October 2020)

http://www.fttsus.jp/worldmesh/java/worldmesh.java

### List of Functions

• meshcode_to_latlong(meshcode,  extension = F): calculate north-western geographic position of the grid (latitude, longitude) from meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• meshcode_to_latlong_NW(meshcode, extension = F): calculate north-western geographic position of the grid (latitude, longitude) from meshcode. When you use extended grid square code (ex100m_12, ex100m_13, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• meshcode_to_latlong_SW(meshcode, extension = F): 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, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• meshcode_to_latlong_NE(meshcode, extension = F): 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, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• meshcode_to_latlong_SE(meshcode, extension = F): 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, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• meshcode_to_latlong_grid(meshcode, extension = F): 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, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• 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_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(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_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): 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, ex10m_14, and ex1m_16), you need to set extension = T, otherwise extension = F (default).
• 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-2021 Research Institute for World Grid Squares