Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

备份一下geometry字段类型 #16

Open
sopop opened this issue Aug 31, 2023 · 0 comments
Open

备份一下geometry字段类型 #16

sopop opened this issue Aug 31, 2023 · 0 comments

Comments

@sopop
Copy link

sopop commented Aug 31, 2023

CREATE TABLE t_geo_test2 (
id int(11) NOT NULL,
name varchar(255) NULL DEFAULT NULL,
geometry_1 geometry NULL,
point_1 point NULL,
linestring_1 linestring NULL,
polygon_1 polygon NULL,
multipoint_1 multipoint NULL,
multilinestring_1 multilinestring NULL,
multipolygon_1 multipolygon NULL,
geometrycollection_1 geometrycollection NULL,
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB ROW_FORMAT = Dynamic;

INSERT INTO t_geo_test2 VALUES (1, 'P1', ST_GeomFromText('POINT(121.474 31.2329)'), ST_GeomFromText('POINT(121.474 31.2329)'), ST_GeomFromText('LINESTRING(1 3, 12 5, 12 7)'), ST_GeomFromText('POLYGON((121.474 31.2345, 121.472 31.2333, 121.471 31.2315, 121.472 31.2302, 121.473 31.2304, 121.476 31.232, 121.474 31.2345))'), ST_GeomFromText('MULTIPOINT(0 0, 20 20, 60 60)'), ST_GeomFromText('MULTILINESTRING((10 10, 20 20), (15 15, 30 15))'), ST_GeomFromText('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)), ((5 5, 7 5, 7 7, 5 7, 5 5)))'), ST_GeomFromText('GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30), LINESTRING(15 15, 20 20))'));

INSERT INTO t_geo_test2 VALUES (2, 'L1', ST_GeomFromText('LINESTRING(121.342 31.5424, 121.346 31.2468, 121.453 31.4569)'), ST_GeomFromText('POINT(-3 -5)'), ST_GeomFromText('LINESTRING(1 3, 12 5, 12 7)'), NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (3, 'P1', ST_GeomFromText('POLYGON((121.474 31.2345, 121.472 31.2333, 121.471 31.2315, 121.472 31.2302, 121.473 31.2304, 121.476 31.232, 121.474 31.2345))'), ST_GeomFromText('POINT(1 1)'), ST_GeomFromText('LINESTRING(121.342 31.5424, 121.346 31.2468, 121.453 31.4569)'), NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (4, 'MP1', ST_GeomFromText('MULTIPOINT(0 0, 20 20, 60 60)'), ST_GeomFromText('POINT(6 7)'), NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (5, 'ML1', ST_GeomFromText('MULTILINESTRING((10 10, 20 20), (15 15, 30 15))'), ST_GeomFromText('POINT(4 6)'), NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (6, 'MPG1', ST_GeomFromText('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)), ((5 5, 7 5, 7 7, 5 7, 5 5)))'), ST_GeomFromText('POINT(2 5)'), NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (7, 'G1', ST_GeomFromText('GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30), LINESTRING(15 15, 20 20))'), ST_GeomFromText('POINT(1 3)'), NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (8, 'P1', NULL, ST_GeomFromText('POINT(-3 -5)'), NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (9, 'P1', NULL, NULL, ST_GeomFromText('LINESTRING(1 3, 12 5, 12 7)'), NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (10, 'P1', NULL, NULL, NULL, ST_GeomFromText('POLYGON((121.474 31.2345, 121.472 31.2333, 121.471 31.2315, 121.472 31.2302, 121.473 31.2304, 121.476 31.232, 121.474 31.2345))'), NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (17, 'P1', ST_GeomFromText('GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30), LINESTRING(15 15, 20 20))'), NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO t_geo_test2 VALUES (18, 'P1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, ST_GeomFromText('GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30), LINESTRING(15 15, 20 20))'));
SET FOREIGN_KEY_CHECKS = 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant