exec
create table stringtogeojson_table (i bigint primary key, s blob)
----

exec
insert into stringtogeojson_table values
        (0, '{"type": "Point", "coordinates": [1,2]}'),
        (1, '{"type": "Point", "coordinates": [123.45,56.789]}'),
        (2, '{"type": "LineString", "coordinates": [[1,2],[3,4]]}'),
        (3, '{"type": "LineString", "coordinates": [[1.23,2.345],[3.56789,4.56]]}'),
        (4, '{"type": "Polygon", "coordinates": [[[1.1,2.2],[3.3,4.4],[5.5,6.6],[1.1,2.2]]]}'),
        (5, '{"type": "Polygon", "coordinates": [[[0,0],[1,1],[2,2],[0,0]]]}'),
        (6, '{"type": "MultiPoint", "coordinates": [[1,2],[3,4]]}'),
        (7, '{"type": "MultiPoint", "coordinates": [[1.23,2.345],[3.56789,4.56]]}'),
        (8, '{"type": "MultiLineString", "coordinates": [[[1.1,2.2],[3.3,4.4]],[[5.5,6.6],[7.7,8.8]]]}'),
        (9, '{"type": "MultiPolygon", "coordinates": [[[[0.0, 0.0],[1.1,2.2],[3.3,4.4],[0.0,0.0]]],[[[1.1,1.1],[1.1,2.2],[3.3,4.4],[1.1,1.1]]]]}'),
        (10, '{"type": "GeometryCollection", "geometries": [{"type": "GeometryCollection", "geometries":[]}]}')
----

exec
create table geometry_table (i bigint primary key, g geometry NOT NULL)
----

exec
insert into geometry_table values
        (1, ST_GeomFromText('Point(1 2)')),
        (2, ST_SRID(ST_GeomFromText('Point(1 2)'), 4326)),
		(3, ST_GeomFromText('Linestring(1 2,3 4)')),
		(4, ST_SRID(ST_GeomFromText('Linestring(1 2,3 4)'), 4326)),
        (5, ST_GeomFromText('POLYGON((0 0,0 1,1 1,0 0))')),
        (6, ST_SRID(ST_GeomFromText('POLYGON((0 0,0 1,1 1,0 0))'), 4326)),
        (7, ST_GeomFromText('MultiPoint(1 2,3 4)')),
		(8, ST_SRID(ST_GeomFromText('MultiPoint(1 2,3 4)'), 4326)),
		(9, ST_GeomFromText('MULTILINESTRING((1 2,3 4))')),
        (10, ST_SRID(ST_GeomFromText('MULTILINESTRING((1 2,3 4))'), 4326)),
        (11, ST_GeomFromText('MultiPolygon(((0 0,1 2,3 4,0 0)))')),
        (12, ST_SRID(ST_GeomFromText('MultiPolygon(((0 0,1 2,3 4,0 0)))'), 4326)),
        (13, ST_GeomFromText('GeometryCollection(GeometryCollection())')),
        (14, ST_SRID(ST_GeomFromText('GeometryCollection(GeometryCollection())'), 4326))
----

exec
create table point_table (i bigint primary key, p point NOT NULL);
----

exec
insert into point_table values (5, ST_GeomFromText('Point(1 2)'))
----

exec
create table line_table (i bigint primary key, l linestring NOT NULL);
----

exec
insert into line_table values
    (0, ST_GeomFromText('Linestring(1 2,3 4)')),
    (1, ST_GeomFromText('Linestring(1 2,3 4,5 6)'))
----

exec
create table polygon_table (i bigint primary key, p polygon NOT NULL);
----

exec
insert into polygon_table values
    (0, ST_GeomFromText('Polygon((0 0,0 1,1 1,0 0))')),
    (1, ST_GeomFromText('Polygon((0 0,0 1,1 1,0 0),(0 0,0 1,1 1,0 0))'))
----

exec
create table mpoint_table (i bigint primary key, p multipoint NOT NULL);
----

exec
insert into mpoint_table values
    (0, ST_GeomFromText('MultiPoint(1 2,3 4)')),
    (1, ST_GeomFromText('MultiPoint(1 2,3 4,5 6)'))
----

exec
create table mline_table (i bigint primary key, l multilinestring NOT NULL);
----

exec
insert into mline_table values
    (0, ST_GeomFromText('MultiLineString((1 2,3 4))')),
    (1, ST_GeomFromText('MultiLineString((1 2,3 4,5 6))'))
----

exec
create table mpoly_table (i bigint primary key, p multipolygon NOT NULL);
----

exec
insert into mpoly_table values
    (0, ST_GeomFromText('MultiPolygon(((0 0,1 2,3 4,0 0)))')),
    (1, ST_GeomFromText('MultiPolygon(((0 0,1 2,3 4,0 0)),((1 1,2 3,4 5,1 1)))'))
----

exec
create table geom_coll_table (i bigint primary key, g geometrycollection NOT NULL);
----

exec
insert into geom_coll_table values
    (0, ST_GeomFromText('GeometryCollection(GeometryCollection())'))
----