https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-4-working-with-satellite-data-d3835b5e2971 A typical workflow to create an image from raw satellite data would be:
- Download data.
- Re-order or assemble bands into the desired order (red, green, blue; or near-infrared, red, green; etc.)
- Increase the resolution with pan-sharpening, if desired.
- Contrast-stretch and color-correct the imagery, either algorithmically or by hand.
- Restore georeferencing information, if necessary.
- Crop, re-project, and re-size image to merge with other data.
gdalinfo 20170717_015226_1027_1B_AnalyticMS.tif
https://www.planet.com/docs/spec-sheets/sat-imagery/ Our data is Analytic Ortho, 4 band. (near-infrared, red, green, blue)
We get a lot of info. Bands are all 16 bit:
- R
- G
- B
- Undefined
Let us try reorder the bands, B G R:
gdal_translate 20170717_015226_1027_1B_AnalyticMS.tif 20170717_015226_1027_1B_AnalyticMS_rgb2.tif -b 3 -b 2 -b 1 -co COMPRESS=DEFLATE -co PHOTOMETRIC=RGB
Eeeh, dark, we need to stretch data. Read statistics: gdalinfo -mm 20170717_015226_1027_1B_AnalyticMS_rgb.tif
Band 1 Block=6600x1 Type=UInt16, ColorInterp=Red Computed Min/Max=1028.000,26802.000 NoData Value=0 Band 2 Block=6600x1 Type=UInt16, ColorInterp=Green Computed Min/Max=1941.000,21155.000 NoData Value=0 Band 3 Block=6600x1 Type=UInt16, ColorInterp=Blue Computed Min/Max=1683.000,28808.000 NoData Value=0
Then stretch to fill data, we see lowest and highest number: 1028 28808
gdal_translate 20170717_015226_1027_1B_AnalyticMS_rgb.tif 20170717_015226_1027_1B_AnalyticMS_rgb_scaled.tif -scale 1028 28808 0 65535 -exponent 0.5 -co COMPRESS=DEFLATE -co PHOTOMETRIC=RGB
There we have it, can see what is there, almost.
gdal_translate -a_srs EPSG:32750 20170717_015226_1027_1B_AnalyticMS_rgb_scaled.tif out.tif
gdal_translate 20170717_015226_1027_1B_AnalyticMS.tif outgeotiff.tif -a_srs EPSG:32750
https://www.mapbox.com/help/processing-satellite-imagery/ https://www.planet.com/products/satellite-imagery/files/1610.06_Spec%20Sheet_Combined_Imagery_Product_Letter_ENGv1.pdf https://www.youtube.com/watch?v=5c7-KJoPle0&feature=player_embedded https://www.planet.com/pulse/color-correction/ https://support.planet.com/hc/en-us/articles/211459138--Using-Planet-GeoTIFFs-in-QGIS