shareloc.geomodels.rpc_writers

This module contains the tools to write RPCs

Attributes

AVALAIBLE_FORMATS

Functions

rpc_writer(rpc_params, filename[, out_format, override])

writer from RPC dict, upper layer function to handle rpc_params for shareloc.rpc_reader.rpc_reader()

geotiff_rpc_updater(rio_dict, filename[, export_rpb, ...])

geotiff updater

write_rio_rpc_as_rpb(rpc, rpb_path[, sat_id, band_id])

Write .RPB file (Rational Polynomial Coefficients)

rpc_dict_to_rio_rpcs(rpc_params[, topleftconvention])

Load via rasterio RPC object

write_rio_rpc_as_json(rio_rpc_dict, filename)

Write rio rpc as json dict

Module Contents

shareloc.geomodels.rpc_writers.AVALAIBLE_FORMATS = ['geotiff', 'geotiff_rpb', 'rpb', 'json'][source]
shareloc.geomodels.rpc_writers.rpc_writer(rpc_params, filename, out_format='geotiff', override=False)[source]

writer from RPC dict, upper layer function to handle rpc_params for shareloc.rpc_reader.rpc_reader() :param rpc_params : rpc dict from rpc_reader :param filename : output file, in case of out_format is geotiff or geotiff_rpb, filename muse be in existing geotiff :param out_format : output_format in : geotiff, geotiff_rpb, rpb, json :param override : if True override rpc if already present in geotiff

Parameters:
  • rpc_params (dict)

  • filename (str)

  • out_format (str)

  • override (bool)

shareloc.geomodels.rpc_writers.geotiff_rpc_updater(rio_dict, filename, export_rpb=False, force_rpc=False)[source]

geotiff updater

Parameters:
  • rio_dict (Dict) – path to geomodel

  • filename – output filename

  • export_rpb – write an .RPB file

  • force_rpc – if False an exception is raised if filename already contains RPC

shareloc.geomodels.rpc_writers.write_rio_rpc_as_rpb(rpc, rpb_path, sat_id='UNKNOWN', band_id='P')[source]

Write .RPB file (Rational Polynomial Coefficients)

Parameters:
  • rpc (Dict) – Geotiff rpc dict

  • rpc_path – output file (.RPB)

  • sat_id (str) – sat ID (ex: “QB02”)

  • band_id (str) – band ID (ex: “P”)

  • rpb_path (str)

shareloc.geomodels.rpc_writers.rpc_dict_to_rio_rpcs(rpc_params, topleftconvention=True)[source]

Load via rasterio RPC object

Parameters:
  • rpc_params – shareloc rpc reader dict

  • 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

:return rio rpc dict

shareloc.geomodels.rpc_writers.write_rio_rpc_as_json(rio_rpc_dict, filename)[source]

Write rio rpc as json dict

Parameters:
  • rio_rpc_dict – rio rpc dict RPC.to_dict()

  • filename – json file