forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
139 lines
14 KiB
HTML
139 lines
14 KiB
HTML
<a name="EN-US_TOPIC_0000001188429056"></a><a name="EN-US_TOPIC_0000001188429056"></a>
|
|
|
|
<h1 class="topictitle1">Geometric Types</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001188429056__a357a09c1a4eb49c7aa577f6187f01cc1"><a href="#EN-US_TOPIC_0000001188429056__t6242ed1ede044daab7e8e566a9568667">Table 1</a> lists the geometric types that can be used in <span id="EN-US_TOPIC_0000001188429056__text1750740401">GaussDB(DWS)</span>. The most fundamental type, the point, forms the basis for all of the other types.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188429056__t6242ed1ede044daab7e8e566a9568667"></a><a name="t6242ed1ede044daab7e8e566a9568667"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188429056__t6242ed1ede044daab7e8e566a9568667" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Geometric Type</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188429056__ra143dca3ac9540828c4b225554c267e3"><th align="left" class="cellrowborder" valign="top" width="12.408759124087592%" id="mcps1.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000001188429056__aa32aa94c6f9e498ca429088eb4ed6257">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.858214178582145%" id="mcps1.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000001188429056__aeedaf76112a24985abde084d265de644">Storage Space</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="38.15618438156184%" id="mcps1.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000001188429056__a61a9b718aa1b4d0b9b6a59deb6efeb41">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="31.576842315768427%" id="mcps1.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000001188429056__ac3610d5ad8dc40cd8252a532d41f3c5d"><strong id="EN-US_TOPIC_0000001188429056__b84235270616554">Representation</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188429056__rec356482d46d4ed0b7dfc8e4107c282d"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__a48722f034a5b4921a94986be91962b48">point</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__ae0b03e51a2e74cc9b4b9c4d93d652890">16 bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__a15cbd265159d431d8411124f18a86ec6">Point on a plane</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__a48f8dd4e21ee47e487c031328134b8e9">(x,y)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188429056__r001be08f7a754a05b7f09b612c786716"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__aa10e89373558465e8a308506d202c7e5">lseg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__a159fb64a87fe42539af3135650c8eec1">32 bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__af1527ca3a76a42d393ca732cb8bcb4e4">Finite line segment</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__a82d20dca7934404d82d7c9954fa635f3">((x1,y1),(x2,y2))</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188429056__r0cd5f2e451434fecb782b69d30328fe4"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__aa480ac5e083e410b9752629fb478ad46">box</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__a65100758b58449eb9efdcd8237b9c8a5">32 bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__a9babcf26ab9a4a9aaf0b638f27abee9d">Rectangular Box</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__a5ce06dcdbfc04aae844aa9a627d8906f">((x1,y1),(x2,y2))</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188429056__r5da42dd4b0b34e97865c8e9bd1a172a1"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__a6607a416828142efbec5e6ba034ab2d3">path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__a53127e45e01a4747a5e089f5fa531ebb">16+16n bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__a56ca1408c8ae455298d758db3419fe4c">Closed path (similar to polygon)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__ae2ad03ed4eb64021bdff889d4409ded7">((x1,y1),...)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188429056__r8fe7a9d88a7f4fa2802d216352d0d40b"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__aa159b21adecd483ea7bae41ebf676e2b">path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__a222ba5e59f6d403eb9bb6395daa27f31">16+16n bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__aac55b94676b342afbfdb3041f60187d1">Open path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__aaad95024a7af4c99a9dc1286b35aba98">[(x1,y1),...]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188429056__rbded6965f1aa44eea43505a8519acadd"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__ade6450e09ad44aa8944b380c226c10a3">polygon</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__a9fb0d1b8a92c420ba8dc640df7ad2144">40+16n bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__a9378a2b836614fa6807298738af20161">Polygon (similar to closed path)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__afbcc784a6f4b4bec872ff02c378dd33d">((x1,y1),...)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188429056__r96b723b645c24ea38537d1e670f63cf8"><td class="cellrowborder" valign="top" width="12.408759124087592%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188429056__abf830ab27cf34dff87cedc0345aaaefb">circle</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188429056__ab558ba016f1e414db1cd08a03c9d605e">24 bytes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.15618438156184%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188429056__aa156090d76a74728b404567805d459cb">Circle</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.576842315768427%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188429056__aac62086a5a5f466abf9591834505e1cd"><(x,y),r> (center point and radius)</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429056__a79b10eb4cba04900b105befd884325b5">A rich set of functions and operators is available in <span id="EN-US_TOPIC_0000001188429056__text1999782540">GaussDB(DWS)</span> to perform various geometric operations, such as scaling, translation, rotation, and determining intersections. For details, see <a href="dws_06_0037.html">Geometric Functions and Operators</a>.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429056__s0aaa0cf0880147a38952aa9aa2f6da99"><h4 class="sectiontitle"><strong id="EN-US_TOPIC_0000001188429056__b84235270685248">Points</strong></h4><p id="EN-US_TOPIC_0000001188429056__a653bbda6084048da96398241c984e92f">Points are the fundamental two-dimensional building block for geometric types. Values of the <strong id="EN-US_TOPIC_0000001188429056__b84235270617916">point</strong> type are specified using either of the following syntaxes:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188429056__s1c07794b79a045069a3a96477077bb34">( x , y )
|
|
x , y</pre>
|
|
<p id="EN-US_TOPIC_0000001188429056__ad563b81fa7e146eda9dad4c2b7bbcade">where x and y are the respective coordinates, as floating-point numbers.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__a2390f2c3df1645258b5f37bb20618836">Points are output using the first syntax.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429056__s0388e9a207514f0a9e93cab35ceaec38"><h4 class="sectiontitle"><strong id="EN-US_TOPIC_0000001188429056__b84235270685255">Line Segments</strong></h4><p id="EN-US_TOPIC_0000001188429056__a27086174636c4171880e311a26c81387">Line segments (<strong id="EN-US_TOPIC_0000001188429056__b842352706171022">lseg</strong>) are represented by pairs of points. Values of the <strong id="EN-US_TOPIC_0000001188429056__b842352706171059">lseg</strong> type are specified using any of the following syntaxes:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188429056__sf6e9d0be257f4fb980b2a8bbc098b533">[ ( x1 , y1 ) , ( x2 , y2 ) ]
|
|
( ( x1 , y1 ) , ( x2 , y2 ) )
|
|
( x1 , y1 ) , ( x2 , y2 )
|
|
x1 , y1 , x2 , y2</pre>
|
|
<p id="EN-US_TOPIC_0000001188429056__abcd4ad5915af4f20b14efdc0272c7d99">where (x1,y1) and (x2,y2) are the end points of the line segment.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__ac2ae4bba2da64c1a9f1d7d5d54da7ad3">Line segments are output using the first syntax.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429056__s085d89d46c1943e5b420d1a6d430bdad"><h4 class="sectiontitle">Rectangular Box</h4><p id="EN-US_TOPIC_0000001188429056__a5f4dbbbf552249b69817eb05b19e282f">Boxes are represented by pairs of points that are opposite corners of the box. Values of the <strong id="EN-US_TOPIC_0000001188429056__b1118999128">box</strong> type are specified using any of the following syntaxes:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188429056__s243a717af48a4a4688ff7f0e2ea81876">( ( x1 , y1 ) , ( x2 , y2 ) )
|
|
( x1 , y1 ) , ( x2 , y2 )
|
|
x1 , y1 , x2 , y2</pre>
|
|
<p id="EN-US_TOPIC_0000001188429056__a308ff030a8a5426ca23145e7225d4abd">where (x1,y1) and (x2,y2) are any two opposite corners of the box.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__af22f2c82b2414f03a4f35a346f23b12f">Boxes are output using the second syntax.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__acea42faaad764ffdb4845ff5862a3ba4">Any two opposite corners can be supplied on input, but in this order, the values will be reordered as needed to store the upper right and lower left corners.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429056__s3cff575387454e63a0a6352b9e8785d0"><h4 class="sectiontitle">Path</h4><p id="EN-US_TOPIC_0000001188429056__a0945e9970b3441a5832faa9727aaebab">Paths are represented by lists of connected points. Paths can be open, where the first and last points in the list are considered not connected, or closed, where the first and last points are considered connected.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__af0d502f4f5cc42fe9b083f39c88f96a4">Values of the <strong id="EN-US_TOPIC_0000001188429056__b83712629">path</strong> type are specified using any of the following syntaxes:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188429056__safeef6e8180e4945bfaf1d90bfe96baa">[ ( x1 , y1 ) , ... , ( xn , yn ) ]
|
|
( ( x1 , y1 ) , ... , ( xn , yn ) )
|
|
( x1 , y1 ) , ... , ( xn , yn )
|
|
( x1 , y1 , ... , xn , yn )
|
|
x1 , y1 , ... , xn , yn</pre>
|
|
<p id="EN-US_TOPIC_0000001188429056__a1fc522b84b684dd3be1d91a28480374f">where the points are the end points of the line segments comprising the path. Square brackets ([]) indicate an open path, while parentheses (()) indicate a closed path. When the outermost parentheses are omitted, as in the third through fifth syntaxes, a closed path is assumed.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__a0643d61dd48545b894ccabe276335616">Paths are output using the first or second syntax.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429056__s57080fc5624f4c9eba669d7a18e7ae6e"><h4 class="sectiontitle"><strong id="EN-US_TOPIC_0000001188429056__b8423527069322">Polygons</strong></h4><p id="EN-US_TOPIC_0000001188429056__a162c65e991504cceadd2d5edc2f587e0">Polygons are represented by lists of points (the vertexes of the polygon). Polygons are very similar to closed paths, but are stored differently and have their own set of support functions.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__a14362732476140dfa54967b05fd87f2e">Values of the <strong id="EN-US_TOPIC_0000001188429056__b485049852">polygon</strong> type are specified using any of the following syntaxes:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188429056__sd35caa5e716349fa95bdd8bf47edc208">( ( x1 , y1 ) , ... , ( xn , yn ) )
|
|
( x1 , y1 ) , ... , ( xn , yn )
|
|
( x1 , y1 , ... , xn , yn )
|
|
x1 , y1 , ... , xn , yn</pre>
|
|
<p id="EN-US_TOPIC_0000001188429056__a7d7afec5e88245c2abe663da43fd0897">where the points are the end points of the line segments comprising the boundary of the polygon.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__a3d0fe261d737488eb056572e2b81ddeb">Polygons are output using the first syntax.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429056__s6e4a17afabf14734ad59a7b3d0113e09"><h4 class="sectiontitle">Circle</h4><p id="EN-US_TOPIC_0000001188429056__a3aa92fccb90948d7a32413d933d43195">Circles are represented by a center point and radius. Values of the <strong id="EN-US_TOPIC_0000001188429056__b1544145463">circle</strong> type are specified using any of the following syntaxes:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188429056__se05f53e263d54f27a849757f7afa31ed">< ( x , y ) , r >
|
|
( ( x , y ) , r )
|
|
( x , y ) , r
|
|
x , y , r</pre>
|
|
<p id="EN-US_TOPIC_0000001188429056__a5d80415102d54f2d953b9d5701ba16db">where <strong id="EN-US_TOPIC_0000001188429056__b842352706111634">(x,y)</strong> is the center point and <strong id="EN-US_TOPIC_0000001188429056__b842352706111637">r</strong> is the radius of the circle.</p>
|
|
<p id="EN-US_TOPIC_0000001188429056__a8946b31a0ff74c57bf8ee3c6e482b458">Circles are output using the first syntax.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0008.html">Data Types</a></div>
|
|
</div>
|
|
</div>
|
|
|