Skip to content
Permalink
Browse files

[Oracle][Tests] Enhance Geometry creation SQL script

  • Loading branch information
rldhont authored and nyalldawson committed May 4, 2018
1 parent 849278a commit 280018dc5f794a9d8b51a201c28c107aa6112b9a
Showing with 20 additions and 20 deletions.
  1. +20 −20 tests/testdata/provider/testdata_oracle.sql
@@ -37,29 +37,29 @@ INSERT INTO QGIS.POINT_DATA ("pk", GEOM)

CREATE TABLE QGIS.LINE_DATA ( "pk" INTEGER PRIMARY KEY, GEOM SDO_GEOMETRY);
INSERT INTO QGIS.LINE_DATA ("pk", GEOM)
SELECT 1, SDO_UTIL.FROM_WKTGEOMETRY('LINESTRING(1 2, 3 4, 5 6)') from dual
UNION ALL SELECT 2, SDO_UTIL.FROM_WKTGEOMETRY('CIRCULARSTRING (1.0 2.0, 5.0 4.0, 7.0 2.2, 10.0 0.1, 13.0 4.0)') from dual
UNION ALL SELECT 3, SDO_UTIL.FROM_WKTGEOMETRY('COMPOUNDCURVE (LINESTRING (-1.0 -5.0, 1.0 2.0), CIRCULARSTRING (1.0 2.0, 5.0 4.0, 7.0 2.2, 10.0 0.1, 13.0 4.0), LINESTRING (13.0 4.0, 17.0 -6.0))') from dual
UNION ALL SELECT 4, SDO_GEOMETRY( 3002,4326,NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(1,2,3,4,5,6,7,8,9)) from dual
UNION ALL SELECT 5, SDO_UTIL.FROM_WKTGEOMETRY('MULTILINESTRING ((1.0 2.0, 3.0 4.0),(5.0 6.0, 7.0 8.0, 9.0 10.0))') from dual
UNION ALL SELECT 6, SDO_UTIL.FROM_WKTGEOMETRY('MULTILINESTRING ((1.0 2.0 11.0, 3.0 4.0 -11.0),(5.0 6.0 9.0, 7.0 8.0 1.0, 9.0 10.0 -3.0))') from dual
UNION ALL SELECT 7, SDO_UTIL.FROM_WKTGEOMETRY('MULTICURVE (CIRCULARSTRING (1.0 2.0, 5.0 4.0, 7.0 2.2, 10.0 0.1, 13.0 4.0),CIRCULARSTRING (-11.0 -3.0, 5.0 7.0, 10.0 -1.0))') from dual
UNION ALL SELECT 8, SDO_UTIL.FROM_WKTGEOMETRY('MULTICURVE (COMPOUNDCURVE (LINESTRING (-1.0 -5.0, 1.0 2.0), CIRCULARSTRING (1.0 2.0, 5.0 4.0, 7.0 2.2, 10.0 0.1, 13.0 4.0), LINESTRING (13.0 4.0, 17.0 -6.0)),COMPOUNDCURVE(CIRCULARSTRING (1.0 2.0, 5.0 4.0, 7.0 2.2, 10.0 0.1, 13.0 4.0)),COMPOUNDCURVE(LINESTRING (-11.0 -3.0, 5.0 7.0, 10.0 -1.0)))') from dual;
SELECT 1, SDO_GEOMETRY( 2002,4326,NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(1,2,3,4,5,6)) from dual
UNION ALL SELECT 2, SDO_GEOMETRY(2002,4326,NULL, SDO_ELEM_INFO_ARRAY(1, 2, 2), SDO_ORDINATE_ARRAY(1, 2, 5, 4, 7, 2.2, 10, .1, 13, 4)) from dual
UNION ALL SELECT 3, SDO_GEOMETRY(2002,4326,NULL, SDO_ELEM_INFO_ARRAY(1,4,3, 1,2,1, 3,2,2, 11,2,1), SDO_ORDINATE_ARRAY(-1, -5, 1, 2, 5, 4, 7, 2.2, 10, 0.1, 13, 4, 17, -6.)) from dual
UNION ALL SELECT 4, SDO_GEOMETRY(3002,4326,NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(1,2,3,4,5,6,7,8,9)) from dual
UNION ALL SELECT 5, SDO_GEOMETRY(2006,4326,NULL, SDO_ELEM_INFO_ARRAY(1,2,1, 5,2,1), SDO_ORDINATE_ARRAY(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) from dual
UNION ALL SELECT 6, SDO_GEOMETRY(3006,4326,NULL, SDO_ELEM_INFO_ARRAY(1,2,1, 7,2,1), SDO_ORDINATE_ARRAY(1, 2, 11, 3, 4, -11, 5, 6, 9, 7, 8, 1, 9, 10, -3)) from dual
UNION ALL SELECT 7, SDO_GEOMETRY(2006,4326,NULL, SDO_ELEM_INFO_ARRAY(1,2,2, 11,2,2), SDO_ORDINATE_ARRAY(1, 2, 5, 4, 7, 2.2, 10, .1, 13, 4, -11, -3, 5, 7, 10, -1)) from dual
UNION ALL SELECT 8, SDO_GEOMETRY(2006,4326,NULL, SDO_ELEM_INFO_ARRAY(1,4,3, 1,2,1, 3,2,2, 11,2,1, 15,4,1, 15,2,2, 25,4,1, 25,2,1), SDO_ORDINATE_ARRAY(-1, -5, 1, 2, 5, 4, 7, 2.2, 10, .1, 13, 4, 17, -6, 1, 2, 5, 4, 7, 2.2, 10, .1, 13, 4, -11, -3, 5, 7, 10, -1)) from dual;

CREATE TABLE QGIS.POLY_DATA ( "pk" INTEGER PRIMARY KEY, GEOM SDO_GEOMETRY);
INSERT INTO QGIS.POLY_DATA ("pk", GEOM)
SELECT 1, SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((1.0 2.0, 11.0 2.0, 11.0 22.0, 1.0 22.0, 1.0 2.0))') from dual
UNION ALL SELECT 2, SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((1.0 2.0 3.0, 11.0 2.0 13.0, 11.0 22.0 15.0, 1.0 22.0 7.0, 1.0 2.0 3.0))') from dual
UNION ALL SELECT 3, SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((1.0 2.0, 11.0 2.0, 11.0 22.0, 1.0 22.0, 1.0 2.0),(5.0 6.0, 8.0 9.0, 8.0 6.0, 5.0 6.0),(3.0 4.0, 5.0 6.0, 3.0 6.0, 3.0 4.0))') from dual
UNION ALL SELECT 4, SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((1.0 2.0 3.0, 11.0 2.0 13.0, 11.0 22.0 15.0, 1.0 22.0 7.0, 1.0 2.0 3.0),(5.0 6.0 1.0, 8.0 9.0 -1.0, 8.0 6.0 2.0, 5.0 6.0 1.0))') from dual
UNION ALL SELECT 5, SDO_GEOMETRY( 2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,3), SDO_ORDINATE_ARRAY(1.0, 2.0, 11.0, 22.0)) from dual
UNION ALL SELECT 6, SDO_GEOMETRY( 2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,4), SDO_ORDINATE_ARRAY(1.0, 2.0, 11.0, 22.0, 15.0, 4.0)) from dual
UNION ALL SELECT 7, SDO_UTIL.FROM_WKTGEOMETRY('MULTIPOLYGON (((1.0 2.0, 11.0 2.0, 11.0 22.0, 1.0 22.0, 1.0 2.0)),((1.0 2.0, 11.0 2.0, 11.0 22.0, 1.0 22.0, 1.0 2.0),(5.0 6.0, 8.0 9.0, 8.0 6.0, 5.0 6.0),(3.0 4.0, 5.0 6.0, 3.0 6.0, 3.0 4.0)))') from dual
UNION ALL SELECT 8, SDO_UTIL.FROM_WKTGEOMETRY('MULTIPOLYGON (((1.0 2.0 3.0, 11.0 2.0 13.0, 11.0 22.0 15.0, 1.0 22.0 7.0, 1.0 2.0 3.0)),((1.0 2.0 3.0, 11.0 2.0 13.0, 11.0 22.0 15.0, 1.0 22.0 7.0, 1.0 2.0 3.0),(5.0 6.0 1.0, 8.0 9.0 -1.0, 8.0 6.0 2.0, 5.0 6.0 1.0)))') from dual
UNION ALL SELECT 9, SDO_UTIL.FROM_WKTGEOMETRY('CURVEPOLYGON(CIRCULARSTRING(1 3, 3 5, 4 7, 7 3, 1 3))') from dual
UNION ALL SELECT 10, SDO_UTIL.FROM_WKTGEOMETRY('CURVEPOLYGON(CIRCULARSTRING(1 3, 3 5, 4 7, 7 3, 1 3),CIRCULARSTRING(3.1 3.3, 3.3 3.5, 3.4 3.7, 3.7 3.3, 3.1 3.3))') from dual
UNION ALL SELECT 11, SDO_UTIL.FROM_WKTGEOMETRY('CurvePolygon(CompoundCurve ((-1 -5, 1 2),CircularString (1 2, 5 4, 7 2.20, 10 0.1, 13 4),(13 4, 17 -6),CircularString (17 -6, 5 -7, -1 -5)))') from dual
UNION ALL SELECT 12, SDO_UTIL.FROM_WKTGEOMETRY('MultiSurface (CURVEPOLYGON(CIRCULARSTRING(1 3, 3 5, 4 7, 7 3, 1 3)), CURVEPOLYGON(CIRCULARSTRING(11 3, 13 5, 14 7, 17 3, 11 3)))') from dual;
SELECT 1, SDO_GEOMETRY(2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1), SDO_ORDINATE_ARRAY(1, 2, 11, 2, 11, 22, 1, 22, 1, 2)) from dual
UNION ALL SELECT 2, SDO_GEOMETRY(3003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1), SDO_ORDINATE_ARRAY(1, 2, 3, 11, 2, 13, 11, 22, 15, 1, 22, 7, 1, 2, 3)) from dual
UNION ALL SELECT 3, SDO_GEOMETRY(2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1, 11,2003,1, 19,2003,1), SDO_ORDINATE_ARRAY(1, 2, 11, 2, 11, 22, 1, 22, 1, 2, 5, 6, 8, 9, 8, 6, 5, 6, 3, 4, 5, 6, 3, 6, 3, 4)) from dual
UNION ALL SELECT 4, SDO_GEOMETRY(3003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1, 16,2003,1), SDO_ORDINATE_ARRAY(1, 2, 3, 11, 2, 13, 11, 22, 15, 1, 22, 7, 1, 2, 3, 5, 6, 1, 8, 9, -1, 8, 6, 2, 5, 6, 1)) from dual
UNION ALL SELECT 5, SDO_GEOMETRY(2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,3), SDO_ORDINATE_ARRAY(1.0, 2.0, 11.0, 22.0)) from dual
UNION ALL SELECT 6, SDO_GEOMETRY(2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,4), SDO_ORDINATE_ARRAY(1.0, 2.0, 11.0, 22.0, 15.0, 4.0)) from dual
UNION ALL SELECT 7, SDO_GEOMETRY(2007,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1, 11,1003,1, 21,2003,1, 29,2003,1), SDO_ORDINATE_ARRAY(1, 2, 11, 2, 11, 22, 1, 22, 1, 2, 1, 2, 11, 2, 11, 22, 1, 22, 1, 2, 5, 6, 8, 9, 8, 6, 5, 6, 3, 4, 5, 6, 3, 6, 3, 4)) from dual
UNION ALL SELECT 8, SDO_GEOMETRY(3007,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1, 16,1003,1, 31,2003,1), SDO_ORDINATE_ARRAY(1, 2, 3, 11, 2, 13, 11, 22, 15, 1, 22, 7, 1, 2, 3, 1, 2, 3, 11, 2, 13, 11, 22, 15, 1, 22, 7, 1, 2, 3, 5, 6, 1, 8, 9, -1, 8, 6, 2, 5, 6, 1)) from dual
UNION ALL SELECT 9, SDO_GEOMETRY(2003,4326,NULL, SDO_ELEM_INFO_ARRAY(1,1003,2), SDO_ORDINATE_ARRAY(1, 3, 3, 5, 4, 7, 7, 3, 1, 3)) from dual
UNION ALL SELECT 10, SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2), SDO_ORDINATE_ARRAY(1, 3, 3, 5, 4, 7, 7, 3, 1, 3, 3.1, 3.3, 3.3, 3.5, 3.4, 3.7, 3.7, 3.3, 3.1, 3.3)) from dual
UNION ALL SELECT 11, SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1005,4, 1,2,1, 3,2,2, 11,2,1, 13,2,2), SDO_ORDINATE_ARRAY(-1, -5, 1, 2, 5, 4, 7, 2.2, 10, .1, 13, 4, 17, -6, 5, -7, -1, -5)) from dual
UNION ALL SELECT 12, SDO_GEOMETRY(2007, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,2, 11,1003,2), SDO_ORDINATE_ARRAY(1, 3, 3, 5, 4, 7, 7, 3, 1, 3, 11, 3, 13, 5, 14, 7, 17, 3, 11, 3)) from dual;

CREATE TABLE QGIS.DATE_TIMES ( "id" INTEGER PRIMARY KEY, "date_field" DATE, "datetime_field" TIMESTAMP );

0 comments on commit 280018d

Please sign in to comment.
You can’t perform that action at this time.