shareloc.geomodels.rpc_readers

This module contains the RPC formats handling to instantiate RPC models. RPC models covered are : DIMAP V1, DIMAP V2, DIMAP V3, ossim (geom file), geotiff.

Module Contents

Functions

rpc_reader(geomodel_path[, topleftconvention])

Load from any RPC (auto identify driver)

rpc_reader_dimap_v23(geomodel_path[, topleftconvention])

Load from Dimap v2 and V3

rpc_reader_dimap_v1(geomodel_path[, topleftconvention])

Load from dimap v1

rpc_reader_ossim_kwl(geomodel_path[, topleftconvention])

Load from a geom file

identify_dimap(xml_file)

parse xml file to identify dimap and its version

parse_coeff_line(coeff_str)

split str coef to float list

identify_ossim_kwl(ossim_kwl_file)

parse geom file to identify if it is an ossim model

rpc_reader_via_rasterio(geomodel_path[, topleftconvention])

Load via rasterio RPC object

shareloc.geomodels.rpc_readers.rpc_reader(geomodel_path, topleftconvention=True)[source]

Load from any RPC (auto identify driver) from filename (dimap, ossim kwl, geotiff)

TODO: topleftconvention always to True, set a standard and remove the option

topleftconvention boolean: [0,0] position

If False : [0,0] is at the center of the Top Left pixel If True : [0,0] is at the top left of the Top Left pixel (OSSIM)

:param geomodel_path geomodel filename :return rpc dict filled with parameters

Parameters:
  • geomodel_path (str) –

  • topleftconvention (bool) –

Return type:

Dict

shareloc.geomodels.rpc_readers.rpc_reader_dimap_v23(geomodel_path, topleftconvention=True)[source]

Load from Dimap v2 and V3

Parameters:
  • geomodel_path (str) – path to geomodel

  • topleftconvention (boolean If False : [0,0] is at the center of the Top Left pixel If True : [0,0] is at the top left of the Top Left pixel (OSSIM)) – [0,0] position

Return type:

Dict

:returns rpc_dict

shareloc.geomodels.rpc_readers.rpc_reader_dimap_v1(geomodel_path, topleftconvention=True)[source]

Load from dimap v1

** Deprecated, to clean ? **

Parameters:
  • geomodel_path (str) – path to geomodel

  • topleftconvention (boolean If False : [0,0] is at the center of the Top Left pixel If True : [0,0] is at the top left of the Top Left pixel (OSSIM)) – [0,0] position

Return type:

Dict

shareloc.geomodels.rpc_readers.rpc_reader_ossim_kwl(geomodel_path, topleftconvention=True)[source]

Load from a geom file

Parameters:
  • geomodel_path (str) – path to geomodel

  • topleftconvention (boolean If False : [0,0] is at the center of the Top Left pixel If True : [0,0] is at the top left of the Top Left pixel (OSSIM)) – [0,0] position

Return type:

Dict

shareloc.geomodels.rpc_readers.identify_dimap(xml_file)[source]

parse xml file to identify dimap and its version

Parameters:

xml_file (str) – dimap rpc file

Returns:

dimap info : dimap_version and None if not an dimap file

Return type:

str

shareloc.geomodels.rpc_readers.parse_coeff_line(coeff_str)[source]

split str coef to float list

Parameters:

coeff_str (str) – line coef

Returns:

coeff list

Return type:

list()

shareloc.geomodels.rpc_readers.identify_ossim_kwl(ossim_kwl_file)[source]

parse geom file to identify if it is an ossim model

:param ossim_kwl_fil : ossim keyword list file :type ossim_kwl_file: str :return: ossimmodel or None if not an ossim kwl file :rtype: str

shareloc.geomodels.rpc_readers.rpc_reader_via_rasterio(geomodel_path, topleftconvention=True)[source]

Load via rasterio RPC object

Parameters:
  • geomodel_path – path to geomodel

  • topleftconvention (boolean If False : [0,0] is at the center of the Top Left pixel If True : [0,0] is at the top left of the Top Left pixel (OSSIM)) – [0,0] position

Return type:

Dict