[postgis-devel] Function Removal

Martin Davis mtnclimb at gmail.com
Thu Dec 17 15:26:00 PST 2020


Totally agree, Regina.  Using named args should be done very judiciously.
And ST_Translate does not seem like the right place to do it for all those
reasons.  It's a distraction from the current discussion.

Not sure where the dividing line between optional and name arguments should
live.  I agree that they are very useful for functions with a plethora of
similar arguments (ST_Buffer comes to mind...).

Requiring SRID to be named seems more reasonable - but it still leaves open
the possibility of confusion with an ordinate value, right?

I had an idea about providing ST_Point, ST_PointZ and ST_PointZM, all
taking an optional SRID.  It has a pleasing resonance with the WKT syntax
(to my eye - I have heard dissenting opinion).



On Thu, Dec 17, 2020 at 2:47 PM Regina Obe <lr at pcorp.us> wrote:

> That example wouldn’t work even if we put in named args for those J
>
>
>
> Because we would then need to make x, y, z optional in ST_Translate, so
> that would require dropping those signatures and readding them.
>
> Let put aside the breakage in existing workflow for a minute
>
>
>
> But we would have to allow ST_Translate(geom)  - and what shoud that mean?
>
>
>
> and gosh that’s like 4 extra characters you have to type to save typing 1
> extra character J.  I know it’s clearer but
>
>
>
> what if we went by the docs
>
>
>
> ST_Traslate(geom, deltax => 10, deltay => 0)
>
>
>
> Are you going to remember is it  “x” or “deltax” J
>
>
>
> Is such clarity really worth the nuisance of having to reference the
> manual all the time for the name of the argument?
>
>
>
> I know I sound like an old nay-sayer stuck in the dark ages clinging on to
> the simplicity of the past.
>
>
>
> *From:* postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] *On
> Behalf Of *Bruce Rindahl
> *Sent:* Thursday, December 17, 2020 5:27 PM
> *To:* PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
> *Subject:* Re: [postgis-devel] Function Removal
>
>
>
> I agree with all that but it could have advantages:
> ST_Translate(geom,x=>10) for a shift to the right,
> ST_Translate(geom,y=>10) for a shift up, ST_Scale(z=>10) for vertical
> distortion.
>
>   The functions , comments, and documents would all have to be updated and
> in sync with 'accepted' names.
>
>
>
> On Thu, Dec 17, 2020 at 2:19 PM Regina Obe <lr at pcorp.us> wrote:
>
> > Since they've come in we've really under-used named parameters. Some of
> > that because of legacy, some of it because of mental inertia. But for
> these
> > kinds of things they seem pretty ideal to me. Mean what you say, say what
> > you mean, have what your parameters mean be clear instead of opaque. A
> > good habit, all in all.
> >
> > P
> >
> In the beginning I thought named args were great, but I've come to think of
> them as being a little evil.
> Don't get me wrong -- they are indispensable in raster and pgRouting, cause
> there is a butt load of arguments and it's hard to undo or even
> questionable
> if we should.
>
> But for cases where we have few args, I find the evilness much worse than
> the disease they are there to cure.
>
> Mostly because of our indecision with coming up with good names and then
> changing our mind
> and then the fact our names in the docs don't even always match the named
> args ones we have .
>
> Remember Paul when your OCD kicked in and you decided to rename an arg?
>
> Oops we can't change the name of the arg without dropping the function oops
> we can't rename it because what if someone is using the name.
>
> So I don't care what the OGC says
>
> ST_Point(x,y, srid)
>
> With last arg always meaning srid seems clearest to me.
>
> No overloading with z,m etc.
>
> Have separate named functions for that.
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20201217/eac45943/attachment-0001.html>


More information about the postgis-devel mailing list