revrt.routing.utilities.convert_lat_lon_to_row_col#

convert_lat_lon_to_row_col(points, crs, transform, lat_col='latitude', lon_col='longitude', out_row_name='start_row', out_col_name='start_col')[source]#

Convert latitude and longitude columns to row and column indices

Parameters:
  • points (pandas.DataFrame or geopandas.GeoDataFrame) – Data with latitude and longitude columns that need to be converted to row and column indices.

  • crs (str or pyproj.crs.CRS) – Coordinate reference system for the target grid.

  • transform (affine.Affine) – Affine transform for the target grid.

  • lat_col (str, default "latitude") – Name of latitude column in input point. By default, "latitude".

  • lon_col (str, default "longitude") – Name of longitude column in input point. By default, "longitude".

  • out_row_name (str, default "start_row") – Name of output column for row indices. By default, "start_row".

  • out_col_name (str, default "start_col") – Name of output column for column indices. By default, "start_col".

Returns:

pandas.DataFrame or geopandas.GeoDataFrame – Input points with added row and column index columns.