1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
|
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>cs2cs — PROJ 9.0.0 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="shortcut icon" href="../_static/favicon.png"/>
<link rel="canonical" href="https://proj.orgapps/cs2cs.html"/>
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/js/theme.js"></script>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="geod" href="geod.html" />
<link rel="prev" title="cct" href="cct.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: #353130" >
<a href="../index.html">
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
9.0.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../about.html">About</a></li>
<li class="toctree-l1"><a class="reference internal" href="../news.html">News</a></li>
<li class="toctree-l1"><a class="reference internal" href="../download.html">Download</a></li>
<li class="toctree-l1"><a class="reference internal" href="../install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usage/index.html">Using PROJ</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Applications</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="cct.html">cct</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">cs2cs</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#synopsis">Synopsis</a></li>
<li class="toctree-l3"><a class="reference internal" href="#description">Description</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#use-of-remote-grids">Use of remote grids</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#examples">Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#using-proj-strings">Using PROJ strings</a></li>
<li class="toctree-l4"><a class="reference internal" href="#using-epsg-crs-codes">Using EPSG CRS codes</a></li>
<li class="toctree-l4"><a class="reference internal" href="#using-epsg-crs-names">Using EPSG CRS names</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="geod.html">geod</a></li>
<li class="toctree-l2"><a class="reference internal" href="gie.html">gie</a></li>
<li class="toctree-l2"><a class="reference internal" href="proj.html">proj</a></li>
<li class="toctree-l2"><a class="reference internal" href="projinfo.html">projinfo</a></li>
<li class="toctree-l2"><a class="reference internal" href="projsync.html">projsync</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../operations/index.html">Coordinate operations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../resource_files.html">Resource files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../geodesic.html">Geodesic calculations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../specifications/index.html">Specifications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../community/index.html">Community</a></li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../zreferences.html">References</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #353130" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">PROJ</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> »</li>
<li><a href="index.html">Applications</a> »</li>
<li>cs2cs</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/OSGeo/PROJ/edit/8.2/docs/source/apps/cs2cs.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Sequential page navigation">
<a href="cct.html" class="btn btn-neutral float-left" title="cct" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="geod.html" class="btn btn-neutral float-right" title="geod" accesskey="n">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="cs2cs">
<span id="id1"></span><h1>cs2cs<a class="headerlink" href="#cs2cs" title="Permalink to this headline">¶</a></h1>
<p>Filter for transformations between two coordinate reference systems.</p>
<section id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><div class="line-block">
<div class="line"><strong>cs2cs</strong> [<strong>-eEfIlrstvwW</strong> [args]]</div>
<div class="line-block">
<div class="line">[[–area <name_or_code>] | [–bbox <west_long,south_lat,east_long,north_lat>]]</div>
<div class="line">[–authority <name>] [–no-ballpark] [–accuracy <accuracy>]</div>
<div class="line">([<em>+opt[=arg]</em> …] [+to <em>+opt[=arg]</em> …] | {source_crs} {target_crs})</div>
<div class="line">file …</div>
</div>
</div>
<p>where {source_crs} or {target_crs} is one of the possibilities accepted
by <a class="reference internal" href="../development/reference/functions.html#c.proj_create" title="proj_create"><code class="xref c c-func docutils literal notranslate"><span class="pre">proj_create()</span></code></a>, provided it expresses a CRS</p>
<ul class="simple">
<li><p>a proj-string,</p></li>
<li><p>a WKT string,</p></li>
<li><p>an object code (like “EPSG:4326”, “urn:ogc:def:crs:EPSG::4326”,
“urn:ogc:def:coordinateOperation:EPSG::1671”),</p></li>
<li><p>an Object name. e.g “WGS 84”, “WGS 84 / UTM zone 31N”. In that case as
uniqueness is not guaranteed, heuristics are applied to determine the appropriate best match.</p></li>
<li><p>a OGC URN combining references for compound coordinate reference systems
(e.g “<a class="reference external" href="urn:ogc:def:crs,crs:EPSG::2393,crs:EPSG::5717">urn:ogc:def:crs,crs:EPSG::2393,crs:EPSG::5717</a>” or custom abbreviated
syntax “EPSG:2393+5717”),</p></li>
<li><p>a OGC URN combining references for references for projected or derived CRSs
e.g. for Projected 3D CRS “UTM zone 31N / WGS 84 (3D)”:
“<a class="reference external" href="urn:ogc:def:crs,crs:EPSG::4979,cs:PROJ::ENh,coordinateOperation:EPSG::16031">urn:ogc:def:crs,crs:EPSG::4979,cs:PROJ::ENh,coordinateOperation:EPSG::16031</a>”
(<em>added in 6.2</em>)</p></li>
<li><p>a OGC URN combining references for concatenated operations
(e.g. “<a class="reference external" href="urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618">urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618</a>”)</p></li>
<li><p>a PROJJSON string. The jsonschema is at <a class="reference external" href="https://proj.org/schemas/v0.4/projjson.schema.json">https://proj.org/schemas/v0.4/projjson.schema.json</a> (<em>added in 6.2</em>)</p></li>
<li><p>a compound CRS made from two object names separated with ” + “. e.g. “WGS 84 + EGM96 height” (<em>added in 7.1</em>)</p></li>
</ul>
<div class="versionadded">
<p><span class="versionmodified added">New in version 6.0.0.</span></p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>before 7.0.1, it was needed to add +to between {source_crs} and {target_crs}
when adding a filename</p>
</div>
</div></blockquote>
</section>
<section id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">cs2cs</strong> performs transformation between the source and destination
cartographic coordinate reference system on a set of input points. The coordinate
reference system transformation can include translation between projected and
geographic coordinates as well as the application of datum shifts.</p>
<p>The following control parameters can appear in any order:</p>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-I">
<span id="cmdoption-cs2cs-i"></span><span class="sig-name descname"><span class="pre">-I</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-I" title="Permalink to this definition">¶</a></dt>
<dd><p>Method to specify inverse translation, convert from <em>+to</em> coordinate system to
the primary coordinate system defined.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-t-a">
<span class="sig-name descname"><span class="pre">-t<a></span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-t-a" title="Permalink to this definition">¶</a></dt>
<dd><p>Where <em>a</em> specifies a character employed as the first character to denote a control
line to be passed through without processing. This option applicable to
ASCII input only. (# is the default value).</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-d">
<span class="sig-name descname"><span class="pre">-d</span></span><span class="sig-prename descclassname"> <span class="pre"><n></span></span><a class="headerlink" href="#cmdoption-cs2cs-d" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 5.2.0.</span></p>
</div>
<p>Specify the number of decimals in the output.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-e">
<span class="sig-name descname"><span class="pre">-e</span></span><span class="sig-prename descclassname"> <span class="pre"><string></span></span><a class="headerlink" href="#cmdoption-cs2cs-e" title="Permalink to this definition">¶</a></dt>
<dd><p>Where <em>string</em> is an arbitrary string to be output if an error is detected during
data transformations. The default value is a three character string: <code class="docutils literal notranslate"><span class="pre">*\t*</span></code>.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-E">
<span class="sig-name descname"><span class="pre">-E</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-E" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes the input coordinates to be copied to the output line prior to
printing the converted values.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-l">
<span class="sig-name descname"><span class="pre">-l<[</span></span><span class="sig-prename descclassname"><span class="pre">=id]></span></span><a class="headerlink" href="#cmdoption-cs2cs-l" title="Permalink to this definition">¶</a></dt>
<dd><p>List projection identifiers that can be selected with <em>+proj</em>. <code class="docutils literal notranslate"><span class="pre">cs2cs</span> <span class="pre">-l=id</span></code>
gives expanded description of projection <em>id</em>, e.g. <code class="docutils literal notranslate"><span class="pre">cs2cs</span> <span class="pre">-l=merc</span></code>.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-lp">
<span class="sig-name descname"><span class="pre">-lp</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-lp" title="Permalink to this definition">¶</a></dt>
<dd><p>List of all projection id that can be used with the <em>+proj</em> parameter.
Equivalent to <code class="docutils literal notranslate"><span class="pre">cs2cs</span> <span class="pre">-l</span></code>.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-lP">
<span class="sig-name descname"><span class="pre">-lP</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-lP" title="Permalink to this definition">¶</a></dt>
<dd><p>Expanded description of all projections that can be used with the <em>+proj</em>
parameter.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-le">
<span class="sig-name descname"><span class="pre">-le</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-le" title="Permalink to this definition">¶</a></dt>
<dd><p>List of all ellipsoids that can be selected with the <em>+ellps</em> parameters.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-lu">
<span class="sig-name descname"><span class="pre">-lu</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-lu" title="Permalink to this definition">¶</a></dt>
<dd><p>List of all distance units that can be selected with the <em>+units</em> parameter.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-r">
<span class="sig-name descname"><span class="pre">-r</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-r" title="Permalink to this definition">¶</a></dt>
<dd><p>This options reverses the order of the first two expected
inputs from that specified by the CRS to the opposite
order. The third coordinate, typically height, remains
third.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-s">
<span class="sig-name descname"><span class="pre">-s</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-s" title="Permalink to this definition">¶</a></dt>
<dd><p>This options reverses the order of the first two expected
outputs from that specified by the CRS to the opposite
order. The third coordinate, typically height, remains
third.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-f">
<span class="sig-name descname"><span class="pre">-f</span></span><span class="sig-prename descclassname"> <span class="pre"><format></span></span><a class="headerlink" href="#cmdoption-cs2cs-f" title="Permalink to this definition">¶</a></dt>
<dd><p>Where <em>format</em> is a printf format string to control the form of the output values.
For inverse projections, the output will be in degrees when this option is
employed. If a format is specified for inverse projection the output data
will be in decimal degrees. The default format is <code class="docutils literal notranslate"><span class="pre">"%.2f"</span></code> for forward
projection and DMS for inverse.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-w-n">
<span class="sig-name descname"><span class="pre">-w<n></span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-w-n" title="Permalink to this definition">¶</a></dt>
<dd><p>Where <em>n</em> is the number of significant fractional digits to employ for seconds
output (when the option is not specified, <code class="docutils literal notranslate"><span class="pre">-w3</span></code> is assumed).</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-W-n">
<span class="sig-name descname"><span class="pre">-W<n></span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-W-n" title="Permalink to this definition">¶</a></dt>
<dd><p>Where <em>n</em> is the number of significant fractional digits to employ for seconds
output. When <code class="docutils literal notranslate"><span class="pre">-W</span></code> is employed the fields will be constant width
with leading zeroes.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-v">
<span class="sig-name descname"><span class="pre">-v</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-v" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes a listing of cartographic control parameters tested for and used by
the program to be printed prior to input data.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-area">
<span class="sig-name descname"><span class="pre">--area</span></span><span class="sig-prename descclassname"> <span class="pre"><name_or_code></span></span><a class="headerlink" href="#cmdoption-cs2cs-area" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 8.0.0.</span></p>
</div>
<p>Specify an area of interest to restrict the results when researching
coordinate operations between 2 CRS. The area of interest can be specified either
as a name (e.g “Denmark - onshore”) or a AUTHORITY:CODE (EPSG:3237)</p>
<p>This option is mutually exclusive with <a class="reference internal" href="#cmdoption-cs2cs-bbox"><code class="xref std std-option docutils literal notranslate"><span class="pre">--bbox</span></code></a>.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-bbox">
<span class="sig-name descname"><span class="pre">--bbox</span></span><span class="sig-prename descclassname"> <span class="pre"><west_long,south_lat,east_long,north_lat></span></span><a class="headerlink" href="#cmdoption-cs2cs-bbox" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 8.0.0.</span></p>
</div>
<p>Specify an area of interest to restrict the results when researching
coordinate operations between 2 CRS. The area of interest is specified as a
bounding box with geographic coordinates, expressed in degrees in a
unspecified geographic CRS.
<cite>west_long</cite> and <cite>east_long</cite> should be in the [-180,180] range, and
<cite>south_lat</cite> and <cite>north_lat</cite> in the [-90,90]. <cite>west_long</cite> is generally lower than
<cite>east_long</cite>, except in the case where the area of interest crosses the antimeridian.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-no-ballpark">
<span class="sig-name descname"><span class="pre">--no-ballpark</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-cs2cs-no-ballpark" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 8.0.0.</span></p>
</div>
<p>Disallow any coordinate operation that is, or contains, a
<a class="reference internal" href="../glossary.html#term-Ballpark-transformation"><span class="xref std std-term">Ballpark transformation</span></a></p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-accuracy">
<span class="sig-name descname"><span class="pre">--accuracy</span></span><span class="sig-prename descclassname"> <span class="pre"><accuracy></span></span><a class="headerlink" href="#cmdoption-cs2cs-accuracy" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 8.0.0.</span></p>
</div>
<p>Sets the minimum desired accuracy for candidate coordinate operations.</p>
</dd></dl>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-cs2cs-authority">
<span class="sig-name descname"><span class="pre">--authority</span></span><span class="sig-prename descclassname"> <span class="pre"><name></span></span><a class="headerlink" href="#cmdoption-cs2cs-authority" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 8.0.0.</span></p>
</div>
<p>This option can be used to restrict the authority of coordinate operations
looked up in the database. When not specified, coordinate
operations from any authority will be searched, with the restrictions set
in the <code class="docutils literal notranslate"><span class="pre">authority_to_authority_preference</span></code> database table related to the authority
of the source/target CRS themselves.
If authority is set to <code class="docutils literal notranslate"><span class="pre">any</span></code>, then coordinate operations from any authority will be searched
If authority is a non-empty string different of <code class="docutils literal notranslate"><span class="pre">any</span></code>, then coordinate operations
will be searched only in that authority namespace (e.g <code class="docutils literal notranslate"><span class="pre">EPSG</span></code>).</p>
<p>This option is mutually exclusive with <a class="reference internal" href="#cmdoption-cs2cs-bbox"><code class="xref std std-option docutils literal notranslate"><span class="pre">--bbox</span></code></a>.</p>
</dd></dl>
<p>The <em>+opt</em> run-line arguments are associated with cartographic
parameters. Usage varies with projection and for a complete description
consult the <a class="reference internal" href="../operations/projections/index.html#projections"><span class="std std-ref">projection pages</span></a>.</p>
<p>The <strong class="program">cs2cs</strong> program requires two coordinate reference system (CRS) definitions. The first (or
primary is defined based on all projection parameters not appearing after the
<em>+to</em> argument. All projection parameters appearing after the <em>+to</em> argument
are considered the definition of the second CRS. If there is no
second CRS defined, a geographic CRS based on the
datum and ellipsoid of the source CRS is assumed. Note that the
source and destination CRS can both of same or different nature (geographic,
projected, compound CRS), or one of each and may have the same or different datums.</p>
<p>When using a WKT definition or a AUTHORITY:CODE, the axis order of the CRS will
be enforced. So for example if using EPSG:4326, the first value expected (or
returned) will be a latitude.</p>
<p>Internally, <strong class="program">cs2cs</strong> uses the <a class="reference internal" href="../development/reference/functions.html#c.proj_create_crs_to_crs" title="proj_create_crs_to_crs"><code class="xref c c-func docutils literal notranslate"><span class="pre">proj_create_crs_to_crs()</span></code></a> function
to compute the appropriate coordinate operation, so implementation details of
this function directly impact the results returned by the program.</p>
<p>The environment parameter <span class="target" id="index-0"></span><a class="reference internal" href="../usage/environmentvars.html#envvar-PROJ_LIB"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PROJ_LIB</span></code></a> establishes the
directory for resource files (database, datum shift grids, etc.)</p>
<p>One or more files (processed in left to right order) specify the source of
data to be transformed. A <code class="docutils literal notranslate"><span class="pre">-</span></code> will specify the location of processing standard
input. If no files are specified, the input is assumed to be from stdin.
For input data the two data values must be in the first two white space
separated fields and when both input and output are ASCII all trailing portions
of the input line are appended to the output line.</p>
<p>Input geographic data (longitude and latitude) must be in DMS or decimal
degrees format and input cartesian data must be in units consistent with the
ellipsoid major axis or sphere radius units. Output geographic coordinates will
normally be in DMS format (use <code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">%.12f</span></code> for decimal degrees with 12 decimal
places), while projected (cartesian) coordinates will be in linear
(meter, feet) units.</p>
<section id="use-of-remote-grids">
<h3>Use of remote grids<a class="headerlink" href="#use-of-remote-grids" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified added">New in version 7.0.0.</span></p>
</div>
<p>If the <span class="target" id="index-1"></span><a class="reference internal" href="../usage/environmentvars.html#envvar-PROJ_NETWORK"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PROJ_NETWORK</span></code></a> environment variable is set to <code class="docutils literal notranslate"><span class="pre">ON</span></code>,
<strong class="program">cs2cs</strong> will attempt to use remote grids stored on CDN (Content
Delivery Network) storage, when they are not available locally.</p>
<p>More details are available in the <a class="reference internal" href="../usage/network.html#network"><span class="std std-ref">Network capabilities</span></a> section.</p>
</section>
</section>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<section id="using-proj-strings">
<h3>Using PROJ strings<a class="headerlink" href="#using-proj-strings" title="Permalink to this headline">¶</a></h3>
<p>The following script</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10 +datum=NAD27 -r <<EOF
45°15'33.1" 111.5W
45d15.551666667N -111d30
+45.25919444444 111d30'000w
EOF
</pre></div>
</div>
<p>will transform the input NAD83 geographic coordinates into NAD27 coordinates in
the UTM projection with zone 10 selected. The geographic values of this
example are equivalent and meant as examples of various forms of DMS input.
The x-y output data will appear as three lines of:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1402293.44 5076292.68 0.00
</pre></div>
</div>
</section>
<section id="using-epsg-crs-codes">
<h3>Using EPSG CRS codes<a class="headerlink" href="#using-epsg-crs-codes" title="Permalink to this headline">¶</a></h3>
<p>Transforming from WGS 84 latitude/longitude (in that order) to UTM Zone 31N/WGS 84</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cs2cs EPSG:4326 EPSG:32631 <<EOF
45N 2E
EOF
</pre></div>
</div>
<p>outputs</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>421184.70 4983436.77 0.00
</pre></div>
</div>
</section>
<section id="using-epsg-crs-names">
<h3>Using EPSG CRS names<a class="headerlink" href="#using-epsg-crs-names" title="Permalink to this headline">¶</a></h3>
<p>Transforming from WGS 84 latitude/longitude (in that order) with EGM96 height to
UTM Zone 31N/WGS 84 with WGS84 ellipsoidal height</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 45 2 0 | cs2cs "WGS 84 + EGM96 height" "WGS 84 / UTM zone 31N"
</pre></div>
</div>
<p>outputs</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>421184.70 4983436.77 50.69
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="cct.html" class="btn btn-neutral float-left" title="cct" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="geod.html" class="btn btn-neutral float-right" title="geod" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 1983-2022.
<span class="lastupdated">Last updated on 22 Mar 2022.
</span></p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
|