1CS2CS(1)                            PROJ.4                            CS2CS(1)
2
3
4

NAME

6       cs2cs - Cartographic coordinate system filter
7

SYNOPSIS

9          cs2cs  [ -eEfIlrstvwW [ args ] ] [ +opts[=arg] ] [ +to [+opts[=arg]]
10          ] file[s]
11

DESCRIPTION

13       cs2cs performs transformation between the source and destination carto‐
14       graphic coordinate system on a set of input points. The coordinate sys‐
15       tem transformation can include translation between projected  and  geo‐
16       graphic coordinates as well as the application of datum shifts.
17
18       The following control parameters can appear in any order:
19
20       -I     Method  to specify inverse translation, convert from +to coordi‐
21              nate system to the primary coordinate system defined.
22
23       -t<a>  Where a specifies a character employed as the first character to
24              denote  a  control line to be passed through without processing.
25              This option applicable to ASCII input only. (#  is  the  default
26              value).
27
28       -d <n>
29
30       New in version 5.2.0: Specify the number of decimals in the output.
31
32
33       -e <string>
34              Where  string is an arbitrary string to be output if an error is
35              detected during data transformations. The  default  value  is  a
36              three character string: *\t*.
37
38       -E     Causes  the  input  coordinates  to be copied to the output line
39              prior to printing the converted values.
40
41       -l<[=id]>
42              List projection identifiers that can  be  selected  with  +proj.
43              cs2cs  -l=id  gives  expanded description of projection id, e.g.
44              cs2cs -l=merc.
45
46       -lp    List of all projection id that can be used with the +proj param‐
47              eter.  Equivalent to cs2cs -l.
48
49       -lP    Expanded  description  of  all projections that can be used with
50              the +proj parameter.
51
52       -le    List of all ellipsoids that can  be  selected  with  the  +ellps
53              parameters.
54
55       -lu    List  of all distance units that can be selected with the +units
56              parameter.
57
58       -ld    List of datums that can be selected with the +datum parameter.
59
60       -r     This options reverses the order of the expected input from  lon‐
61              gitude-latitude or x-y to latitude-longitude or y-x.
62
63       -s     This options reverses the order of the output from x-y or longi‐
64              tude-latitude to y-x or latitude-longitude.
65
66       -f <format>
67              Where format is a printf format string to control  the  form  of
68              the  output values.  For inverse projections, the output will be
69              in degrees when this option is employed. If a format  is  speci‐
70              fied  for  inverse projection the output data will be in decimal
71              degrees. The default format is "%.2f" for forward projection and
72              DMS for inverse.
73
74       -w<n>  Where n is the number of significant fractional digits to employ
75              for seconds output (when the option is  not  specified,  -w3  is
76              assumed).
77
78       -W<n>  Where n is the number of significant fractional digits to employ
79              for seconds output. When -W is employed the fields will be  con‐
80              stant width with leading zeroes.
81
82       -v     Causes  a  listing of cartographic control parameters tested for
83              and used by the program to be printed prior to input data.
84
85       The +args run-line arguments are associated with  cartographic  parame‐
86       ters.
87
88       The cs2cs program requires two coordinate system definitions. The first
89       (or primary is defined based on all projection parameters not appearing
90       after  the  +to argument. All projection parameters appearing after the
91       +to argument are considered the definition  of  the  second  coordinate
92       system.  If  there is no second coordinate system defined, a geographic
93       coordinate system based on the datum and ellipsoid of the source  coor‐
94       dinate  system is assumed. Note that the source and destination coordi‐
95       nate system can both be projections, both be geographic, or one of each
96       and may have the same or different datums.
97
98       Additional projection control parameters may be contained in two auxil‐
99       iary control  files:  the  first  is  optionally  referenced  with  the
100       +init=file:id  and the second is always processed after the name of the
101       projection has been established from either the run-line  or  the  con‐
102       tents of +init file. The environment parameter PROJ_LIB establishes the
103       default directory for a file reference without an absolute  path.  This
104       is also used for supporting files like datum shift files.
105
106       One or more files (processed in left to right order) specify the source
107       of data to be transformed. A - will specify the location of  processing
108       standard  input.  If no files are specified, the input is assumed to be
109       from stdin.  For input data the two data values must be  in  the  first
110       two  white  space  separated  fields and when both input and output are
111       ASCII all trailing portions of the input line are appended to the  out‐
112       put line.
113
114       Input  geographic data (longitude and latitude) must be in DMS or deci‐
115       mal degrees format and input cartesian data must be in units consistent
116       with the ellipsoid major axis or sphere radius units. Output geographic
117       coordinates will normally be in DMS format (use -f  %.12f  for  decimal
118       degrees  with  12  decimal places), while projected (cartesian) coordi‐
119       nates will be in linear (meter, feet) units.
120

EXAMPLE

122       The following script
123
124          cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10 +datum=NAD27 -r <<EOF
125          45d15'33.1" 111.5W
126          45d15.551666667N -111d30
127          +45.25919444444 111d30'000w
128          EOF
129
130       will transform the input NAD83 geographic coordinates into NAD27  coor‐
131       dinates  in  the  UTM  projection with zone 10 selected. The geographic
132       values of this example are equivalent and meant as examples of  various
133       forms of DMS input.  The x-y output data will appear as three lines of:
134
135          1402285.98  5076292.42 -0.00
136

SEE ALSO

138       proj(1), cct(1), geod(1), gie(1)
139

BUGS

141       A      list      of      know      bugs     can     be     found     at
142       https://github.com/OSGeo/proj.4/issues where new  bug  reports  can  be
143       submitted to.
144

HOME PAGE

146       https://proj4.org/
147

AUTHOR

149       Frank Warmerdam
150
152       1983-2018
153
154
155
156
1575.2.0                            Sep 10, 2018                         CS2CS(1)
Impressum