shareloc.proj_utils

This module contains the projection functions for shareloc

Module Contents

Functions

coordinates_conversion(coords, epsg_in, epsg_out)

Convert coords from a SRS to another one.

transform_index_to_physical_point(transform, row, col)

Transform index to physical point

transform_physical_point_to_index(trans_inv, row_geo, ...)

Transform physical point to index

shareloc.proj_utils.coordinates_conversion(coords, epsg_in, epsg_out)[source]

Convert coords from a SRS to another one. :param coords: coords to project :type coords: numpy array of 2D coords (shape (2,) or (N,2) or 3D coords (shape (3,) or (N,3)) :param epsg_in: EPSG code of the input SRS :type epsg_in: int :param epsg_out: EPSG code of the output SRS :type epsg_out: int :returns: converted coordinates :rtype: numpy array of 2D coord (N,2) or 3D coords (N,3)

shareloc.proj_utils.transform_index_to_physical_point(transform, row, col)[source]

Transform index to physical point

Parameters:
  • row (float or 1D np.ndarray) – row index

  • col (float or 1D np.ndarray) – col index

  • transform (Affine) – Affine function for georeference

Returns:

Georeferenced coordinates (row, col)

Return type:

Tuple(georeference row float or 1D np.ndarray, georeference col float or 1D np.ndarray)

shareloc.proj_utils.transform_physical_point_to_index(trans_inv, row_geo, col_geo)[source]

Transform physical point to index

Parameters:
  • row_geo (float or 1D np.ndarray) – physical point row

  • col_geo (float or 1D np.ndarray) – physical point col

  • trans_inv (Affine) – Affine function for georeference

Returns:

index coordinates (row, col)

Return type:

Tuple(row float or 1D np.ndarray, col float or 1D np.ndarray)