What's the difference between coordinateDimension and spatialDimension?

The OpenGIS standard mentions three methods to query the dimensions of a Geometry:

• dimension(): the inherent dimension of the geometry:
• 0 for Point
• 1 for Curve
• 2 for Surface
• coordinateDimension(): the number of coordinates of the geometry:
• 2 for X,Y
• 3 for X,Y,Z or X,Y,M
• 4 for X,Y,Z,M
• spatialDimension(): this one has no description in this document.

This RDF document on the opengis.net website further describes coordinateDimension as:

The number of measurements or axes needed to describe the position of this geometry in a coordinate system.

And describes spatialDimension as:

The number of measurements or axes needed to describe the spatial position of this geometry in a coordinate system.

So the latter refers to the "spatial position" as opposed to the "position", which doesn't help me much to understand the difference between them.

What is the difference between coordinateDimension() and spatialDimension()?

• My assumption would be that spatialDimension relies on a geographic (or projected) coordinate system, while coordinateDimension could also include any arbitrary or local coordinate system. Sep 24 '14 at 16:24
• @Erica I was myself wondering if it was the same as coordinateDimension, but only including "spatial" coordinates X, Y, Z, and ignoring M; hence possible values: 2 for 2D, 3 for 3D. Would this make sense? Sep 24 '14 at 19:04
• My bet would be on the document and the standard are inconsistent. coordinateDimension may refer to inherent dimension, while spatialDimension to absolute dimension (with Z and/or M). My assumption originates from the RDF document's dimension property, which refers to topological dimension. Mar 22 '15 at 0:14
• I read that document as describing spatialDimension as a much more specific version of coordinateDimension.. for example returning [0, 1, 2],[1,0,2],[0,0,2] for a 2D triangle instead of [0,1][1,0][0,0].. what happens when you query it? since the doc references collections may consist of geometric objects w/ different dimensions, this could just be a computer-scientist-friendly version of coordinateDimension Mar 27 '15 at 16:49

• dimension(): refers to the topological dimension (i.e. point/line/area)
• coordinateDimension(): returns the dimension of the tuple as given (as statet in the OP)
• spatialDimension(): returns the dimension of the tuple without the measurement part (with "M" being the measurement in a linear reference system)

As it's pretty obvious for a 2D or "4D" literal, you basically need it to differ between the two "3D" alternatives.

The OGC Document on GeoSPARQL is (slightly) more accurate with:

Property: geo:spatialDimension
The spatial dimension is the dimension of the spatial portion of the direct positions
(coordinate tuples) used in the definition of this geometric object. If the direct positions
do not carry a measure coordinate, this will be equal to the coordinate dimension.

Of the three opinions expressed so far, yours, Benjamin, makes the most sense to me:

X, Y and Z are spatial dimensions and M is some other coordinate/dimension.

Disclaimer: I've never heard of those function names (coordinateDimension and spatialDimension) before so I'm no authority. And I'm not sure I could claim any bounty if ever I'm proved correct!

In ordinary geometry, we have space and time. Space is represented by three coordinates and time is an additional one. Things related to space position are spatial, and those related to time are temporal. So, 'spatial coordinates' refer to those related to space and is the same as 'spatial dimensions'. Coordinate dimensions on the other hand can be any- spatial, temporal or any other.

Now what is a dimension and what is the difference from a variable. Take atmospheric pressure 'p' for example. If p is fixed everywhere, then it is a function of zero dimension. If it varies as you go up in 'z' direction, then it is a function of one dimension '1D', and p=p(z). If it varies with height as well as when you go sideways in any direction, then it is a function of 2 variables p=p(r,z), where r is the separation from where you stand, and we a have 2D problem.

If the variation as you go forward is different than when you go sideways, then you are a function of the three spatial dimensions, and p=p(x,y,z). If p also varies with time 't', then you have a function of 4D, three spatial and one temporal, and you have p=p(x,y,z,t). Suppose this refers to one city and you want p to be general for all cities around, then you have 5D and so on. Here where we need to use coordinates, as there is a mix of various types of dependencies.

Finally to qualify to be a dimension or a coordinate, it must be possible to vary a function (p in this case) along that dimension, with the others remaining at fixed. That is why we use perpendicular lines for dimensions.. since it is possible to vary up(z in our case) keeping front and sideways fixed. The same can be said for the others. Time is a dimension too, since you can change time while sitting at the same (x,y,z) point. If you go 45 degrees to front or side walk for example, that is not a new dimension since both x,y will change in the process. In this case we decompose the path into two components, one front and one sideways, to achieve the 45 degrees walk.