MySQL 8 - Populating Spatial Tables (Polygons)

preview_player
Показать описание
#MySQL
Hello to everyone,
After a user creates a spatial table, there are two ways to add information to it. One is to connect the table to a geographic information software, such as Manifold Release 9 or QGIS Pi, and add the geographic information from these applications. The other way is through the construction of a query that allows to populate the table with geographic data.
As a geographer, I prefer to use the geographic information software to perform this task, however, there are many users who prefer to use SQL queries for this purpose, and it is this second way that we will explain in this video, how it works.
SQL queries used in this video:
----------------
CREATE TABLE demo_spatial (ogr INT PRIMARY KEY NOT NULL UNIQUE AUTO_INCREMENT, municipality VARCHAR(40), shape POLYGON NOT NULL SRID 3857, SPATIAL INDEX(shape));
----------------
insert into demo_spatial (ogr, municipality, shape)
values
('1', 'test1', ST_GeomFromText('POLYGON ((-249.5 160.0,-400.5 -105.0,101.5 2.0,-249.5 160.0))', 3857));
----------------
insert into demo_spatial (ogr, municipality, shape)
values
('1', 'test1', ST_GeomFromText('POLYGON ((-249.5 160.0,-400.5 -105.0,101.5 2.0,-249.5 160.0))', 3857)),
('2', 'test2', ST_GeomFromText('POLYGON ((-423 -516,269 -270,116 -644,-423 -516))', 3857));
----------------
Software used to build this video:
Рекомендации по теме
Комментарии
Автор

How do you get the SRID out? The formula cannot be taken from Excel. Please tell us the formula immediately. thank you

MrLion
welcome to shbcf.ru