Skip to content

Main content

Geographic Grid Cell Local Index Tool

Calculate geographic grid cell local index from explicit caller-supplied inputs.

Loading tool…

Description

Return floor-divided tile indexes and nonnegative modular local indexes for the supplied column and row.

A geographic grid uses indexes, tile sizes, origins, and cell spacing. Row direction and floor-division policy determine where cells fall, especially for negative indexes or origins defined at an outer corner.

Return floor-divided tile indexes and nonnegative modular local indexes for the supplied column and row.

When to use this tool

Use Geographic Grid Cell Local Index when you need an explicit grid-index or angular-resolution calculation.

How to use the tool and how it works

  1. Enter column, row, columnsPerTile, rowsPerTile. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read tileColumn, tileRow, localColumn, localRow. Use the output convention below.

Require positive integer columnsPerTile and rowsPerTile. Return floor-divided tile indexes and nonnegative modular local indexes for the supplied column and row.1

Input fieldMeaning and unitsAccepted input
columnColumnRequired. Safe integer.
rowRowRequired. Safe integer.
columnsPerTileColumns Per TileRequired. Safe integer; minimum 1.
rowsPerTileRows Per TileRequired. Safe integer; minimum 1.
Output fieldInterpretationReturned shape
tileColumnTile ColumnRequired. Safe integer.
tileRowTile RowRequired. Safe integer.
localColumnLocal ColumnRequired. Safe integer.
localRowLocal RowRequired. Safe integer.
json
{
  "input": {
    "column": -1,
    "row": 9,
    "columnsPerTile": 4,
    "rowsPerTile": 4
  },
  "output": {
    "tileColumn": -1,
    "tileRow": 2,
    "localColumn": 3,
    "localRow": 1
  }
}

Limitations and assumptions

  • Negative global indexes map to negative tiles with nonnegative local positions. Tile sizes are cell counts; geographic coordinates, raster bounds, and physical cell dimensions are not used.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the raster's actual georeferencing transform for geographic placement. Verify corner versus center origin, axis direction, tile dimensions, and bounds before combining index calculations.

References

  1. Calculation and input contract: geography/geographic-grid-cell-local-index — tool.io

Similar or alternative tools