Spatial Data Types
Overview
MySQL has spatial data types corresponding to the OpenGIS class. DSC supports the following type conversions:
Type Mapping
MySQL Spatial Type |
MySQL INPUT |
GaussDB(DWS) OUTPUT |
---|---|---|
GEOMETRY |
GEOMETRY |
GEOMETRY |
POINT |
POINT |
POINT |
LINESTRING |
LINESTRING |
POLYGON |
POLYGON |
POLYGON |
POLYGON |
MULTIPOINT |
MULTIPOINT |
BOX |
MULTILINESTRING |
MULTILINESTRING |
BOX |
MULTIPOLYGON |
MULTIPOLYGON |
POLYGON |
GEOMETRYCOLLECTION |
GEOMETRYCOLLECTION |
GEOMETRYCOLLECTION |
- 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.
- 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.
-
1 2 3 4 5 6 7 8 9 10 11 12 13
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;
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
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");
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot