MULTILINESTRING is a collection of . MultiLineStrings are useful for gathering a group of LineStrings into one geometry. For example, you may want to gather the LineStrings denoting all of the roads in a particular municipality.
You can also store a “ with the following additional dimensions:
- A third dimension coordinate
Z(Z). - A measure coordinate
M(M). - Both a third dimension and a measure coordinate (
ZM).
Z and M dimensions can be accessed or modified using a number of , including:
ST_ZST_MST_AffineST_ZmflagST_MakePointST_MakePointMST_Force3DST_Force3DZST_Force3DMST_Force4DST_SnapST_SnapToGridST_RotateZST_AddMeasure
- The Z/M dimension is not index accelerated when using spatial predicates.
- Some spatial functions ignore the Z/M dimension, with transformations discarding the Z/M value.
Examples
Well known text
A MultiLineString can be created from SQL by calling thest_geomfromtext function on a MultiLineString definition expressed in the format.
SQL
A MultiLineString can be created from SQL by calling an aggregate function such asST_Collect or on a column that contains geometries. In the example below, we will build a MultiLineString from several LineStrings.
-
Insert the LineStrings:
-
Build a MultiLineString from the individual using
ST_Collect, and check the output withST_GeometryTypeto verify that it is indeed a MultiLineString: -
Drop the temporary table:

