[postgis-devel] geom_name
Regina Obe
lr at pcorp.us
Thu Sep 7 14:08:58 PDT 2017
Hmm good point. Either way is fine with me. Just make sure to note the breaking change if you go down that path.
From: Paul Ramsey [mailto:pramsey at cleverelephant.ca]
Sent: Thursday, September 07, 2017 4:51 PM
To: bjorn at wololo.org
Cc: Regina Obe <lr at pcorp.us>; PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
Subject: Re: [postgis-devel] geom_name
Quick side-note: also might be good to put the anyelement argument first in ST_AsMVT so it aligns w/ ST_AsGeoBuf in that regard. That also opens the possibility of a default layer_name and a 1-argument call to ST_AsMVT, which is nice IMO.
P
On Sep 7, 2017, at 1:39 PM, Paul Ramsey <pramsey at cleverelephant.ca <mailto:pramsey at cleverelephant.ca> > wrote:
Actually, no, I’d like to see signature changes… in particular,
bytea ST_AsMVT(text layer_name, anyelement row, int4 extent default 4096, text geom_name default NULL);
geometry ST_AsMVTGeom(geometry geom, box2d bounds, int4 extent default 4096, int4 buffer default 0, bool clip_geom default true);
bytea ST_AsGeobuf(anyelement row, text geom_name default NULL);
Then the presence of (geom_name == NULL) implies “automagically use the first geometry you find”
And the null checks on extent, buffer, clip_geom can be dropped since PgSQL will automatically in-fill the defaults
You don’t have to do the above, I’m just agitating for it.
Agitate, agitate.
P.
On Sep 7, 2017, at 1:34 PM, Björn Harrtell <bjorn.harrtell at gmail.com <mailto:bjorn.harrtell at gmail.com> > wrote:
So we are agreed that there will be no signature change? Instead I will work towards an implementation and documentation change for geom_name to the following:
"geom_name is the name of the geometry column in the row data. If NULL it will default to use the first geometry column in the row data."
/Björn
2017-09-07 21:08 GMT+02:00 Paul Ramsey <pramsey at cleverelephant.ca <mailto:pramsey at cleverelephant.ca> >:
Yes, take the first one unless the geom_name is provided. So geom_name would default to NULL and NULL would mean “the first one you find"
P
On Sep 7, 2017, at 12:06 PM, Regina Obe <lr at pcorp.us <mailto:lr at pcorp.us> > wrote:
Just to add to this to make sure I'm following:
For this question:
> Also, a bit late in the day, but why the text parameter "geom_name" in these various signatures, instead of automagically finding it in the row?
> ?
> P
Is it ever possible that an MVT row could have more than one geometry column. I assume so. If so I think it might be good to keep the geom_name field though perhaps make it a default option and in that case it picks the first one it finds. Similar to how we do pgsql2shp where you can explicitly set the geometry column or have pgsql2shp do it's thing and just pick the first one it finds.
Thanks,
Regina
From: Regina Obe [ <mailto:lr at pcorp.us> mailto:lr at pcorp.us]
Sent: Thursday, September 07, 2017 2:57 PM
To: 'PostGIS Development Discussion' < <mailto:postgis-devel at lists.osgeo.org> postgis-devel at lists.osgeo.org>; 'Björn Harrtell' < <mailto:bjorn at wololo.org> bjorn at wololo.org>
Cc: 'Paul Ramsey' < <mailto:pramsey at cleverelephant.ca> pramsey at cleverelephant.ca>
Subject: RE: [postgis-devel] geom_name
> We should ask about API changing, I'm sure Regina would say we're done, which effectively means done-for-all-time, since changing public function signatures is basically impossible one they are done.
> P
I'm fine with you changing the API now before final 2.4.0 release. I promised no new functions, not no new API changes to new 2.4 functions.
I think it would be good to drop the old signature in the postgis_drop_before.sql since some people have already started using the MVT functions.
If it impacts existing code, we should also put in BREAKING CHANGE for postgis -2.4.0 the change so people are warned and know how to change their code if they were using an earlier postgis 2.4.0dev
Thanks,
Regina
On Thu, Sep 7, 2017 at 10:45 AM, Björn Harrtell < <mailto:bjorn.harrtell at gmail.com> bjorn.harrtell at gmail.com> wrote:
Hi Paul,
No good reason except that I couldn't find out a deterministic way to find it and put it out of my mind after that. :(
With some guidance I'll be happy to revise the API if it's not too late at this point.
/Björn
2017-09-07 19:41 GMT+02:00 Paul Ramsey < <mailto:pramsey at cleverelephant.ca> pramsey at cleverelephant.ca>:
Also, a bit late in the day, but why the text parameter "geom_name" in these various signatures, instead of automagically finding it in the row?
?
P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170907/f6ac1e3f/attachment.html>
More information about the postgis-devel
mailing list