This calculator parses latitude and longitude coordinates in a variety of formats and outputs a selection of widely used formats. It also provides links to the coordinates on various internet maps: Open Street Map, Google Maps, and Bing Maps.
Here are a variety of global coordinates to demonstrate the cabalibities and variety of accepted input formats. Click on any of the following to see that the given input is parsed:
(([NEWS]?)[ \t]*(-?)([0-9]{1,3})(?:[ \t\:°]+([0-9]{1,2}))?(?:[ \t\:\']+([0-9]{1,2}))?(\.[0-9]+)?[ \t°\'\"]*)([NEWS]?)[NEWS]? -- The optional "north", "south", "east" and "west" symbols that are at often at the beginning or end of a coordinate[ \t]* or [ \t\:°]+ or [ \t\:\']+ or [ \t°\'\"]* -- Various whitespace and separators[0-9]{1,3} -- A one to three digit number\.[0-9]+ -- A decimal point and the digits that follow it() -- Capturing group parenthesis for pulling out whatever is contained(?:) -- Non-capturing parenthesis used just for precedence and not for capturingD: Decimal degreesd: Degrees without the decimalM: Decimal minutesm: Minutes without the decimalS: Decimal secondss: Seconds without the decimalg: A negative sign (if present)N: The cardinal direction symbol ("N", "S", "E", or "W")"D° N" would represent a decimal degrees format and "gd:m:S" would represent a degrees, minutes, seconds format.
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.
Copyright Stephen Ostermiller 2020-2021