XY order

default

By default, the order and interpretation of the two-point coordinates in the GeoDMS Geometric functions is Y and then X (row-column). This originates from the fact that the GeoDMS was developed to calculate mainly with Grid data, in which the row is usually the major order and left index and column the minor order and right index.

setting

The order of the two coordinates is stated in the name of the operator: point_xy(first, second, optional coordinate unit) takes the X coordinate first, the traditional GIS order, and point_yx(first, second, optional coordinate unit) takes the Y coordinate first.

The obsolete point function point(first, second, optional coordinate unit) does not state the order in its name; the setting ConfigPointColRow in the config.ini of the project states it. A call to point is an error, ‘point’: unknown operator and no template or function was found with this name, and GeoDMS ignores the setting. In a config.ini, the setting

ConfigPointColRow=0

or no setting at all stands for the default order Y, X, the usual choice for projects with mainly Grid data, and

ConfigPointColRow=1

for the order X, Y, the usual choice for projects with mainly Vector data. To convert a configuration that calls point, replace each call by point_yx where the setting is 0 or absent, and by point_xy where it is 1.

For the PROJ functions, all coordinates are converted from the DMS order to the order of the projection and, after the conversion, back, depending on the destination CRS.

textual representation

Every textual rendering of a point states which coordinate comes first, in the xy(..) / yx(..) spelling of the point literals in [[data blocks data block]]. Output is always xy(x; y):
where example
the Range and cat_range Property range = "[xy(0; 300000), xy(280000; 625000))"
the range entry in an MMD 0Dictionary.dms range = "[xy(0; 0), xy(5; 4)) "
string(..) of a point xy(280000; 625000)
string(..) of an Arc or Polygon {5: xy(10; 10) xy(20; 10) xy(20; 20) xy(10; 20) xy(10; 10)}
the Range row of the Detail pages From xy(0; 300,000) to xy(280,000; 625,000)

Reading is lenient:

  • xy(x; y) states the x coordinate first, yx(y; x) the y coordinate first;
  • a bare {first, second} is the legacy untagged form and means {row, col}, that is {y, x};
  • , and ; are interchangeable, both between the two coordinates of a point and between the two bounds of a range.

Reading a Range written in the untagged form reports a deprecation warning that names the xy(..) spelling to replace it with. The warning does not change the reading, so the configuration still produces the same rectangle; it marks a spelling whose meaning is not visible in the text, and which a future major version is intended to stop accepting.

So the following four all denote the same rectangle, x in [0, 280000) and y in [300000, 625000):

unit<fpoint> rdc_meter: range = "[xy(0; 300000), xy(280000; 625000))"; // written by 20.14.0
unit<fpoint> rdc_meter: range = "[xy(0, 300000), xy(280000, 625000))";
unit<fpoint> rdc_meter: range = "[yx(300000, 0), yx(625000, 280000))";
unit<fpoint> rdc_meter: range = "[{300000, 0}, {625000, 280000})";     // legacy, still accepted

Whole numbers are written in plain notation whenever the value permits it, and a value that does need scientific notation never gets thousand separators.

examples

The following two examples configure the same geographic Grid Domain, example I with point_yx and example II with point_xy. The two examples pass the same coordinates, each call in the order that the name of its function states.

I (point_yx, order Y, X):

unit<fpoint> rdc_meter := range(fpoint, point_yx(300000f, 0f), point_yx(625000f, 280000f));

parameter<rdc_meter> TopLeftCoord := point_yx(float32(625000), float32(10000), rdc_meter);

parameter<int16> nrofrows := int16(3250);
parameter<int16> nrofcols := int16(2700);

unit<spoint> rdc_100m
:=  range(
      gridset(
         rdc_meter
        ,point_yx(float32(-100), float32(100), rdc_meter)
        ,TopLeftCoord
        ,spoint
      )
      ,point_yx(int16(0), int16(0))
      ,point_yx(nrofrows, nrofcols)
   )
,  Descr = "rdCoords/100m van NW naar SE (3250 rows, 2700 cols)";

II (point_xy, order X, Y):

unit<fpoint> rdc_meter := range(fpoint, point_xy(0f, 300000f), point_xy(280000f, 625000f));

parameter<rdc_meter> TopLeftCoord := point_xy(float32(10000), float32(625000), rdc_meter);

parameter<int16> nrofrows := int16(3250);
parameter<int16> nrofcols := int16(2700);

unit<spoint> rdc_100m
 :=  range(
       gridset(
          rdc_meter
         ,point_xy(float32(100), float32(-100), rdc_meter)
         ,TopLeftCoord
         ,spoint
       )
       ,point_xy(int16(0), int16(0))
       ,point_xy(nrofcols, nrofrows)
   )
,  Descr = "rdCoords/100m van NW naar SE (3250 rows, 2700 cols)";