PROJ: forward and reverse geographic projections

Submitted by dylan on Tue, 2005-09-13 16:49.

Data points collected in the field via GPS, or in the office via maps can often come from a variety of projections and or datum/ellipsoids. The PROJ tools and libraries can be used to perform forward and reverse projection on lists of points stored in a text file. More information on PROJ can be found here: http://trac.osgeo.org/proj/ . Many applications that perform forward and inverse projection operations rely on the Proj library for the actual transformatoin of coordinates. Some examples include GDAL/OGR and GRASS, which provide a convenient interface for converting large datasets from one coordinate system to another. For problems see the FAQ. Tests confirm that datum transforms within the continental US are nearly identical with results from NADCON.

Command names are in boldface type, input files are red, and output files are in green.


Forward and Inverse Projections

  • Perform a forward projection to UTM Zone 10 North, NAD83 Datum
  • file coordinate_list:
    ---------------------------------
    -121 37
    -121.231231 37.482713
    ---------------------------------
    proj +proj=utm +zone=10 +datum=NAD83 < coordinate_list
    677962.19 4096742.06
    656384.16 4149892.63
  • Perform an inverse projection from UTM Zone 10 North, NAD83 Datum to Long/Lat (NAD83)
  • file utm_coordinates:
    ---------------------------------
    677962.19 4096742.06
    656384.16 4149892.63
    ---------------------------------
    cs2cs +proj=utm +zone=10 +datum=NAD83 +to +proj=longlat +datum=NAD83 < utm_coordinates
    121dW 37dN
    121d13'52.432"W 37d28'57.767"N
  • Optionally print Lat/Lon as decimal degrees (NAD83):
    cs2cs -f "%.6f" +proj=utm +zone=10 +datum=NAD83 +to +proj=longlat +datum=NAD83 < utm_coordinates
    -121.000000 37.000000
    -121.231231 37.482713



Conversions Between Coordinate Systems

  • Datum shift from NAD27 to NAD83
  • cs2cs +proj=latlong +datum=NAD27 +to +proj=latlong +datum=NAD83
  • Convert DMS to DD
  • cs2cs -f "%.6f" +proj=latlong +datum=NAD83 +to +proj=latlong +datum=NAD83