MISS3D / s2p

This repository is not maintained, please use https://github.com/centreborelli/s2p instead.
GNU Affero General Public License v3.0
144 stars 77 forks source link

How get GeoTIFF's RPC #217

Closed valeriodeluca closed 4 years ago

valeriodeluca commented 4 years ago

I leave here some pythons about getting RPCs. Open qgis, load geotiff, open qgis python console:

from osgeo import gdal, gdalconst tif_with_RPCs = gdal.Open('/home/s2p-master/tests/data/input_triplet/img_01.tif', gdalconst.GA_ReadOnly) rpcs = tif_with_RPCs.GetMetadata('RPC') for k, v in rpcs.items(): print(k, v)

RPCs of test img_01.tif:

HEIGHT_OFF 565 HEIGHT_SCALE 525 LAT_OFF 43.2670602556 LAT_SCALE 0.10512198282 LINE_DEN_COEFF 1 -0.000282908867259 0.000244088335328 1.50958009413e-06 0.000171394404203 -1.2607195345e-06 -3.06300465837e-06 6.12371093589e-06 0.000204337995218 -5.57214386516e-05 -2.16441103183e-07 6.21823423978e-07 2.56173494347e-06 4.27759756025e-08 2.91746378047e-06 -1.15709733942e-06 -2.73006665109e-08 -4.30873858271e-08 -2.97606262548e-07 -1.52901614449e-10 LINE_NUM_COEFF -44.2826237734 -13.1574572736 -43.803065818 0.212647221246 0.00131929672202 0.000163909460427 0.000118455113168 -0.0523844604264 0.000776982150953 0.0024503803081 -8.28628371784e-06 0.000334451366957 0.00439141253582 0.000731648376952 0.00193747578355 0.00676920426472 0.00244075377011 -2.88162279129e-06 -5.01790080745e-05 -1.18263781358e-05 LINE_OFF 18339.5 LINE_SCALE 512 LONG_OFF 5.52834836042 LONG_SCALE 0.151615094207 SAMP_DEN_COEFF 1 -0.000404115567309 0.00121910737884 -0.000494259442118 1.76787774928e-05 -1.47856137279e-07 -9.17656737996e-07 -4.07859152672e-06 0.000141266332362 -4.91014503269e-06 -1.67806264509e-08 1.58641296821e-07 1.12235095185e-06 2.58324112444e-09 7.33404646358e-07 -7.11688567622e-08 -7.86828356816e-09 2.09421556055e-08 -1.12222344009e-07 3.72515175303e-09 SAMP_NUM_COEFF -10.36209158 45.8294797426 -12.6404535913 -0.0988050074525 -0.0542015309731 0.0157560635175 -0.00247759658783 0.00915098264421 -0.0394803311741 1.66388956828e-05 0.000124927419726 -0.001652219599 -0.00982946435642 -0.000215175251181 -0.0041016373414 -0.0196886638596 5.83293187933e-05 5.3791560689e-05 0.000265082195739 4.44181708265e-07 SAMP_OFF 18656.5 SAMP_SCALE 512

I ask if it's correct to @carlodef @gfacciol Thanks best Valerio

gfacciol commented 4 years ago

Yes, this code will print the RPC if present. The command lie tool gdalinfo would also print the RPC. Best, Gabriele