Geometric models
Shareloc handles two type of geometric models: RPC and Direct location grids.
RPC
RPC is an analytic function for ground (lon,lat,h) to image (r,c) mapping.
It can be summarized as:
where:
, are Rational Polynomial Function
and normalized ground positions.
The Rational Function Polynomial equation numerators and denominators are 20-term cubic polynomial functions, which respects RPC00B convention. This relationship between ground and image is called inverse RPC coefficients. Only inverse coefficients are compulsory, if direct ones are not available then direct localization is computed by iterating on inverse one
Direct mapping, if available can be summarized as:
where:
, are Rational Polynomial Function
and normalized image coordinates (R,C) and normalized altitude H.
Further details are given in RPC in Geotiff, STDI-0002 2.1 (16Nov2000) specification document and Pléiades user guide Appendix C.3.
Supported RPC formats
DIMAP format (V1/V2/V3)
OSSIM keywordlist
Geotiff RPC
All gdal supported format containing rpc (https://gdal.org/drivers/raster/index.html)
RPC class API Example
$ wget https://raw.githubusercontent.com/CNES/shareloc/tests/data/rpc/RPC_PHR1B_P_201709281038393_SEN_PRG_FC_178609-001.XML
$ python3
>>> from shareloc.geomodels import GeoModel
>>> file_dimap = "RPC_PHR1B_P_201709281038393_SEN_PRG_FC_178609-001.XML")
>>> rpc_dimap = GeoModel(file_dimap, geomodel_type = "RPC")
Note : there is a C++ version of RPC geometric model (see Developer Manual.), which can be used by setting geomodel_type = "RPCoptim"
.
this geometric model is under development in current Shareloc version 0.2.1.dev4+gf7cc58e.
Direct location grids
Direct location grid is a sampled geometric model, which contains direct location at each grid cell for H0 to Hn altitude layers.
It can be viewed at 3D grid (row,col,h) as illustrated below :
Note
Within the grid a bilinear interpolation is used between the grid nodes. If a point location outside the grid is requested, shareloc computes an extrapolation that is equivalent to scipy.interpolation.interpn() function.
Grid API Example
$ wget https://raw.githubusercontent.com/CNES/shareloc/tests/data/ellipsoide/loc_direct_grid_PHR_2013072139303958CP.tif
$ python3
>>> from shareloc.geomodels import GeoModel
>>> geotiff_grid_path = "loc_direct_grid_PHR_2013072139303958CP.tif"
>>> geotiff_grid = GeoModel(geotiff_grid_path, "GRID")