mappymatch.constructs.coordinate#

Classes

Coordinate(coordinate_id, geom, crs)

Represents a single coordinate with a CRS and a geometry

class mappymatch.constructs.coordinate.Coordinate(coordinate_id: Any, geom: Point, crs: CRS)[source]#

Represents a single coordinate with a CRS and a geometry

Attributes:

coordinate_id: The unique identifier for this coordinate geom: The geometry of this coordinate crs: The CRS of this coordinate x: The x value of this coordinate y: The y value of this coordinate

Parameters:
  • coordinate_id (Any)

  • geom (Point)

  • crs (CRS)

coordinate_id: Any#

Alias for field number 0

geom: Point#

Alias for field number 1

crs: CRS#

Alias for field number 2

classmethod from_lat_lon(lat, lon)[source]#

Build a coordinate from a latitude/longitude

Return type:

Coordinate

Parameters:
  • lat (float)

  • lon (float)

Args:

lat: The latitude lon: The longitude

Returns:

A new coordinate

property x: float#
property y: float#
to_crs(new_crs)[source]#

Convert this coordinate to a new CRS

Return type:

Coordinate

Parameters:

new_crs (Any)

Args:

new_crs: The new CRS to convert to

Returns:

A new coordinate with the new CRS

Raises:

A ValueError if it fails to convert the coordinate