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
Later on, when the GeoDMS was used more and more for projects using also (and mainly) vector-data, a setting was introduced in the config.ini to set the coordinate order to (X, Y) to overrule the default (Y, X) order.
YX: For projects with mainly grid-data, we did advise to keep the default orientation Y, X. No settings have to be added to the config.ini, or the following setting can be added:
ConfigPointColRow=0
XY: For projects with mainly vector-data, we did advise to overrule the order to X, Y by the following setting in the config.ini file:
ConfigPointColRow=1
Starting from GeoDsm 14.9.0, the point function and point literal syntax are marked as depreciated as part of a step-by-step plan to phase out the use of the (sometimes unexpected) configuration of the coordinate order with this setting.
- Starting from GeoDMS 14.9.0, advice to use the point_xy(first, second, optional coordinate unit) to specifically provide coordinates in traditional GIS-order. Using functions that depend on the ConfigPointColRow setting now produces a deprecation warning. For the PROJ functions, all coordinates are converted from DMS-order to projection-specific order and, after conversion back, depending on the destination CRS.
- We’ve planned to internally revert the (first=row, second=col) order to (first=x, second=y) order to guarantee that DMS-order == traditional-GIS-order in GeoDms 15.0.0; we expect the area function and boost::polygon clipping functions to be unaffected (as its implementation takes the definition of the DMS-order into account). Still, conversions to string, CSV output, and table-column representation will be affected.
- in a later version, the old functions that depend on the ConfigPointColRow setting will become obsolete.
examples
The following two examples show how to configure a geographic grid-domain based on the setting for the X, Y order:
I (default order of Y, X):
unit<fpoint> rdc_meter: Range = "[{300000, 0}, {625000, 280000})";
parameter<rdc_meter> TopLeftCoord := point(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(float32(-100), float32(100), rdc_meter)
,TopLeftCoord
,spoint
)
,point(int16(0), int16(0))
,point(nrofrows, nrofcols)
)
, Descr = "rdCoords/100m van NW naar SE (3250 rows, 2700 cols)";
II (order overruled to X, Y):
unit<point> rdc_meter: Range = "[{0, 300000}, {280000, 625000})";
parameter<rdc_meter> TopLeftCoord := point(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(float32(100), float32(-100), rdc_meter)
,TopLeftCoord
,spoint
)
,point(int16(0), int16(0))
,point(nrofcols, nrofrows)
)
, Descr = "rdCoords/100m van NW naar SE (3250 rows, 2700 cols)";
III (advised from GeoDMS 14.9.0):
unit<fpoint> rdc_meter := Range(fpoint, point_xy(0, 300000), point_xy(280000, 625000));
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)";