Converting to WGS84

From OpenStreetMap Wiki
(Redirected from WGS 84)
Jump to navigation Jump to search

OpenStreetMap uses the  WGS-84 coordinate system, as do most GPS units. However, many other coordinate systems also exist and are in widespread use, depending on the region and application. Every country tends to use its own standard or preferred coordinate system; so that the maps for that region are as undistorted as possible and the coordinates are reasonably simple to use. These coordinates need to be converted to WGS-84 before being used in OSM.

Conversion tools

Potlatch 2 and JOSM

The map editors, Potlatch 2 and JOSM (via the OpenData plugin), are both technically able to convert between coordinate systems, however the number supported is very limited. In Potlatch use Background->Vector File..., and in JOSM File->Open.

proj

Proj is a library and command-line tool for Linux and Unix systems. It is available at http://trac.osgeo.org/proj/ , and is included in many Linux distributions.

Geotrans

Geotrans is an open-source GUI and command-line tool which can be used to convert between most coordinate systems. It is available for Windows and Linux, at http://gcmd.nasa.gov/records/GEOTRANS.html . It is also included in some Linux distributions as the geotranz package.

QGIS

QGIS is a free GIS application that can be used to convert between Coordinate Reference Systems (CRS) in two simple steps. First, open the input data making sure to select the correct CRS. Finally, use Layer->Save As... to export the layer with a different CRS (you may choice between the 'Project CRS' or select a CRS from QGIS's extensive list).

Be aware, however, that in some cases QGIS will perform a "ballpark" transformation which does not actually do anything. See How to transform data from NAD83 to WGS84 for instructions on how to properly transform coordinates between these systems.

Online services

There are several online services for converting coordinates.

Regional systems

In JOSM, you can use the following projection parameters by setting up a custom projection in Preferences → Map Settings → Map Projection. You can then input projected coordinates by changing to the East/North tab in the Add Node or in the Move Node dialog.

Austria

Converting to and from BMN using proj.4 on meridian strips

M28: +proj=tmerc +lat_0=0 +lon_0=10d20 +k=1 +x_0=150000 +y_0=-5000000 +ellps=bessel
M31: +proj=tmerc +lat_0=0 +lon_0=13d20 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel
M34: +proj=tmerc +lat_0=0 +lon_0=16d20 +k=1 +x_0=750000 +y_0=-5000000 +ellps=bessel

In order to convert between WGS84 and MGI add

+ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232


You cannot use "proj" directly but have to use "cs2cs" instead. Only this "allows translation between any pair of definable coordinate systems, including support for datum translation" (from the man-page of proj).

An example for M28 looks like this:

 cs2cs +proj=tmerc +lat_0=0 +lon_0=10d20 +k=1 +x_0=150000 +y_0=-5000000 +ellps=bessel \
          +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 \
       +to \
       +proj=longlat +ellps=WGS84 +datum=WGS84

Belgium

There are two projection systems used in Belgium : Lambert 72 and Lambert 2008.

Lambert 72: +proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-99.059,53.322,-112.486,0.419,-0.830,1.885,-1

Lambert 2008: +proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.8686,52.2978,-103.7329,-0.3366,0.457,-1.8422,-1.2747 +units=m +no_def

Brazil

Many systems have been used at the national level by  IBGE. For a full, detailed list with projection parameters, see Brazilian Coordinate Reference Systems in OSGeo's wiki.

  • Rio Grande do Sul: UTM 22 or 21, South hemisphere
    • Porto Alegre: municipal decree 18.315 defines the TM-POA projection as: +proj=tmerc +lon_0=-51 +k=0.999995 +x_0=300000 +y_0=5000000 +lat_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

France

There are several projection systems used in France, depending on the use (just one zone, or the whole of Metropolitan France, which is Zone II étendu) and the current standards (subject to change ... yes, it's a mess...). The IGN detailed it. Here are the EPSG codes for Metropolitan France :

  • Lambert Zone I = (ESPG:"Lambert Nord") code EPSG:27561
  • Lambert Zone II = (ESPG:"Lambert Centre") code EPSG:27562
  • Lambert Zone III = (ESPG:"Lambert Sud") code EPSG:27563
  • Lambert Zone IV = (ESPG:"Lambert Corse") code EPSG:27564
  • Lambert I Carto = (ESPG:"Lambert zone I") code EPSG:27571
  • Lambert II Carto/étendu = (ESPG:"Lambert zone II étendu") code EPSG:27572
  • Lambert III Carto = (ESPG:"Lambert zone III") code EPSG:27573
  • Lambert IV Carto = (ESPG:"Lambert zone IV") code EPSG:27574

Great Britain

To convert from British National Grid, use projection EPSG:27700. In the long-established, but now less-preferred proj.4 format, the projection is defined as

+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +datum=OSGB36 +units=m

and the OSGB36 datum is defined as

+ellps=airy +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb

Older software uses an approximate version of the OSGB36 datum, which results in misaligned map features. The minimum versions needed are proj 6.0.0 (2019-03-01), GDAL 3.0.0 (2019-05-05) and QGIS 3.8.0 (2019-06-22). At the time of writing (December 2020), JOSM is still using the approximate version of the OSGB36 datum, but there is a ticket open for it to be upgraded. The opendata plugin opens shapefiles using the approximate version, and this would need to be upgraded separately.

Israel

Coordinates used in Israel are mostly Israeli Transverse Mercator. The unit of measurement is meters.

 +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=-24.0024,-17.1032,-17.8444,-0.33009,-1.85269,1.66969,5.4248 +units=m +no_defs

Netherlands

Coordinates used in The Netherlands are mostly Rijksdriehoek coordinates (Amersfoort / RD new). The unit of measurement is meters. The EPSG code is 28992.

 +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs

Spain

Spanish publications generally use ED50 (Geotrans ref EUR-D), UTM 31 north.

Sweden

Converting to and from RT90, Using the proj tool.

# from GPS (15.806283 == 15d48.377)
$ proj -r +ellps=WGS84 +proj=tmerc +lat_0=0 +lon_0=015d48.377m +k=1.0000056 +x_0=1500064.1 +y_0=-668.0
# from RT 90
$ invproj -r +ellps=WGS84 +proj=tmerc +lat_0=0 +lon_0=015d48.377m +k=1.0000056 +x_0=1500064.1 +y_0=-668.0

United States

Most current federal government data sets for the continental United States use the NAD83 / EPSG:4269 coordinate system. Many state and local data sets use older, state-specific coordinate grids based on NAD83. For an explanation of the various historical coordinate systems used in the US, see the NADCON 5 technical report published by NOAA.

For instructions on using QGIS to transform NAD83 to the current WGS84 reference frame, see How to transform data from NAD83 to WGS84.