0

I have a table like this:

CREATE TABLE `aois` (
  `aois_id` int(11) NOT NULL DEFAULT '0',
  `WS_A` point DEFAULT NULL,
  `WS_B` point DEFAULT NULL,
  `WS_C` point DEFAULT NULL,
  `WS_D` point DEFAULT NULL,
  `DB_A` point DEFAULT NULL,
  `DB_B` point DEFAULT NULL,
  `DB_C` point DEFAULT NULL,
  `DB_D` point DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Now i want to create a polygons from the points:

SELECT aois_id,
polygon((WS_A, WS_B, WS_C, WS_D, WS_A)) as geom
FROM aois;

But i always get the error message:

Operand should contain 1 column(s)

(I'm using MySQL Server Version 8.0.16 on Windows 10, if that is of any importance.)

Can anyone point me in the right direction?

Thanks a lot!

0
SELECT aois_id,
polygon(
   linestring(WS_A, WS_B, WS_C, WS_D, WS_A)
) as geom
FROM aois;
  • Works perfect! Thanks for the quick answer... – Olaf Briese Oct 23 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.