Implement EPSG:9666 and EPSG:1049 seismic bin grid operation methods - #4807
Implement EPSG:9666 and EPSG:1049 seismic bin grid operation methods#4807yportier wants to merge 2 commits into
Conversation
| formatter->stopInversion(); | ||
| } | ||
|
|
||
| // The target CRS holds bin numbers, which are unit-less, so no unit |
There was a problem hiding this comment.
Is there any round or cast to integer somewhere? I would expect bin numbers to be a whole value.
There was a problem hiding this comment.
That was deliberate. EPSG defines bin grid coordinate systems with a real datatype (EPSG:1051/1052, used by CRS 32596–32599) as well as an integer one (EPSG:32760/32761, used by CRS 32762–32765), both served by these same two methods — the remark on CRS 32596 states bin values may be non-integer. So whether bin numbers are whole values is a property of the coordinate system, not of the method; rounding here would be wrong for the real-valued CRSs and would break invertibility. Guidance note 7-2's formulas have no rounding operator either. I've added a comment at the affine step.
|
You can see the documentation rendered in https://osgeo-proj--4807.org.readthedocs.build/en/4807/ |
The "P6 I=J+90" (EPSG:9666) and "P6 I=J-90" (EPSG:1049) seismic bin grid coordinate operations are special cases of the affine geometric transformation, described in EPSG guidance note 7-2, section 2.4.3.3. They relate the easting/northing of a map grid to the I/J bin numbers of a seismic bin grid, and differ only by the handedness of the bin grid I-axis. They are exported as a single +proj=affine step, preceded, when the source CRS requires it, by the unit conversion and axis swap of the map grid. EPSG orders those operations from the map grid to the bin grid, that is in the direction opposite to the formulas of the guidance note, so it is the reverse formula that is implemented. The added tests use the parameters of the EPSG worked examples (transformations 6918 and 6919); the emitted pipelines reproduce their published coordinates. Fixes OSGeo#4097
Rename k to SF, matching the symbol used in the parameter table of EPSG guidance note 7-2, and describe it as the point scale factor of the map grid rather than restating the name of parameter EPSG:8737, which is misleading on that point. Define each symbol in its own item, with the name and code of the EPSG parameter carrying it. Also record why bin numbers are not rounded: EPSG defines bin grid coordinate systems accepting real values as well as ones restricted to integer values, so that is a property of the coordinate system rather than of these methods.
af71bc7 to
763d32f
Compare
Implements the two seismic bin grid coordinate operation methods requested in #4097, following the structure of 4d64a35 (EPSG:9656 Cartesian Grid Offsets).
Both methods reduce to a single +proj=affine step, differing only in the sign of the first matrix row. EPSG declares these operations from the map grid (source) to the bin grid (target), which is the opposite direction to how the formulas are written in guidance note 7-2, so the implemented formula is the guidance note's reverse one.
Validated against EPSG's own worked examples (transformations 6918 and 6919, conversions 32698 and 32699). The I=J−90 example uses a ftUS map grid, which exercises the unit conversion path.
Not included: the four EPSG records themselves. Importing them needs conversion_table widened from 7 to 10 parameters and other_transformation from 9 to 10, a DATABASE.LAYOUT.VERSION.MINOR bump and a full data/sql regeneration. Since all four are placeholder examples ("enter here applicable extent"), they were deliberately left out.