File: reference_srs.xml

package info (click to toggle)
postgis 3.5.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 69,540 kB
  • sloc: ansic: 162,229; sql: 93,960; xml: 53,139; cpp: 12,646; perl: 5,658; sh: 5,369; makefile: 3,435; python: 1,205; yacc: 447; lex: 151; pascal: 58
file content (731 lines) | stat: -rw-r--r-- 29,671 bytes parent folder | download | duplicates (5)
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
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
<!-- Converted by db4-upgrade version 1.1 -->
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="SRS_Functions">
    <title>Spatial Reference System Functions</title><info>
    <abstract>
  <para>These functions work with the Spatial Reference System of geometries
    as defined in the <varname>spatial_ref_sys</varname> table.</para>
   </abstract>
    </info>



  <refentry xml:id="ST_InverseTransformPipeline">
    <refnamediv>
    <refname>ST_InverseTransformPipeline</refname>

    <refpurpose>Return a new geometry with coordinates transformed to
      a different spatial reference system using the inverse of a defined coordinate
      transformation pipeline.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
      <funcsynopsis>
        <funcprototype>
          <funcdef>geometry <function>ST_InverseTransformPipeline</function></funcdef>
          <paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
          <paramdef><type>text </type> <parameter>pipeline</parameter></paramdef>
          <paramdef choice="opt"><type>integer </type> <parameter>to_srid</parameter></paramdef>
        </funcprototype>
      </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
    <title>Description</title>

      <para>
      Return a new geometry with coordinates transformed to a different spatial reference system
      using a defined coordinate transformation pipeline to go in the inverse direction.
      </para>

      <para> Refer to <xref linkend="ST_TransformPipeline"/> for details on writing a transformation pipeline.</para>

    <para role="availability" conformance="3.4.0">Availability: 3.4.0</para>

    <para>
    The SRID of the input geometry is ignored, and the SRID of the output geometry will be set to
    zero unless a value is provided via the optional <varname>to_srid</varname> parameter. When
    using <xref linkend="ST_TransformPipeline"/> the pipeline is executed in a forward direction. Using
    `ST_InverseTransformPipeline()` the pipeline is executed in the inverse direction.</para>

    <para>Transforms using pipelines are a specialised version of <xref linkend="ST_Transform"/>.
    In most cases `ST_Transform` will choose the correct operations to convert between coordinate
    systems, and should be preferred.</para>

    </refsection>

    <refsection>
    <title>Examples</title>
    <para>Change WGS 84 long lat to UTM 31N using the EPSG:16031 conversion</para>
    <programlisting>
-- Inverse direction
SELECT ST_AsText(ST_InverseTransformPipeline('POINT(426857.9877165967 5427937.523342293)'::geometry,
  'urn:ogc:def:coordinateOperation:EPSG::16031')) AS wgs_geom;

          wgs_geom
----------------------------
 POINT(2 48.99999999999999)
(1 row)
    </programlisting>

    <para>GDA2020 example.</para>
    <programlisting>
-- using ST_Transform with automatic selection of a conversion pipeline.
SELECT ST_AsText(ST_Transform('SRID=4939;POINT(143.0 -37.0)'::geometry, 7844)) AS gda2020_auto;

                 gda2020_auto
-----------------------------------------------
 POINT(143.00000635638918 -36.999986706128176)
(1 row)
    </programlisting>
    </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>

    <para><xref linkend="ST_Transform"/>, <xref linkend="ST_TransformPipeline"/></para>
    </refsection>
  </refentry>

  <refentry xml:id="ST_SetSRID">
    <refnamediv>
    <refname>ST_SetSRID</refname>

    <refpurpose>Set the SRID on a geometry.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
    <funcsynopsis>
      <funcprototype>
      <funcdef>geometry <function>ST_SetSRID</function></funcdef>

      <paramdef><type>geometry </type>
      <parameter>geom</parameter></paramdef>

      <paramdef><type>integer </type>
      <parameter>srid</parameter></paramdef>
      </funcprototype>
    </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
    <title>Description</title>

    <para>Sets the SRID on a geometry to a particular integer value.
    Useful in constructing bounding boxes for queries.</para>

    <note>
      <para>This function does not transform the geometry coordinates in any way -
      it simply sets the meta data defining the spatial reference system the geometry is assumed to be in.
      Use <xref linkend="ST_Transform"/> if you want to transform the
      geometry into a new projection.</para>
    </note>
    <para>&sfs_compliant;</para>
    <para>&curve_support;</para>
    </refsection>

    <refsection>
      <title>Examples</title>
      <para>-- Mark a point as WGS 84 long lat --</para>
      <programlisting>SELECT ST_SetSRID(ST_Point(-123.365556, 48.428611),4326) As wgs84long_lat;
-- the ewkt representation (wrap with ST_AsEWKT) -
SRID=4326;POINT(-123.365556 48.428611)
      </programlisting>
      <para>-- Mark a point as WGS 84 long lat and then transform to web mercator (Spherical Mercator) --</para>
      <programlisting>SELECT ST_Transform(ST_SetSRID(ST_Point(-123.365556, 48.428611),4326),3785) As spere_merc;
-- the ewkt representation (wrap with ST_AsEWKT) -
SRID=3785;POINT(-13732990.8753491 6178458.96425423)
      </programlisting>
    </refsection>

    <refsection>
    <title>See Also</title>

    <para><xref linkend="spatial_ref_sys"/>, <xref linkend="ST_SRID"/>, <xref linkend="ST_Transform"/>, <xref linkend="UpdateGeometrySRID"/></para>
    </refsection>

  </refentry>

  <refentry xml:id="ST_SRID">
    <refnamediv>
    <refname>ST_SRID</refname>
    <refpurpose>Returns the spatial reference identifier for a geometry.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
    <funcsynopsis>
      <funcprototype>
      <funcdef>integer <function>ST_SRID</function></funcdef>
      <paramdef><type>geometry </type> <parameter>g1</parameter></paramdef>
      </funcprototype>
    </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
    <title>Description</title>

    <para>Returns the spatial reference identifier for the ST_Geometry as defined in spatial_ref_sys table. <xref linkend="spatial_ref_sys"/></para>
    <para><note><para>spatial_ref_sys
    table is a table that catalogs all spatial reference systems known to PostGIS and is used for transformations from one spatial
      reference system to another.  So verifying you have the right spatial reference system identifier is important if you plan to ever transform your geometries.</para></note></para>
    <para>&sfs_compliant; s2.1.1.1</para>
    <para>&sqlmm_compliant; SQL-MM 3: 5.1.5</para>
    <para>&curve_support;</para>

    </refsection>

    <refsection>
    <title>Examples</title>

    <programlisting>SELECT ST_SRID(ST_GeomFromText('POINT(-71.1043 42.315)',4326));
    --result
    4326
    </programlisting>
    </refsection>
    <refsection>
    <title>See Also</title>

    <para><xref linkend="spatial_ref_sys"/>, <xref linkend="ST_SetSRID"/>, <xref linkend="ST_Transform"/>, <xref linkend="RT_ST_SRID"/>, <xref linkend="TG_ST_SRID"/></para>
    </refsection>
  </refentry>

  <refentry xml:id="ST_Transform">
    <refnamediv>
    <refname>ST_Transform</refname>

    <refpurpose>Return a new geometry with coordinates transformed to
      a different spatial reference system.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
    <funcsynopsis>
      <funcprototype>
      <funcdef>geometry <function>ST_Transform</function></funcdef>
      <paramdef><type>geometry </type> <parameter>g1</parameter></paramdef>
      <paramdef><type>integer </type> <parameter>srid</parameter></paramdef>
      </funcprototype>

          <funcprototype>
              <funcdef>geometry <function>ST_Transform</function></funcdef>
              <paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
              <paramdef><type>text </type> <parameter>to_proj</parameter></paramdef>
          </funcprototype>

          <funcprototype>
              <funcdef>geometry <function>ST_Transform</function></funcdef>
              <paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
              <paramdef><type>text </type> <parameter>from_proj</parameter></paramdef>
              <paramdef><type>text </type> <parameter>to_proj</parameter></paramdef>
          </funcprototype>

          <funcprototype>
              <funcdef>geometry <function>ST_Transform</function></funcdef>
              <paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
              <paramdef><type>text </type> <parameter>from_proj</parameter></paramdef>
              <paramdef><type>integer </type> <parameter>to_srid</parameter></paramdef>
          </funcprototype>

    </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
    <title>Description</title>

        <para>Returns a new geometry with its coordinates transformed to
            a different spatial reference system. The destination spatial
      reference <varname>to_srid</varname> may be identified by a valid
      SRID integer parameter (i.e. it must exist in the
      <varname>spatial_ref_sys</varname> table).
      Alternatively, a spatial reference defined as a PROJ.4 string
      can be used for <varname>to_proj</varname> and/or
      <varname>from_proj</varname>, however these methods are not
      optimized. If the destination spatial reference system is
      expressed with a PROJ.4 string instead of an SRID, the SRID of the
      output geometry will be set to zero. With the exception of functions with
      <varname>from_proj</varname>, input geometries must have a defined SRID.
    </para>

    <para>ST_Transform is often confused with <xref linkend="ST_SetSRID"/>.  ST_Transform actually changes the coordinates
    of a geometry from one spatial reference system to another, while ST_SetSRID() simply changes the SRID identifier of
    the geometry.</para>

    <para>ST_Transform automatically selects a suitable conversion pipeline given the source and target spatial
    reference systems. To use a specific conversion method, use <xref linkend="ST_TransformPipeline"/>.</para>

    <note>
      <para>Requires PostGIS be compiled with PROJ support.  Use <xref linkend="PostGIS_Full_Version"/> to confirm you have PROJ support compiled in.</para>
    </note>

    <note>
      <para>If using more than one transformation, it is useful to have a functional index on the commonly used
      transformations to take advantage of index usage.</para>
    </note>

    <note><para>Prior to 1.3.4, this function crashes if used with geometries that contain CURVES.  This is fixed in 1.3.4+</para></note>

    <para role="enhanced" conformance="2.0.0">Enhanced: 2.0.0 support for Polyhedral surfaces was introduced.</para>
    <para role="enhanced" conformance="2.3.0">Enhanced: 2.3.0 support for direct PROJ.4 text was introduced.</para>
    <para>&sqlmm_compliant; SQL-MM 3: 5.1.6</para>
    <para>&curve_support;</para>
    <para>&P_support;</para>

    </refsection>

    <refsection>
    <title>Examples</title>
    <para>Change Massachusetts state plane US feet geometry to WGS 84 long lat</para>
    <programlisting>
SELECT ST_AsText(ST_Transform(ST_GeomFromText('POLYGON((743238 2967416,743238 2967450,
  743265 2967450,743265.625 2967416,743238 2967416))',2249),4326)) As wgs_geom;

 wgs_geom
---------------------------
 POLYGON((-71.1776848522251 42.3902896512902,-71.1776843766326 42.3903829478009,
-71.1775844305465 42.3903826677917,-71.1775825927231 42.3902893647987,-71.177684
8522251 42.3902896512902));
(1 row)

--3D Circular String example
SELECT ST_AsEWKT(ST_Transform(ST_GeomFromEWKT('SRID=2249;CIRCULARSTRING(743238 2967416 1,743238 2967450 2,743265 2967450 3,743265.625 2967416 3,743238 2967416 4)'),4326));

         st_asewkt
--------------------------------------------------------------------------------------
 SRID=4326;CIRCULARSTRING(-71.1776848522251 42.3902896512902 1,-71.1776843766326 42.3903829478009 2,
 -71.1775844305465 42.3903826677917 3,
 -71.1775825927231 42.3902893647987 3,-71.1776848522251 42.3902896512902 4)

    </programlisting>
    <para>Example of creating a partial functional index.  For tables where you are not sure all the geometries
      will be filled in, its best to use a partial index that leaves out null geometries which will both conserve space and make your index smaller and more efficient.</para>
    <programlisting>
CREATE INDEX idx_geom_26986_parcels
  ON parcels
  USING gist
  (ST_Transform(geom, 26986))
  WHERE geom IS NOT NULL;
    </programlisting>

    <para>Examples of using PROJ.4 text to transform with custom spatial references.</para>
    <programlisting>
-- Find intersection of two polygons near the North pole, using a custom Gnomic projection
-- See http://boundlessgeo.com/2012/02/flattening-the-peel/
 WITH data AS (
   SELECT
     ST_GeomFromText('POLYGON((170 50,170 72,-130 72,-130 50,170 50))', 4326) AS p1,
     ST_GeomFromText('POLYGON((-170 68,-170 90,-141 90,-141 68,-170 68))', 4326) AS p2,
     '+proj=gnom +ellps=WGS84 +lat_0=70 +lon_0=-160 +no_defs'::text AS gnom
 )
 SELECT ST_AsText(
   ST_Transform(
     ST_Intersection(ST_Transform(p1, gnom), ST_Transform(p2, gnom)),
   gnom, 4326))
 FROM data;
                                          st_astext
 --------------------------------------------------------------------------------
  POLYGON((-170 74.053793645338,-141 73.4268621378904,-141 68,-170 68,-170 74.053793645338))
    </programlisting>

    </refsection>
    <refsection>
    <title>Configuring transformation behavior</title>
      <para>Sometimes coordinate transformation involving a grid-shift
        can fail, for example if PROJ.4 has not been built with
        grid-shift files or the coordinate does not lie within the
        range for which the grid shift is defined. By default, PostGIS
        will throw an error if a grid shift file is not present, but
        this behavior can be configured on a per-SRID basis either
        by testing different <varname>to_proj</varname> values of
        PROJ.4 text, or altering the <varname>proj4text</varname> value
        within the <varname>spatial_ref_sys</varname> table.
      </para>
        <para>For example, the proj4text parameter +datum=NAD87 is a shorthand form for the following +nadgrids parameter:</para>
        <programlisting>+nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat</programlisting>
        <para>The @ prefix means no error is reported if the files are not present, but if the end of the list is reached with no file having been appropriate (ie. found and overlapping) then an error is issued.</para>
        <para>If, conversely, you wanted to ensure that at least the standard files were present, but that if all files were scanned without a hit a null transformation is applied you could use:</para>
        <programlisting>+nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat,null</programlisting>
        <para>The null grid shift file is a valid grid shift file covering the whole world and applying no shift. So for a complete example, if you wanted to alter PostGIS so that transformations to SRID 4267 that didn't lie within the correct range did not throw an ERROR, you would use the following:</para>
        <programlisting>UPDATE spatial_ref_sys SET proj4text = '+proj=longlat +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat,null +no_defs' WHERE srid = 4267;</programlisting>
      </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>

    <para><xref linkend="spatial_ref_sys"/>, <xref linkend="ST_SetSRID"/>, <xref linkend="ST_SRID"/>, <xref linkend="UpdateGeometrySRID"/>, <xref linkend="ST_TransformPipeline"/></para>
    </refsection>
  </refentry>

  <refentry xml:id="ST_TransformPipeline">
    <refnamediv>
    <refname>ST_TransformPipeline</refname>

    <refpurpose>Return a new geometry with coordinates transformed to
      a different spatial reference system using a defined coordinate
      transformation pipeline.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <funcsynopsis>
            <funcprototype>
                <funcdef>geometry <function>ST_TransformPipeline</function></funcdef>
                <paramdef><type>geometry </type> <parameter>g1</parameter></paramdef>
                <paramdef><type>text </type> <parameter>pipeline</parameter></paramdef>
                <paramdef choice="opt"><type>integer </type> <parameter>to_srid</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
    <title>Description</title>

      <para>
      Return a new geometry with coordinates transformed to a different spatial reference system
      using a defined coordinate transformation pipeline.
      </para>

      <para>
      Transformation pipelines are defined using any of the following string formats:
        <itemizedlist>
          <listitem>
            <para>
              <varname>urn:ogc:def:coordinateOperation:AUTHORITY::CODE</varname>. Note that a simple
              <varname>EPSG:CODE</varname> string does not uniquely identify a coordinate operation:
              the same EPSG code can be used for a CRS definition.
            </para>
          </listitem>

          <listitem>
            <para>
            A PROJ pipeline string of the form: <varname>+proj=pipeline ...</varname>. Automatic
            axis normalisation will not be applied, and if necessary the caller will need to add an
            additional pipeline step, or remove <varname>axisswap</varname> steps.
            </para>
          </listitem>

          <listitem>
            <para>
            Concatenated operations of the form: <varname>urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618</varname>.
            </para>
          </listitem>
        </itemizedlist>
    </para>
    <para role="availability" conformance="3.4.0">Availability: 3.4.0</para>

    <para>
    The SRID of the input geometry is ignored, and the SRID of the output geometry will be set to
    zero unless a value is provided via the optional <varname>to_srid</varname> parameter. When
    using `ST_TransformPipeline()` the pipeline is executed in a forward direction. Using
   <xref linkend="ST_InverseTransformPipeline"/> the pipeline is executed in the inverse direction.</para>

    <para>Transforms using pipelines are a specialised version of <xref linkend="ST_Transform"/>.
    In most cases `ST_Transform` will choose the correct operations to convert between coordinate
    systems, and should be preferred.</para>

    </refsection>

    <refsection>
    <title>Examples</title>
    <para>Change WGS 84 long lat to UTM 31N using the EPSG:16031 conversion</para>
    <programlisting>
-- Forward direction
SELECT ST_AsText(ST_TransformPipeline('SRID=4326;POINT(2 49)'::geometry,
  'urn:ogc:def:coordinateOperation:EPSG::16031')) AS utm_geom;

                  utm_geom
--------------------------------------------
 POINT(426857.9877165967 5427937.523342293)
(1 row)

-- Inverse direction
SELECT ST_AsText(ST_InverseTransformPipeline('POINT(426857.9877165967 5427937.523342293)'::geometry,
  'urn:ogc:def:coordinateOperation:EPSG::16031')) AS wgs_geom;

          wgs_geom
----------------------------
 POINT(2 48.99999999999999)
(1 row)
    </programlisting>

    <para>GDA2020 example.</para>
    <programlisting>
-- using ST_Transform with automatic selection of a conversion pipeline.
SELECT ST_AsText(ST_Transform('SRID=4939;POINT(143.0 -37.0)'::geometry, 7844)) AS gda2020_auto;

                 gda2020_auto
-----------------------------------------------
 POINT(143.00000635638918 -36.999986706128176)
(1 row)

-- using a defined conversion (EPSG:8447)
SELECT ST_AsText(ST_TransformPipeline('SRID=4939;POINT(143.0 -37.0)'::geometry,
  'urn:ogc:def:coordinateOperation:EPSG::8447')) AS gda2020_code;

                   gda2020_code
----------------------------------------------
 POINT(143.0000063280214 -36.999986718287545)
(1 row)

-- using a PROJ pipeline definition matching EPSG:8447, as returned from
-- 'projinfo -s EPSG:4939 -t EPSG:7844'.
-- NOTE: any 'axisswap' steps must be removed.
SELECT ST_AsText(ST_TransformPipeline('SRID=4939;POINT(143.0 -37.0)'::geometry,
  '+proj=pipeline
   +step +proj=unitconvert +xy_in=deg +xy_out=rad
   +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_and_distortion.tif
   +step +proj=unitconvert +xy_in=rad +xy_out=deg')) AS gda2020_pipeline;

                   gda2020_pipeline
----------------------------------------------
 POINT(143.0000063280214 -36.999986718287545)
(1 row)
    </programlisting>
    </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>

    <para><xref linkend="ST_Transform"/>, <xref linkend="ST_InverseTransformPipeline"/></para>
    </refsection>
  </refentry>


  <refentry xml:id="postgis_srs_codes">
    <refnamediv>
    <refname>postgis_srs_codes</refname>

    <refpurpose>Return the list of SRS codes associated with the given authority.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <funcsynopsis>
            <funcprototype>
                <funcdef>setof text <function>postgis_srs_codes</function></funcdef>
                <paramdef><type>text </type> <parameter>auth_name</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
      <title>Description</title>

      <para>Returns a set of all <varname>auth_srid</varname> for the given <varname>auth_name</varname>.</para>

      <para role="availability" conformance="3.4.0">Availability: 3.4.0</para>
      <para>Proj version 6+</para>

    </refsection>

    <refsection>
      <title>Examples</title>
      <para>List the first ten codes associated with the EPSG authority.</para>
      <programlisting>
SELECT * FROM postgis_srs_codes('EPSG') LIMIT 10;

 postgis_srs_codes
-------------------
 2000
 20004
 20005
 20006
 20007
 20008
 20009
 2001
 20010
 20011
    </programlisting>
    </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>
    <para><xref linkend="postgis_srs"/>, <xref linkend="postgis_srs_all"/>, <xref linkend="postgis_srs_search"/></para>
    </refsection>

  </refentry>


  <refentry xml:id="postgis_srs">
    <refnamediv>
    <refname>postgis_srs</refname>

    <refpurpose>Return a metadata record for the requested authority and srid.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <funcsynopsis>
            <funcprototype>
                <funcdef>setof record <function>postgis_srs</function></funcdef>
                <paramdef><type>text </type> <parameter>auth_name</parameter></paramdef>
                <paramdef><type>text </type> <parameter>auth_srid</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
      <title>Description</title>

      <para>Returns a metadata record for the requested <varname>auth_srid</varname> for the given <varname>auth_name</varname>. The record will have the <varname>auth_name</varname>, <varname>auth_srid</varname>, <varname>srname</varname>, <varname>srtext</varname>, <varname>proj4text</varname>, and the corners of the area of usage, <varname>point_sw</varname> and <varname>point_ne</varname>.</para>

      <para role="availability" conformance="3.4.0">Availability: 3.4.0</para>
      <para>Proj version 6+</para>

    </refsection>

    <refsection>
      <title>Examples</title>
      <para>Get the metadata for EPSG:3005.</para>
      <programlisting>
SELECT * FROM postgis_srs('EPSG', '3005');

auth_name | EPSG
auth_srid | 3005
srname    | NAD83 / BC Albers
srtext    | PROJCS["NAD83 / BC Albers", ... ]]
proj4text | +proj=aea +lat_0=45 +lon_0=-126 +lat_1=50 +lat_2=58.5 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs
point_sw  | 0101000020E6100000E17A14AE476161C00000000000204840
point_ne  | 0101000020E610000085EB51B81E855CC0E17A14AE47014E40
    </programlisting>
    </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>
    <para><xref linkend="postgis_srs_codes"/>, <xref linkend="postgis_srs_all"/>, <xref linkend="postgis_srs_search"/></para>
    </refsection>

  </refentry>


  <refentry xml:id="postgis_srs_all">
    <refnamediv>
    <refname>postgis_srs_all</refname>

    <refpurpose>Return metadata records for every spatial reference system in the underlying Proj database.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <funcsynopsis>
            <funcprototype>
                <funcdef>setof record <function>postgis_srs_all</function></funcdef>
                <void/>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
      <title>Description</title>

      <para>Returns a set of all metadata records in the underlying Proj database. The records will have the <varname>auth_name</varname>, <varname>auth_srid</varname>, <varname>srname</varname>, <varname>srtext</varname>, <varname>proj4text</varname>, and the corners of the area of usage, <varname>point_sw</varname> and <varname>point_ne</varname>.</para>

      <para role="availability" conformance="3.4.0">Availability: 3.4.0</para>
      <para>Proj version 6+</para>

    </refsection>

    <refsection>
      <title>Examples</title>
      <para>Get the first 10 metadata records from the Proj database.</para>
      <programlisting>
SELECT auth_name, auth_srid, srname FROM postgis_srs_all() LIMIT 10;

 auth_name | auth_srid |                  srname
-----------+-----------+------------------------------------------
 EPSG      | 2000      | Anguilla 1957 / British West Indies Grid
 EPSG      | 20004     | Pulkovo 1995 / Gauss-Kruger zone 4
 EPSG      | 20005     | Pulkovo 1995 / Gauss-Kruger zone 5
 EPSG      | 20006     | Pulkovo 1995 / Gauss-Kruger zone 6
 EPSG      | 20007     | Pulkovo 1995 / Gauss-Kruger zone 7
 EPSG      | 20008     | Pulkovo 1995 / Gauss-Kruger zone 8
 EPSG      | 20009     | Pulkovo 1995 / Gauss-Kruger zone 9
 EPSG      | 2001      | Antigua 1943 / British West Indies Grid
 EPSG      | 20010     | Pulkovo 1995 / Gauss-Kruger zone 10
 EPSG      | 20011     | Pulkovo 1995 / Gauss-Kruger zone 11    </programlisting>
    </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>
    <para><xref linkend="postgis_srs_codes"/>, <xref linkend="postgis_srs"/>, <xref linkend="postgis_srs_search"/></para>
    </refsection>

  </refentry>




  <refentry xml:id="postgis_srs_search">
    <refnamediv>
    <refname>postgis_srs_search</refname>

    <refpurpose>Return metadata records for projected coordinate systems that have areas of usage that fully contain the bounds parameter.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <funcsynopsis>
            <funcprototype>
                <funcdef>setof record <function>postgis_srs_search</function></funcdef>
                <paramdef><type>geometry </type> <parameter>bounds</parameter></paramdef>
                <paramdef choice="opt"><type>text </type> <parameter>auth_name=EPSG</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>

    <refsection>
      <title>Description</title>

      <para>Return a set of metadata records for projected coordinate systems that have areas of usage that fully contain the bounds parameter. Each record will have the <varname>auth_name</varname>, <varname>auth_srid</varname>, <varname>srname</varname>, <varname>srtext</varname>, <varname>proj4text</varname>, and the corners of the area of usage, <varname>point_sw</varname> and <varname>point_ne</varname>.
      </para>

      <para>The search only looks for projected coordinate systems, and is intended for users to explore the possible systems that work for the extent of their data.</para>

      <para role="availability" conformance="3.4.0">Availability: 3.4.0</para>
      <para>Proj version 6+</para>

    </refsection>

    <refsection>
      <title>Examples</title>
      <para>Search for projected coordinate systems in Louisiana.</para>
      <programlisting>
SELECT auth_name, auth_srid, srname,
  ST_AsText(point_sw) AS point_sw,
  ST_AsText(point_ne) AS point_ne
FROM postgis_srs_search('SRID=4326;LINESTRING(-90 30, -91 31)')
LIMIT 3;

 auth_name | auth_srid |                srname                |      point_sw       |      point_ne
-----------+-----------+--------------------------------------+---------------------+---------------------
 EPSG      | 2801      | NAD83(HARN) / Louisiana South        | POINT(-93.94 28.85) | POINT(-88.75 31.07)
 EPSG      | 3452      | NAD83 / Louisiana South (ftUS)       | POINT(-93.94 28.85) | POINT(-88.75 31.07)
 EPSG      | 3457      | NAD83(HARN) / Louisiana South (ftUS) | POINT(-93.94 28.85) | POINT(-88.75 31.07)
</programlisting>

      <para>Scan a table for max extent and find projected coordinate systems that might suit.</para>

      <programlisting>
WITH ext AS (
  SELECT ST_Extent(geom) AS geom, Max(ST_SRID(geom)) AS srid
  FROM foo
)
SELECT auth_name, auth_srid, srname,
  ST_AsText(point_sw) AS point_sw,
  ST_AsText(point_ne) AS point_ne
FROM ext
CROSS JOIN postgis_srs_search(ST_SetSRID(ext.geom, ext.srid))
LIMIT 3;</programlisting>

    </refsection>

    <!-- Optionally add a "See Also" section -->
    <refsection>
    <title>See Also</title>
    <para><xref linkend="postgis_srs_codes"/>, <xref linkend="postgis_srs_all"/>, <xref linkend="postgis_srs"/></para>
    </refsection>

  </refentry>



  </section>