[postgis-devel] geom_name

Regina Obe lr at pcorp.us
Thu Sep 7 13:49:15 PDT 2017


Yah we'd need to move the geom_name to the end as Paul suggested to allow it to be defaulted since all optional args need to be at the end of the arg list.

 

I think making it a default is a good idea.

 

But just remember to drop the old-signature in postgis_drop_before.sql and update the docs accordingly.  

 

And put a note in news that after PostGIS 2.4.0beta1 the signature changed to have geom_name at end so that people know how to change their code.

Hopefully not too many people affected by this change.

 

Was thinking it might be a good idea to putting the note in the docs as well but I'm a bit indifferent on that since it seems unnecessarily wordy and might cause more confusion than help.

 

Something like 

 

Availability: 2.4.0  (if you are running <= 2.4.0beta1 you'll need to update your application code to use the new argument order)

 

 

Thanks,

Regina

 

 

 

From: Paul Ramsey [mailto:pramsey at cleverelephant.ca] 
Sent: Thursday, September 07, 2017 4:39 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

 

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/c7b26675/attachment.html>


More information about the postgis-devel mailing list