0

It seems with MySQL and MariaDB I'm getting the following when I try to use the LineString constructor. In PostGIS I can do this with ST_MakeLine(pt1,pt2)

> SELECT ST_MakeLine(Point(0,0), Point(0,1));
ERROR 1305 (42000): FUNCTION ST_MakeLine does not exist

> SELECT ST_LineString(Point(0,0), Point(0,1));
ERROR 1305 (42000): FUNCTION ST_LineString does not exist

Is the only way to construct a LINESTRING to use ST_GeomFromText or ST_LineFromText, or ST_LineStringFromText?

0

No, as a general rule the constructors for MySQL are only available with non-ST_ prefixes.

So you'll want LineString(pt1,pt2)

SELECT LineString(Point(0,0), Point(0,1));

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.