<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Slight correction using ST_GeomFromText/ST_GeomFromWKB and filtering out by geometry type (not nulls)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Regina Obe [mailto:lr@pcorp.us] <br><b>Sent:</b> Saturday, June 18, 2022 7:59 PM<br><b>To:</b> 'PostGIS Development Discussion' <postgis-devel@lists.osgeo.org><br><b>Subject:</b> RE: [postgis-devel] Noob questions about aliases and undocumented functions<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>In theory they should be documented.  In practice I’ve told people to not use those and just stick with <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>ST_GeomFromText and ST_GeomFromWKB.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The reason as I recall is that those functions are pretty much the above but with a CASE WHEN wrapper, which makes them much slower than the above.  The only reason I can think why people would ever want to use them is if they have a mixed bag of geometries and say only want a polygon and have NULLs returned for others.  Even then they’d probably be better off by just using the ST_GeomFromText / ST_GeomFromWKB and filtering out the nulls.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I’ve always felt it’s just more confusing to document, what I consider useless functions that are just there to satisfy the specs.  Do others have an opinion on this?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Regina<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> postgis-devel [<a href="mailto:postgis-devel-bounces@lists.osgeo.org">mailto:postgis-devel-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Juris Evertovskis<br><b>Sent:</b> Saturday, June 18, 2022 10:38 AM<br><b>To:</b> <a href="mailto:postgis-devel@lists.osgeo.org">postgis-devel@lists.osgeo.org</a><br><b>Subject:</b> [postgis-devel] Noob questions about aliases and undocumented functions<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=LV>Hi all, newbie here.<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>I was going through the OpenGIS SFA spec and discovered some functions that are in the spec and implemented in PostGIS, but not documented in PostGIS docs. Before submitting any pull requests I wanted to check if these things are not intentionally undocumented (e.g. semi-deprecated).<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>Namely these are some aliases like ST_PolyFromText is implemented, but not documented. However, ST_PolygonFromText is documented, which seems to be implemented as an alias to ST_PolyFromText. Also a bunch of *FromWKB function, e.g. ST_PolygonFromWKB, ST_MLineFromWKB, ST_MPolyFromWKB… I noticed that these are listed in RFC03 as “PUBLIC KEEP” and thus they were intended to be documented and are mentioned in some older reference ( <a href="https://postgis.net/docs/manual-1.3/ch06.html">https://postgis.net/docs/manual-1.3/ch06.html</a> ), but I can’t find the status of that RFC and it’s from 2009 so the status of these functions might have changed since then anyways.<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>So could you give me a little guidance and tell if these functions should be documented?<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>--<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>One other detail that got me confused was the use of aliases in implementations. I was looking at these sources <a href="https://github.com/postgis/postgis/blob/master/postgis/postgis.sql.in">https://github.com/postgis/postgis/blob/master/postgis/postgis.sql.in</a> so please tell me if it’s the wrong file for implementations :) But my question is whether it is encouraged to use aliases or to NOT use aliases?<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>I am asking this because some functions like the aforementioned ST_PolygonFromText seem to be a straight up alias of ST_PolyFromText <a href="https://github.com/postgis/postgis/blob/master/postgis/postgis.sql.in#L5513">https://github.com/postgis/postgis/blob/master/postgis/postgis.sql.in#L5513</a><o:p></o:p></span></p><p class=MsoNormal><span lang=LV>However ST_PolyFromWKB and ST_PolygonFromWKB appear to have identical implementations without referring to one another.<o:p></o:p></span></p><p class=MsoNormal><span lang=LV>Which way is preferred? Or am I missing some detail?<o:p></o:p></span></p><p class=MsoNormal><span lang=LV><o:p> </o:p></span></p><p class=MsoNormal><span lang=LV>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=LV>Juris<o:p></o:p></span></p></div></div></div></body></html>