File: reference_type.xml

package info (click to toggle)
postgis 2.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 75,792 kB
  • sloc: ansic: 139,314; sql: 136,281; xml: 48,954; sh: 4,906; perl: 4,509; makefile: 2,897; python: 1,198; yacc: 441; cpp: 305; lex: 132
file content (184 lines) | stat: -rw-r--r-- 6,464 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
  <sect1 id="PostGIS_Types">
    <sect1info>
    <abstract>
    <para>This section lists the PostgreSQL data types installed by PostGIS.  Note we describe the casting behavior of these which is very
	important especially when designing your own functions.
    </para>
    <para>A Cast is when one type is coerced into another type.  PostgreSQL
	is unique from most databases in that it allows you to define casting behavior for custom types and the functions used for casting.
	A cast can be specified as automatic in which case, you do not have to do a CAST(myfoo As otherfootype) or myfoo::otherfootype
	if you are feeding it to a function that only works with otherfootype and there is an automatic cast in place for it.
    </para>
    <para>The danger of relying on automatic cast behavior is when you have an overloaded function say one that takes a box2d and one that takes a box3d
	but no geometry.  What happens is that both functions are equally good to use with geometry since geometry has an autocast for both
	-- so you end up with an ambiguous function error. To force PostgreSQL to choose, you do a CAST(mygeom As box3d)  or mygeom::box3d.</para>

    <para><emphasis>At least as of PostgreSQL 8.3</emphasis> - Everything can be CAST to text (presumably because of the magical unknown type), so no defined CASTS for that need to be present for you to CAST an object to text.</para>
    </abstract>
    </sect1info>
    <title>PostgreSQL PostGIS Geometry/Geography/Box Types</title>

	<refentry id="box2d_type">
      <refnamediv>
        <refname>box2d</refname>
        <refpurpose>A box composed of x min, ymin,  xmax, ymax.  Often used to return the 2d enclosing box of a geometry. </refpurpose>
      </refnamediv>

      <refsection>
        <title>Description</title>
        <para>box2d is a spatial data type used to represent the enclosing box of a geometry or set of geometries. ST_Extent in earlier versions prior to PostGIS 1.4 would return a box2d.</para>
      </refsection>
    </refentry>
	<refentry id="box3d_type">
      <refnamediv>
        <refname>box3d</refname>
        <refpurpose>A box composed of x min, ymin, zmin, xmax, ymax, zmax.  Often used to return the 3d extent of a geometry or collection of geometries. </refpurpose>
      </refnamediv>

      <refsection>
        <title>Description</title>
        <para>box3d is a postgis spatial data type used to represent the enclosing box of a geometry or set of geometries. ST_3DExtent returns a box3d object.</para>
      </refsection>

      <refsection>
		<title>Casting Behavior</title>
		<para>This section lists the automatic as well as explicit casts allowed for this data type</para>
		<informaltable rowsep="1" frame="all">
		<tgroup cols="2">
			<tbody>
			  <row>
				<entry>Cast To</entry>
				<entry>Behavior</entry>
			  </row>
			  <row>
				<entry>box</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>box2d</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>geometry</entry>
				<entry>automatic</entry>
			  </row>
			</tbody>
		</tgroup>
		</informaltable>
		</refsection>
    </refentry>

	<refentry id="geometry">
		<refnamediv>
			<refname>geometry</refname>
			<refpurpose>Planar spatial data type.</refpurpose>
		</refnamediv>

		<refsection>
			<title>Description</title>
			<para>geometry is a fundamental PostGIS spatial data type used to represent a feature in the Euclidean coordinate system.</para>
			<para>All spatial operations on geometry are using units of the Spatial Reference System the geomtry is in.</para>
		</refsection>

		<refsection>
		<title>Casting Behavior</title>
		<para>This section lists the automatic as well as explicit casts allowed for this data type</para>
		<informaltable rowsep="1" frame="all">
		<tgroup cols="2">
			<tbody>
			  <row>
				<entry>Cast To</entry>
				<entry>Behavior</entry>
			  </row>
			  <row>
				<entry>box</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>box2d</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>box3d</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>bytea</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>geography</entry>
				<entry>automatic</entry>
			  </row>
			  <row>
				<entry>text</entry>
				<entry>automatic</entry>
			  </row>
			</tbody>
		</tgroup>
		</informaltable>
		</refsection>

		<refsection>
			<title>See Also</title>
			<para><xref linkend="RefObject" /></para>
		</refsection>
	</refentry>

	<refentry id="geometry_dump">
		<refnamediv>
			<refname>geometry_dump</refname>
			<refpurpose>A spatial datatype with two fields - geom (holding a geometry object)
				and path[] (a 1-d array holding the position of the geometry within the dumped object.)</refpurpose>
		</refnamediv>

		<refsection>
		<title>Description</title>
		<para>geometry_dump is a compound data type consisting of a geometry object referenced by the .geom field
			and path[] a 1-dimensional integer array (starting at 1 e.g. path[1] to get first element) array that defines the navigation path within the dumped geometry to find this element.
			It is used by the ST_Dump* family of functions as an output type to explode a more complex geometry into its
				constituent parts and location of parts.</para>
		</refsection>
		<refsection>
			<title>See Also</title>
			<para><xref linkend="PostGIS_Geometry_DumpFunctions" /> </para>
		</refsection>
	</refentry>

	<refentry id="geography">
		<refnamediv>
			<refname>geography</refname>
			<refpurpose>Ellipsoidal spatial data type.</refpurpose>
		</refnamediv>

		<refsection>
		<title>Description</title>
		<para>geography is a spatial data type used to represent a feature in the round-earth coordinate system.</para>
		</refsection>

		<refsection>
		<title>Casting Behavior</title>
		<para>This section lists the automatic as well as explicit casts allowed for this data type</para>
		<informaltable rowsep="1" frame="all">
		<tgroup cols="2">
			<tbody>
			  <row>
				<entry>Cast To</entry>
				<entry>Behavior</entry>
			  </row>
			  <row>
				<entry>geometry</entry>
				<entry>explicit</entry>
			  </row>
			</tbody>
		</tgroup>
		</informaltable>
		</refsection>

		<refsection>
			<title>See Also</title>
			<para><xref linkend="PostGIS_GeographyFunctions" />, <xref linkend="PostGIS_Geography" /></para>
		</refsection>
	</refentry>
  </sect1>