1PROJ(1) General Commands Manual PROJ(1)
2
3
4
6 cs2cs - cartographic coordinate system filter
7
9 cs2cs [ -eEfIlrstvwW [ args ] ] [ +opts[=arg] ]
10 [ +to [+opts[=arg]] ] file[s]
11
13 Cs2cs performs transformation between the source
14 and destination cartographic coordinate system
15 on a set of input points. The coordinate system
16 transformation can include translation between
17 projected and geographic coordinates as well as
18 the application of datum shifts.
19
20 The following control parameters can appear in
21 any order:
22
23 -I method to specify inverse translation,
24 convert from +to coordinate system to the
25 primary coordinate system defined.
26
27 -ta A specifies a character employed as the
28 first character to denote a control line
29 to be passed through without processing.
30 This option applicable to ascii input
31 only. (# is the default value).
32
33 -e string
34 String is an arbitrary string to be out‐
35 put if an error is detected during data
36 transformations. The default value is:
37 *\t*. Note that if the -b, -i or -o
38 options are employed, an error is
39 returned as HUGE_VAL value for both
40 return values.
41
42 -E causes the input coordinates to be copied
43 to the output line prior to printing the
44 converted values.
45
46 -l[p|P|=|e|u|d]id
47 List projection identifiers with -l, -lp
48 or -lP (expanded) that can be selected
49 with +proj. -l=id gives expanded
50 description of projection id. List
51 ellipsoid identifiers with -le, that can
52 be selected with +ellps, -lu list of
53 cartesian to meter conversion factors
54 that can be selected with +units or -ld
55 list of datums that can be selected with
56 +datum.
57
58 -r This options reverses the order of the
59 expected input from longitude-latitude or
60 x-y to latitude-longitude or y-x.
61
62 -s This options reverses the order of the
63 output from x-y or longitude-latitude to
64 y-x or latitude-longitude.
65
66 -f format
67 Format is a printf format string to con‐
68 trol the form of the output values. For
69 inverse projections, the output will be
70 in degrees when this option is employed.
71 If a format is specified for inverse pro‐
72 jection the output data will be in deci‐
73 mal degrees. The default format is
74 "%.2f" for forward projection and DMS for
75 inverse.
76
77 -[w|W]n
78 N is the number of significant fractional
79 digits to employ for seconds output (when
80 the option is not specified, -w3 is
81 assumed). When -W is employed the fields
82 will be constant width and with leading
83 zeroes.
84
85 -v causes a listing of cartographic control
86 parameters tested for and used by the
87 program to be printed prior to input
88 data.
89
90 The +args run-line arguments are associated with
91 cartographic parameters and usage varies with
92 projection and for a complete description see
93 Cartographic Projection Procedures for the UNIX
94 Environment—A User's Manual ) and supplementary
95 documentation for Release 4.
96
97 The cs2cs program requires two coordinate system
98 definitions. The first (or primary is defined
99 based on all projection parameters not appearing
100 after the +to argument. All projection parame‐
101 ters appearing after the +to argument are con‐
102 sidered the definition of the second coordinate
103 system. If there is no second coordinate system
104 defined, a geographic coordinate system based on
105 the datum and ellipsoid of the source coordinate
106 system is assumed. Note that the source and
107 destination coordinate system can both be pro‐
108 jections, both be geographic, or one of each and
109 may have the same or different datums.
110
111 Additional projection control parameters may be
112 contained in two auxilliary control files: the
113 first is optionally referenced with the
114 +init=file:id and the second is always processed
115 after the name of the projection has been estab‐
116 lished from either the run-line or the contents
117 of +init file. The environment parameter
118 PROJ_LIB establishes the default directory for a
119 file reference without an absolute path. This
120 is also used for supporting files like datum
121 shift files.
122
123 One or more files (processed in left to right
124 order) specify the source of data to be trans‐
125 formed. A - will specify the location of pro‐
126 cessing standard input. If no files are speci‐
127 fied, the input is assumed to be from stdin.
128 For input data the two data values must be in
129 the first two white space separated fields and
130 when both input and output are ASCII all trail‐
131 ing portions of the input line are appended to
132 the output line.
133
134 Input geographic data (longitude and latitude)
135 must be in DMS format and input cartesian data
136 must be in units consistent with the ellipsoid
137 major axis or sphere radius units. Output geo‐
138 graphic coordinates will be in DMS (if the -w
139 switch is not employed) and precise to 0.001"
140 with trailing, zero-valued minute-second fields
141 deleted.
142
144 The following script
145 cs2cs +proj=latlong +datum=NAD83
146 +to +proj=utm +zone=10 +datum=NAD27
147 -r <<EOF
148 45d15'33.1" 111.5W
149 45d15.551666667N -111d30
150 +45.25919444444 111d30'000w
151 EOF
152 will transform the input NAD83 geographic coor‐
153 dinates into NAD27 coordinates in the UTM pro‐
154 jection with zone 10 selected. The geographic
155 values of this example are equivalent and meant
156 as examples of various forms of DMS input. The
157 x-y output data will appear as three lines of:
158 1402285.99 5076292.42 0.000
159
161 proj(1U),
162 Cartographic Projection Procedures for the UNIX
163 Environment—A User's Manual, (Evenden, 1990,
164 Open-file report 90-284).
165 Map Projections Used by the U. S. Geological
166 Survey (Snyder, 1984, USGS Bulletin 1532).
167 Map Projections—A Working Manual (Synder, 1988,
168 USGS Prof. Paper 1395).
169 An Album of Map Projections (Snyder & Voxland,
170 1989, USGS Prof. Paper 1453).
171
173 http://www.remotesensing.org/proj
174
175
176
177 2000/03/21 Rel. 4.4 PROJ(1)