doc-exports/docs/dws/tool/dws_16_0111.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
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>
2024-05-16 07:35:25 +00:00

117 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001819416193"></a><a name="EN-US_TOPIC_0000001819416193"></a>
<h1 class="topictitle1">Spatial Data Types</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_section1285618483234"><h4 class="sectiontitle">Overview</h4><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_p11692185562311">MySQL has spatial data types corresponding to the OpenGIS class. DSC supports the following type conversions:</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_section612235815232"><h4 class="sectiontitle">Type Mapping</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_table416618512410" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Spatial type mapping</caption><thead align="left"><tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row171679516415"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.2.4.1.1"><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p171678594113">MySQL Spatial Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.2.4.1.2"><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p31671512417">MySQL INPUT</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.2.4.1.3"><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p1672435312473">GaussDB(DWS) OUTPUT</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row1316714518414"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p9167452410">GEOMETRY</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p131679534116">GEOMETRY</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p616735134110">GEOMETRY</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row13167254414"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p816745164117">POINT</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p216712519418">POINT</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p61673554117">POINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row71677514410"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p10167175204110">LINESTRING</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p201678544113">LINESTRING</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p116719511413">POLYGON</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row1516745114117"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p316710517417">POLYGON</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p016714515413">POLYGON</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p71675510419">POLYGON</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row31671534112"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p131679564115">MULTIPOINT</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p141671456416">MULTIPOINT</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p316718510411">BOX</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row201678584118"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p13167259411">MULTILINESTRING</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p21672511417">MULTILINESTRING</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p1716795184111">BOX</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row101671657412"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p41679524119">MULTIPOLYGON</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p131671510417">MULTIPOLYGON</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p216715510415">POLYGON</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_row1616711518419"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p81681755411">GEOMETRYCOLLECTION</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p1916865124117">GEOMETRYCOLLECTION</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p916875204119">GEOMETRYCOLLECTION</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164385_note1544699172110"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_ul437662813153"><li id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_li237602801512">GEOMETRY can store geometry values of any type. The other single-value types (POINT, LINESTRING, and POLYGON) restrict their values to a particular geometry type.</li><li id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_li1437702815152">GEOMETRYCOLLECTION can store a collection of objects of any type. The other collection types (MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION) restrict collection members to those having a particular geometry type.</li></ul>
</div></div>
<ul id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_ul1061615108448"><li id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_li2090742314415"><p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p989113244418"><a name="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_li2090742314415"></a><a name="en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_li2090742314415"></a><strong id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_b1146374914447">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_screen2523452194418">CREATE TABLE `t_geo_test2` (
`id` int(11) NOT NULL,
`name` varchar(255),
`geometry_1` geometry NOT NULL,
`point_1` point NOT NULL,
`linestring_1` linestring NOT NULL,
`polygon_1` polygon NOT NULL,
`multipoint_1` multipoint NOT NULL,
`multilinestring_1` multilinestring NOT NULL,
`multipolygon_1` multipolygon NOT NULL,
`geometrycollection_1` geometrycollection NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB;</pre>
<p id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_p885717332454"><strong id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_b5469194384514">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001819416193__en-us_topic_0000001658024674_en-us_topic_0000001383828612_en-us_topic_0214164710_screen19963745134517">CREATE TABLE "public"."t_geo_test2"
(
"id" INTEGER(11) NOT NULL,
"name" VARCHAR(255),
"geometry_1" GEOMETRY NOT NULL,
"point_1" POINT NOT NULL,
"linestring_1" POLYGON NOT NULL,
"polygon_1" POLYGON NOT NULL,
"multipoint_1" BOX NOT NULL,
"multilinestring_1" BOX NOT NULL,
"multipolygon_1" POLYGON NOT NULL,
"geometrycollection_1" GEOMETRYCOLLECTION NOT NULL,
PRIMARY KEY ("id")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("id");</pre>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0106.html">Data Types</a></div>
</div>
</div>