Skip to content

Implement EPSG:9666 and EPSG:1049 seismic bin grid operation methods - #4807

Open
yportier wants to merge 2 commits into
OSGeo:masterfrom
yportier:seismic_bin_grid_methods
Open

Implement EPSG:9666 and EPSG:1049 seismic bin grid operation methods#4807
yportier wants to merge 2 commits into
OSGeo:masterfrom
yportier:seismic_bin_grid_methods

Conversation

@yportier

@yportier yportier commented Aug 9, 2026

Copy link
Copy Markdown

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.

Comment thread docs/source/operations/transformations/affine.rst Outdated
formatter->stopInversion();
}

// The target CRS holds bin numbers, which are unit-less, so no unit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any round or cast to integer somewhere? I would expect bin numbers to be a whole value.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jjimenezshaw

Copy link
Copy Markdown
Contributor

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.
@yportier
yportier force-pushed the seismic_bin_grid_methods branch from af71bc7 to 763d32f Compare August 11, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants