Preparing for Geometry Query
- Create a DLI table named geotbl.
create table geotbl(id String,name String,loadtime date,location String)
- Insert data into the table. In this step, insert the space data coordinates represented by the WKT string into the location field. Sample code is provided as follows:
insert into geotbl select '1','amy','2015-05-01','POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))'
insert into geotbl select '2','amy','2015-05-01','POLYGON ((60 10,70 60,80 0,60 10))'
insert into geotbl select '3','amy','2015-05-01','MULTIPOLYGON (((30 20, 45 40, 10 40, 30 20)), ((15 5, 40 10, 10 20, 5 10, 15 5)))'
insert into geotbl select '4','amy','2015-05-01','POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30))'
insert into geotbl select '5','amy','2015-05-01','LINESTRING (30 10, 40 40, 20 40, 10 20, 30 10)'
insert into geotbl select '6','amy','2015-05-01','POINT (11 22)'
insert into geotbl select '7','amy','2015-05-01','MULTILINESTRING ((30 10, 40 40, 20 40, 10 20, 30 10),(30 10, 40 40, 20 40, 10 20, 30 10))'
insert into geotbl select '8','amy','2015-05-01','MULTIPOINT ((11 22),(10 22))'
The subsequent query examples are illustrated based on this table.
This version does not support the functions of directly creating tables with space type fields and importing spatial data in batches.
Last Article: Support of Geometry Query Functions
Next Article: Geometry Constructors
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.