<programlisting>--A buffered point approximates a circle
-- A buffered point forcing approximation of
--- 4 points per circle looks like poly with 16 sides
+-- 4 points per circle is poly with 16 sides
SELECT ST_NPoints(ST_Buffer(ST_GeomFromText('POINT(1 2)'), 10)) As promisingcircle_pcount,
ST_NPoints(ST_Buffer(ST_GeomFromText('POINT(1 2)'), 10, 4)) As lamecircle_pcount;
33 | 17
--A lighter but lamer circle
--- only 2 points per quarter circle
+-- only 2 points per quarter circle is an octagon
--Below is a 100 meter octagon
-- Note coordinates are in NAD 83 long lat which we transform
to Mass state plane meter and then buffer to get measurements in meters;
900908.759918696,235886.879896532 900979.470596815,235957.59057465 901008.759918
696,236028.301252769 900979.470596815,236057.59057465 900908.759918696))
---Buffer is often also used as a poor mans polygon fixer or a sometimes speedier unioner
+--Buffer is often also used as a poor man's polygon fixer or a sometimes speedier unioner
--Sometimes able to fix invalid polygons - using below
-- using below on anything but a polygon will result in empty geometry
-- and for geometry collections kill anything in the collection that is not a polygon
<para><xref linkend="ST_GeomFromText" />, <xref linkend="ST_MakePoint" /></para>
</refsection>
</refentry>
-<refentry id="ST_MakePoint">
+ <refentry id="ST_MakePoint">
<refnamediv>
<refname>ST_MakePoint</refname>
<para><xref linkend="ST_GeomFromText" />, <xref linkend="ST_PointFromText" />, <xref linkend="ST_SetSRID" /></para>
</refsection>
</refentry>
+
+ <refentry id="ST_MakePointM">
+ <refnamediv>
+ <refname>ST_MakePointM</refname>
+
+ <refpurpose>Creates a point geometry with an x y and m coordinate.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>geometry <function>ST_MakePointM</function></funcdef>
+ <paramdef><type>float</type> <parameter>x</parameter></paramdef>
+ <paramdef><type>float</type> <parameter>y</parameter></paramdef>
+ <paramdef><type>float</type> <parameter>m</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Description</title>
+
+ <para>Creates a point with x, y and measure coordinates. </para>
+ <note><para>Note x is longitude and y is latitude.</para></note>
+ </refsection>
+
+ <refsection>
+ <title>Examples</title>
+ <para>We use ST_AsEWKT in these examples to show the text representation instead of ST_AsText because ST_AsText does not
+ support returning M.</para>
+ <programlisting>
+--Return EWKT representation of point with unknown SRID
+SELECT ST_AsEWKT(ST_MakePointM(-71.1043443253471, 42.3150676015829, 10));
+
+--result
+ st_asewkt
+-----------------------------------------------
+ POINTM(-71.1043443253471 42.3150676015829 10)
+
+--Return EWKT representation of point with measure marked as WGS 84 long lat
+SELECT ST_AsEWKT(ST_SetSRID(ST_MakePointM(-71.1043443253471, 42.3150676015829,10),4326));
+
+ st_asewkt
+---------------------------------------------------------
+SRID=4326;POINTM(-71.1043443253471 42.3150676015829 10)
+
+--Return a 3d point (e.g. has altitude)
+SELECT ST_MakePoint(1, 2,1.5);
+--Get m of point
+SELECT ST_M(ST_MakePointM(-71.1043443253471, 42.3150676015829,10));
+result
+-------
+10
+ </programlisting>
+ </refsection>
+ <refsection>
+ <title>See Also</title>
+ <para><xref linkend="ST_AsEWKT" />, <xref linkend="ST_MakePoint" />, <xref linkend="ST_SetSRID" /></para>
+ </refsection>
+ </refentry>
<refentry id="ST_MakePolygon">
<refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>boolean <function>ST_StartPoint</function></funcdef>
+ <funcdef>geometry <function>ST_StartPoint</function></funcdef>
- <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
+ <paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>