Software for Engineering

Coordinates conversion tool

Coordinates Conversion Tool is a program designed to perform coordinates conversion between geodesic geographic coordinates and the Universal Transverse Mercator (UTM) projection.

The program interface has a very minimalistic interface as shown in the figure. At the top of the program should be the menu bar followed by some options to select the type of conversion. Below there is a text field to input the coordinates to convert followed by a pair of buttons and finally a text field for the results.

Windows 64 (ZIP) (EXE)macOS (DMG)Source Code

WARNING: This program is still under testing!

Installation and requirements

Features

Some technical features are:

  • This program is coded in the C++ programming language.
  • The Qt5 libraries are used for the graphical interface.
  • The program can convert both a single pair or a batch of coordinates.

The complete process of conversion coded in this program is here.

About the coordinates

Geographic coordinates are angles that represent the longitude and latitude, these coordinates can be expressed in two forms:

  • Sexagesimal notation (base 60): these coordinates are expressed in degrees (°), minutes (′) and seconds (′′). Seconds can have decimal point. The abbreviated form to this notation is DDMMSS where the DD are de degrees, MM are minutes and SS are seconds. These coordinates are sexagesimal because 60 seconds are a minute and 60 minutes are a degree. Examples:
12° 34′ 34′′
124° 45′ 34.70′′
  • Decimal notation (base 10): these coordinates are represented only as degrees (<). The fractions based on sixtieths are transformed to decimal fractions of a degree, so the minutes and seconds are represented in the decimal fraction (DD.MMSS). Examples:
23.2345°
123.696°

In some cases the coordinates will have a letter to indicate its hemisphere, in the case of latitude it could be N for Northern or S for Southern. For the longitude E and W are used for East or West from Greenwich meridian.

When the coordinates are in decimal format using a negative sign (-) is more convenient to represent coordinates at the West or Southern.

UTM coordinates are a 2D projection of the world. They represent X-Axis and Y-Axis coordinates in a plane divided by time zones. Because of that they require three elements:

  • A x-axis coordinate
  • A y-axis coordinate
  • A time zone or UTM zone

Each time zone has a central meridian as a coordinate origin. The x-axis coordinates are relative to this meridian so is important to know the time zone.

Usage

The procedure to convert coordinates from geographic (Lon Lat) format to UTM is as follows:

Converting coordinates

  1. Select the type of conversion. At the top of the program there is a section called Convert to. If you have geographic coordinates and want to convert them to UTM, then you should select the option UTM Projection. If you have UTM coordinates and want them converted to geographic, then select the option Lon Lat.
  2. Select the option Formatted as DDMMSS only if the input coordinates are in sexagesimal notation.
  3. Write the input coordinates in the appropriate format. The data should be delimited and have tree columns for UTM or two columns for Lon Lat, first column should have longitude or x-axis coordinates, the second column should have the latitude or y-axis coordinates, the third column only is necessary for the UTM zone.
    <longitude>, <latitude>

    If delimited by tab characters:


    <longitude> <TAB> <latitude>

    All the data beyond the second column will be ignored. Only the data from the first two columns will be used as input.


    In the other hand if data is in UTM projection delimited by commas (,):


    <x-axis coordinate>, <y-axis coordinate>, <UTM Zone>

    Finally, if the data is UTM delimited by tab characters:


    <x-axis coordinate> <TAB> <y-axis coordinate> <TAB> <UTM Zone>

    All the data beyond the third column will be ignored. Only the data from the first three columns will be used as input.


  4. If you have the coordinates in a text delimited file you can open it in the menu File > Open file. The file has to be formatted as described before. An example is shown in the figure.
  5. Once the input coordinates are correct the only thing to do is to click the button Convert to perform the conversion. The results should appear in the output field. You can copy or save the coordinates as desired.
  6. Other options. The program supports characters such as commas or tabs as delimiters. Also WGS84 and Hayford ellipsoids are supported. You can access to this options in the Options menu.

Examples

A few examples are given to show the use of the program:

Converting from Lon Lat to UTM

  1. The following data is an example of geographic coordinates. Note: these coordinates have a negative longitude, this means the coordinates are at West, latitude is positive so they are in Northern hemisphere.
  2. In the field Convert to, select the option UTM Projection.
  3. Put the coordinates in the input field.
    -98.89273509148279,19.48140598665632
    -98.89189222559285,19.48320155021565
    -98.89398620136308,19.48405466007059
    -98.89454050833828,19.483166896007
    -98.8943555405168,19.48309174472131
    -98.89399905383283,19.48253626284203
    -98.89336948934489,19.48172575842547
    -98.89319738470853,19.48155973869978
    -98.89295965133576,19.48145653715895
    -98.89273509148279,19.48140598665632


  4. Press the button Convert and the results should appear in the output field.
  5. You can copy or save the results as desired.

Converting from UTM to geographic coordinates

  1. The following data is a set of coordinates in UTM projection.
  2. In the field Convert to, select the option Lon Lat.
  3. You can see that the checkbox Southern is enabled, leave it unchecked to indicate that the coordinates are at Northern hemisphere.
  4. Put the coordinates in the input field.
    511256.762427	2154098.860945	14
    511345.090833 2154297.602268 14
    511125.285504 2154391.865149 14
    511067.175754 2154293.594893 14
    511086.591858 2154285.291046 14
    511124.040417 2154223.847927 14
    511190.164429 2154134.203449 14
    511208.237105 2154115.843961 14
    511233.192808 2154104.439850 14
    511256.762427 2154098.860945 14

  5. In this case the coordinates are delimited by tab characters. So go to menu Options > Delimiter > Tabs to change the default delimiter from commas to tabs.
  6. Press the button Convert to perform the conversion, the results should appear in the output field.
  7. You can copy or save the results as desired.

Converting from Lon Lat in sexagesimal format (DDMMSS) to decimal format

  1. Converting sexagesimal coordinates (represented as degrees, minutes and seconds) is a special case, because there are a lot of symbols that people can use to represent degrees, minutes and seconds. Considering that, this program only works with these data delimited by blank spaces. So to input:
    38°57'33.804'' N, 95°15'55.739'' W

    You should write it as:


    -95 15 55.739, 38 57 33.804

    Note that the order changed because the program will need the longitude (in this case represented as W) in the first column. The latitude (N) should be in the second column. All the symbols (°, ‘ and ”) were replaced by blank spaces.


  2. The following data is an example of sexagesimal coordinates. These data should be loaded to the input field of the program:
    -98 53 33.846, 19 28 53.062
    -98 53 30.812, 19 28 59.526
    -98 53 38.35, 19 29 2.597
    -98 53 40.346, 19 28 59.401
    -98 53 39.68, 19 28 59.13
    -98 53 38.397, 19 28 57.131
    -98 53 36.13, 19 28 54.213
    -98 53 35.511, 19 28 53.615
    -98 53 34.655, 19 28 53.244
    -98 53 33.846, 19 28 53.062

  3. Next in the field Convert to, the option UTM Projection should be selected.
  4. At this point the checkbox Formatted as: DD°MM’SS” should become enabled, check it. This is a very important step.
  5. Once the option is checked, the input label should change to Input (Lon Lat DDMMSS) and the output label should read Output (Lon Lat DECIMAL).
  6. Finally, press the button Convert, the conversion should be performed successfully. See figure:

NOTE: currently the direct conversion from sexagesimal Lon Lat coordinates to UTM projection is not supported. So you should convert to decimal format before to convert to UTM.

Openning and saving text files

To open a text file:

  1. Use the menu File > Open file.
  2. A dialog window will pop up asking for a file. Select the file where the data is saved. You should select only comma or tab delimited text files with extension CSV or TXT.
  3. The file should have the format described above, if not there will be errors.
  4. The data in the text file will appear in the input field.

To save a text file:

  1. Use the menu File > Save results.
  2. A dialog window will pop up asking for a file name and a location.
  3. Once you had provided a file name and selected a folder the file will be saved. Your user should have permission to write into the selected folder, otherwise the file will not be saved.
  4. Only the text in the output field will be saved into the file.

License

Conversion between geographic coordinates (Lon Lat) and UTM projection

Copyright (C) 2014-2018 Eduardo Jimenez <ecoslacker@irriapps.com>

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

This program 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. See the GNU General Public License for
more details.