Represents the unit mesh cell (mesh cell or cell shortly).

This is a quadruplet of the mesh nodes (and mesh unit), and has no other MeshNode inside this in the meshUnit.

The cell is, roughly, a square with meshUnit [km] length edges.

const point = new Point(36.10377479, 140.087855041);

const cell = MeshCell.ofPoint(point, 1);
// Prints true
console.log(cell.eq(
MeshNode.ofMeshcode(54401027),
MeshNode.ofMeshcode(54401028),
MeshNode.ofMeshcode(54401037),
MeshNode.ofMeshcode(54401038),
1
));

Constructors

  • Makes as MeshCell.

    Parameters

    Returns MeshCell

    const point = new Point(36.10377479, 140.087855041);

    const cell = MeshCell.ofPoint(point, 1);
    // Prints true
    console.log(cell.eq(
    MeshNode.ofMeshcode(54401027),
    MeshNode.ofMeshcode(54401028),
    MeshNode.ofMeshcode(54401037),
    MeshNode.ofMeshcode(54401038),
    1
    ));

Accessors

  • get meshUnit(): MeshUnit
  • Returns the mesh unit.

    Returns MeshUnit

    const point = new Point(36.10377479, 140.087855041, 10.0);

    let cell = MeshCell.ofPoint(point, 1);
    console.log(cell.meshUnit === 1); // Prints true

    let cell = MeshCell.ofPoint(point, 5);
    console.log(cell.meshUnit === 5); // Prints true
  • get northEast(): MeshNode
  • Returns the north-east node of the cell.

    Returns MeshNode

    const point = new Point(36.10377479, 140.087855041, 10.0);

    const cell = MeshCell.ofPoint(point, 1);
    // Prints true
    console.log(cell.northEast.equals(MeshNode.ofMeshcode(54401038)));
  • get northWest(): MeshNode
  • Returns the north-east node of the cell.

    Returns MeshNode

    const point = new Point(36.10377479, 140.087855041, 10.0)

    const cell = MeshCell.ofPoint(point, 1);
    // Prints true
    console.log(cell.northWest.eq(MeshNode.ofMeshcode(54401037)));
  • get southEast(): MeshNode
  • Returns the north-west node of the cell.

    Returns MeshNode

    const point = Point(36.10377479, 140.087855041, 10.0);

    const cell = MeshCell.ofPoint(point, 1);
    // Prints true
    console.log(cell.northWest.eq(MeshNode.ofMeshcode(54401037)));
  • get southWest(): MeshNode
  • Returns the south-east node of the cell.

    Returns MeshNode

    const point = Point(36.10377479, 140.087855041, 10.0);

    const cell = MeshCell.ofPoint(point, 1);
    // Prints true
    console.log(cell.southEast.equals(MeshNode.ofMeshcode(54401028)));

Methods

  • Returns true when other is equal to this.

    Parameters

    • other: unknown

    Returns other is MeshCell

    const cell = MeshCell.fromMeshcode(54401027, 1);
    // Prints true
    console.log(cell.eq(MeshCell.fromMeshcode(54401027, 1)));
    // Prints false
    console.log(cell.eq(MeshCell.fromMeshcode(0, 1)));
  • Returns true is other is not equal to this.

    Parameters

    • other: unknown

    Returns boolean

    const cell = MeshCell.fromMeshcode(54401027, 1);
    // Prints false
    console.log(cell.ne(MeshCell.fromMeshcode(54401027, 1)));
    // Prints true
    console.log(cell.ne(MeshCell.fromMeshcode(0, 1)));
  • Return the unit cell which has node as a south-east node.

    Parameters

    • node: MeshNode

      The south-west mesh node of the resulting cell

    • meshUnit: MeshUnit

      The unit of the mesh

    Returns MeshCell

    The meth cell

    const cell = MeshCell.fromMeshNode(MeshNode.ofMeshcode(54401027), 1);
    // Prints true
    console.log(cell.eq(
    new MeshCell(
    MeshNode.ofMeshcode(54401027),
    MeshNode.ofMeshcode(54401028),
    MeshNode.ofMeshcode(54401037),
    MeshNode.ofMeshcode(54401038),
    1
    )
    ));
  • Return the unit cell which has node as a south-east node.

    Parameters

    • meshcode: number

      The meshcode

    • meshUnit: MeshUnit

      The unit of the mesh

    Returns MeshCell

    The meth cell

    const cell = MeshCell.fromMeshcode(54401027, 1);
    // Prints true
    console.log(cell.eq(
    new MeshCell(
    MeshNode.ofMeshcode(54401027),
    MeshNode.ofMeshcode(54401028),
    MeshNode.ofMeshcode(54401037),
    MeshNode.ofMeshcode(54401038),
    1
    )
    ));
  • Makes a MeshCell which contains the Point.

    We note that the result does not depend on Point.altitude.

    Parameters

    Returns MeshCell

    The mesh cell

    Point.meshCell

    const point = new Point(36.10377479, 140.087855041, 10.0);

    let cell = MeshCell.fromPoint(point, 1);
    console.log(cell.equals(
    new MeshCell(
    MeshNode.ofMeshcode(54401027),
    MeshNode.ofMeshcode(54401028),
    MeshNode.ofMeshcode(54401037),
    MeshNode.ofMeshcode(54401038),
    1
    )
    ));

    let cell = MeshCell.fromPoint(point, 5);
    console.log(cell.equals(
    new MeshCell(
    MeshNode.ofMeshcode(54401005),
    MeshNode.ofMeshcode(54401100),
    MeshNode.ofMeshcode(54401055),
    MeshNode.ofMeshcode(54401150),
    5
    )
    ));