The ST_MPointFromKML() function

The ST_MPointFromKML() function takes a KML MultiGeometry and Point combination and an optional spatial reference ID and returns a multipoint object. A Point string can contain the elements of <coordinates>, <extrude>, <tessellate>, and <altitudeMode>, but they are ignored.

Syntax

ST_MPointFromKML(kmlstring lvarchar)
ST_MPointFromKML(kmlstring lvarchar, SRID integer)

Return type

ST_MultiPoint

Example

EXECUTE FUNCTION ST_MPointFromKML('<MultiGeometry><Point><coordinates>
             -122.365662,37.826988, 0</coordinates></Point><Point>
             <coordinates>-122.365038,37.82655,0</coordinates>
             </Point></MultiGeometry>',4);
Output:
4 MULTIPOINT Z (-122.365662056 37.8269879529 0, -122.36503794 
                37.8265500822 0)