Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2810 closed defect (fixed)

[raster docs] "delimiter" argument to ST_Band ?

Reported by: strk Owned by: robe
Priority: medium Milestone: PostGIS 2.2.0
Component: documentation Version: 2.1.x
Keywords: Cc:

Description

On http://postgis.net/docs/RT_ST_Band.html I read availability of thi siguature:

raster ST_Band(raster rast, text nbands, character delimiter=,);

But not description is given for the "delimiter" argument (and I cannot imagine what it would be for...).

Is it a typo in documentation or raster scripts or what else ?

Change History (6)

comment:1 by robe, 10 years ago

Sure it does. the delimiter is by default , (a comma) as it says.

We should describe it. I think everyone just takes the default of , but in theory you can replace it with |

and then you can specify your array of bands as 1|2|3 instead of 1,2,3 (note example)

I personally don't know why anyone would care to even change the delimiter seemed a bit pointless to me to even offer that option.

comment:2 by strk, 10 years ago

Ah, yes, then it needs documentation. I agree it sounds silly to allow for changing the delimiter. I would actually completely deprecate the version accepting text. Pass an array in ! Text can be implicitly casted to array too (but you don't get to decide the format ;)

comment:3 by robe, 10 years ago

I should probably start by taking out the example and replacing with text equivalent array version '{1,2}'::int[] to demonstrate just how easy it is.

Then we can vote for deprecation on dev.

comment:4 by robe, 10 years ago

Milestone: PostGIS 2.2.0

comment:5 by robe, 10 years ago

Resolution: fixed
Status: newclosed

I documented the arg in #12726, moved that version to bottom, and also removed the example demonstrating how to use it.

In doing so I discovered a bug. Not sure if its worth fixing if we are going to remove it in future.

Since the function uses regexp_split_to_array to convert the string to an array of bands, I can't use my favorite '|' splitter because its a keyword in regexp. It really should be using split_to_array function since it only allows a one field delimeter. You also can't use any white space character as a delimiter since it strips all white space from the text.

I'll open a separate ticket for this issue and close this one.

comment:6 by robe, 10 years ago

hmm I meant r12726

Note: See TracTickets for help on using tickets.