# 17.05 - Example: Using the ST_Geometry Data Type to Represent Other Geospatial Data Types for INSERTs - Advanced SQL Engine - Teradata Database

## Teradata Vantage™ - SQL Data Manipulation Language

Product
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
vnq1596660420420.ditamap
dita:ditavalPath
hoy1596145193032.ditaval

You can use the ST_Geometry data type to represent implicitly all of the geospatial data types defined by the ANSI SQL:2011 standard, as indicated by the following set of examples. See Teradata Vantage™ - Geospatial Data Types , B035-1181 . Note that in every case, the geospatial values are actually stored using the ST_Geometry data type, not the type specified in the INSERT request.

The POINT type has a 0-dimensional geometry and represents a single location in two-dimensional coordinate space.

The following example inserts such a point into table tab1:

`     INSERT INTO tab1 VALUES (0, 'POINT(10 20)');`

The LINESTRING type has a 1-dimensional geometry and is usually stored as a sequence of points with a linear interpolation between the individual points.

The following example inserts such a point sequence into table tab1:

`     INSERT INTO tab1 VALUES (0, 'LINESTRING(1 1, 2 2, 3 3, 4 4)');`

The POLYGON type has a 2-dimensional geometry consisting of one exterior boundary and 0 or more interior boundaries, where each interior boundary defines a hole.

The following example inserts such a polygon into table tab1:

```     INSERT INTO tab1 VALUES (0, 'POLYGON((0 0, 0 20, 20 20, 20 0, 0 0),
(5 5, 5 10, 10 10, 10 5, 5 5))
');```

The GEOMCOLLECTION type is a collection of 0 or more ST_Geometry values.

The following example inserts such a geometric collection into table tab1:

```     INSERT INTO tab1 VALUES (0, 'GEOMETRYCOLLECTION(
POINT(10 10),
POINT(30 30),
LINESTRING(15 15, 20 20 ) )');```

The MULTIPOINT type is a 0-dimensional geometry collection whose elements are restricted to POINT values.

The following example inserts such a geometric collection into table tab1:

`     INSERT INTO tab1 VALUES (0,'MULTIPOINT(1 1, 1 3, 6 3, 10 5, 20 1)');`

The MULTILINESTRING type is a 1-dimensional geometry collection whose elements are restricted to LINESTRING values.

The following example inserts such a geometric collection into table tab1:

```     INSERT INTO tab1 VALUES (0, 'MULTILINESTRING((1 1, 1 3, 6 3),
(10 5, 20 1))');```

The MULTIPOLYGON type is a 2-dimensional geometry collection whose elements are restricted to POLYGON values.

The following example inserts such a geometric collection into table tab1:

```     INSERT INTO tab1 VALUES (0,'MULTIPOLYGON(
((1 1, 1 3, 6 3, 6 0, 1 1)),
((10 5, 10 10, 20 10, 20 5, 10 5)))');```
{"ft_lang_label":"__label__en","ft_lang_prob":0.71182424,"math_prob":0.9438921,"size":2289,"snap":"2022-40-2023-06","text_gpt3_token_len":627,"char_repetition_ratio":0.1273523,"word_repetition_ratio":0.21715818,"special_character_ratio":0.29226735,"punctuation_ratio":0.14806867,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9630197,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-01-31T10:25:17Z\",\"WARC-Record-ID\":\"<urn:uuid:49203901-6bee-4131-b358-0624f19e82a1>\",\"Content-Length\":\"294396\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7e8e82a1-d173-4c1b-949b-fc414eec7941>\",\"WARC-Concurrent-To\":\"<urn:uuid:0aa3b640-c1fa-4139-938d-1d613aa59ce9>\",\"WARC-IP-Address\":\"3.20.118.177\",\"WARC-Target-URI\":\"https://docs.teradata.com/r/Teradata-VantageTM-SQL-Data-Manipulation-Language/January-2021/Statement-Syntax/INSERT/INSERT-...-SELECT/Examples/Example-Using-the-ST_Geometry-Data-Type-to-Represent-Other-Geospatial-Data-Types-for-INSERTs\",\"WARC-Payload-Digest\":\"sha1:3J7JPTO35RGWVOO4HNHSWZTF5ELY6Q2F\",\"WARC-Block-Digest\":\"sha1:QUIQFH5SWQM5OVZ42YLMU3ZXXZTGNAZE\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764499857.57_warc_CC-MAIN-20230131091122-20230131121122-00007.warc.gz\"}"}