[postgis-devel] Why do we use has_z and has_m all the time instead of n_dims

Sandro Santilli strk at keybit.net
Wed Oct 8 08:21:28 PDT 2014


On Wed, Oct 08, 2014 at 05:13:10PM +0200, Nicklas Avén wrote:

> So the third dimension can be z or m. But it is still handled the same
> way when building point arrays and so on, right?
> 
> In what cases does it matter if third dimension is z or m in our
> handling?
> When constructing point arrays, wouldn't it be cleaner to construct 2, 3
> or 4 D point array, no matter what they contain?

There are functions that do use the semantic of the values.
I hadn't checked one by one but reading the header you have things
like ptarray_is_closed_3d, which should not care about M while
it should care about Z. Or you have ptarray_locate_point which takes
a POINT4D and has to interpret it (again would not mind about M but
should about Z). Or ptarray_startpoint(const POINTARRAY* pa, POINT4D* pt)
etc.

--strk;



More information about the postgis-devel mailing list