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

Nicklas Avén nicklas.aven at jordogskog.no
Wed Oct 8 08:13:10 PDT 2014


On on., 2014-10-08 at 16:53 +0200, Sandro Santilli wrote:
> On Wed, Oct 08, 2014 at 03:10:14PM +0200, Nicklas Avén wrote:
> > Hallo
> > 
> > I am looking at http://trac.osgeo.org/postgis/ticket/2917 to create a
> > twkb reader
> > 
> > I find myself doing som ugly steps to fit into the api with has_z and
> > has_m.
> > 
> > Why do we handle third and fourth dimension as z and m internally when
> > creating a point array?
> > 
> > I am thinking about the functions in ptarray.c
> 
> A POINTARRAY may point to an array of POINT2D, POINT3DZ, POINT3DM or POINT4D.
> We want to allow having M and no Z.
> Does this answer your question ?

I guess

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?

This is absolutely not a big matter, more a question if the logic (or my
understanding) can be fine tuned.

/Nicklas


> 
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> 





More information about the postgis-devel mailing list