• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Semi-Transparent GEOTiffs

Messages
1,964
Country
unitedkingdom
I've gotten some geotiffs from the venerable USGS, however they are sem-transparent. If I put a completely black layer underneath, they appear to be quite fine.

Is there a more professional way to sort them out?

(flattening the image usually works, but not in this circumstance).

...Actually, flattening, IFIRC, puts a white layer underneath, so this is just the opposite I presume.
 
Last edited:
They have an alpha channel, I've seen this before. What I did was use:

gdal_translate -b 1 -b 2 -b 3 -of GTiff -co INTERLEAVE=PIXEL "17RLM705845_201012_0x3000m_4B_1.jp2" "17RLM705845_201012_0x3000m_4B_1_a.tif"

...where -b 1 -b 2 -b 3 tells gdal_translate to get bands 1,2, and 3 (the RGB) leaving band 4 (the alpha) behind. I then warped & merged the resulting .tifs with gdalwarp. Maybe you can figure out how to tell gdalwarp to ignore the alpha and eliminate the gdal_translate step but I didn't have any luck.
 
Hi,

I was going to start a new thread , but I have a problem which kind of relates to this. Another method I was using to get rid of the alpha channel in 4 band jp2s was to open them in IrfanView, which seems to be the only program that displays them normally for some reason, and then exporting them from IrfanView with Options\Multipage Images\Append Current Image to TIF. This works fine, although you lose the geo data, so then I have a problem actually merging the individual tifs in to a larger image. If I do it the other way and merge the images via QGIS or fwtools, then the file is too big for IrfanView to open. At the moment I think I can do it the way I have just mentioned above, but it is going to take a long time, as I was just joining the images manually in GIMP, and they are not in order, and there is also an over lap, so it all has to be done by eye, zoomed in a fair way. I figure I can join them like this and use the coordinates from the top left corner of the original jp2 (reprojected to EPSG 4326), but like I say this is going to take a long time, apart from the fact that GIMP is struggling with the file size of 12 tiffs joined together (and that is just one section).

I will try your method too Jim, and see if that is going to make the process less time consuming.

I guess just so I'm asking a question, has anyone figured out a quicker way to deal with 4 band jp2s?

Edit: Never mind. Jim's method above just worked on the already merged and reprojected GeoTiff and turned it in to a 3 Band GeoTiff (I'm assuming it's still a GeoTiff). I am actually amazed. I'm not amazed that your idea worked Jim, but I have tried to use a similar method before and it didn't work. Thanks for a great tip.


Cheers,
 
Last edited:
Jim, I'm trying to do a similar conversion, so far without luck. I have some JP2 NAIP files from the USGS server that seem to be 4-band, and my version of GlobalMapper doesn't handle them well. I've tried this command:

gdal_translate -b 1 -b2 -b 3 -of GTiff -co INTERLEAVE=PIXEL "[filename].jp2" "[output].tif"

It does convert, although the TIF I end up with won't open in GM (or Photoshop, for that matter). Also, the input JP2 is over 24MB, and the TIF output is only 79KB, so clearly something major got lost in translation. Any notion what might be happening?

Bill
 
Hey Bill, good to see you out and about this fine day! :)

The only thing I can see is there isn't a space between "-b" and "2" but that's probably a forum typo? Also I don't know about gdal_translate but gdalwarp will choke if there's already a file in the output folder with the filename you're trying to output to so you probably need to delete the 79 Kb [output].tif before attempting the command again. Other than that I vaguely remember someone running into some .jp2s they just couldn't do anything with and IIRC they were NAIP tiles so maybe maybe you've found more? If you want to link me to one of your downloads I'd be happy give it a try here.

Jim
 
Just curious that everybody wants to get rid of the valuable NIR information in the 4th band. I usually need to work quite hard to find it :)
 
Just curious that everybody wants to get rid of the valuable NIR information in the 4th band. I usually need to work quite hard to find it :)
My problem is that the fourth band is being interpreted as an alpha channel in the image, rendering it useless for resampling.

Sent from my A0001 using Tapatalk
 
Hey Bill, good to see you out and about this fine day! :)

The only thing I can see is there isn't a space between "-b" and "2" but that's probably a forum typo? Also I don't know about gdal_translate but gdalwarp will choke if there's already a file in the output folder with the filename you're trying to output to so you probably need to delete the 79 Kb [output].tif before attempting the command again. Other than that I vaguely remember someone running into some .jp2s they just couldn't do anything with and IIRC they were NAIP tiles so maybe maybe you've found more? If you want to link me to one of your downloads I'd be happy give it a try here.

Jim
Thanks, Jim. Yeah, the space was just a typo. I've downloaded the conversion scripts package from the USGS site. Maybe they'll work. Fingers crossed! I've got what looks like great images and I can't get at them. So frustrating!

Sent from my A0001 using Tapatalk
 
For a 24 mb jp2 file, I would expect a few hundred mb geotiff. The jp2 has quite good compression normally.

Those gdal_translate scripts look fine. That's how I always do it as well.

Or sometimes I just leave the alpha channel. Resample will ignore it by default any way.
 
Actually resample interprets the 4th channel as a water mask and the entire photoreal comes out "wet".
 
So far, I've had no luck with gdal_translate. I downloaded the GDAL scripts from the USGS server, and they give me the same tiny file. Also, when attempting to convert from jp2 to geotiff, I get this line in the command prompt:

Input file size is 10000, 10000
0

It stops after that. My guess is that it can't read the image (or it's too large?), but there's no error.
 
Jim, I'm trying to do a similar conversion, so far without luck. I have some JP2 NAIP files from the USGS server that seem to be 4-band, and my version of GlobalMapper doesn't handle them well.

Hi Bill:

I'm curious if you may be able to eliminate the 4th Near-Infra-Red (aka "NIR") Band (aka "R-G-B-i") in your version of Global Mapper (aka "GM") via the GeoTIFF export options dialog box ...as alluded to in this online GM documentation:

https://www.bluemarblegeo.com/knowledgebase/global-mapper/GeoTIFF.htm

"Multi-band - This option generates a raster GeoTIFF file with 1 or more bands of data at either 8-, 16-, or 32-bits per band of data. This option is very useful when working with multi-spectral imagery with more than 3 bands of data, like RGBI or Landsat imagery, or data sets with more than 8 bits per color channel. If you select this option, after hitting OK to start the dialog additional dialogs will be presented allowing you to further setup the multi-band export by choosing the input sources for each band in the output image."


Here's a modified version of my recent post on exporting GeoTIFF aerial imagery from Global Mapper...:idea:


Example Global Mapper workflow for exporting aerial imagery as a GeoTIFF:

After first opening a copy of your aerial imagery data file in its native "projection", one must next set Global Mapper to the "projection" required by MSFS / P3D SDK Resample ...so that any subsequent exported data will be correctly formatted:

1.) GM Menu > File > Open Data File(s)... > Browse / select / open [your 4-Band aerial imagery file]; next:

2.) GM Menu > Tools > Configure > [Projection tab]

a.) Configure:

Projection: Geographic (Latitude/Longitude)

Datum: WGS84

Planar Units: Arc Degrees

Parameters > Attribute

Central Longitude = "0"

b.) Click Apply > OK


3.) GM Menu > File > Export > Export Raster Image Format > ("Select Image Format" dialog opens)

4.) In "Select Image Format" dialog pick-list, select "GeoTIFF"; click OK ("GeoTIFF Export Options" dialog opens)

a.) In "GeoTIFF Export Options" dialog > [GeoTIFF Options tab]:

(1) File Type: 'tick' Multi-Band > 'pick' (8-bits per Band) 3 Bands

(2) Palette: < Filled in automatically; IMHO: Do not edit >

(3) Resampling: Default

(4) Sample Spacing / Scale:
(a) X-axis / Y-axis: < Filled in automatically; IMHO: Do not edit >
(b) Always Generate Square Pixels: 'Checked'
(c) Export at the Fixed Scale 1: < 'Un-checked'; IMHO: Do not edit >

(5) TIFF Format Options:
(a) DPI Value to Save in Image (0 For None): "0" < (not used for FS); IMHO: Do not edit >
(b) Compression pick-list: 'pick' "No Compression" (if compression used ...FS SDK Resample may run slow !)
(c) Make Background (Void) Pixels Transparent: < 'Un-checked'; IMHO: Do not edit >
(d) ADVANCED: Use Tile Rather than Strip Orientation: < 'Un-checked' (not used for FS); IMHO: Do not edit >
(e) ADVANCED: JPEG-in-TIFF Quality: < '75' (not used for FS); IMHO: Do not edit >

(6) Interpolate to Fill Small Gaps in Data: 'Checked'

(7) Generate TFW (World) File: 'Checked'

(8) Generate PRJ File (aka 'projection' info): 'Checked'

(9) Generate OziExplorer map File: 'Un-checked'

(10) ADVANCED: Don't Write GeoTIFF Header: 'Un-checked'

b.) In "GeoTIFF Export Options" dialog > [Tiling tab]
(1.) Select "No Tiling - Just One Export File"

c.) In "GeoTIFF Export Options" dialog > [Export Bounds tab]
(1.) Select "All Loaded Data"



Finally, once again in "GeoTIFF Export Options" dialog > [GeoTIFF Options tab]:

...verify settings in:

(1) File Type: 'tick' Multi-Band > 'pick' (8-bits per Band) 3 Bands

...Now, click [OK]; < [Set Up Bands For Export] dialog opens >

(a) In [Set Up Bands For Export] dialog > {Select Input Layer}: 'Check' only your aerial imagery layer


NOTE: These listed layers should correlate exactly with what layers are listed (and/or 'Checked') ...via:

GM Menu > Tools > Control Center... > Overlay Control Center


(b) In [Set Up Bands For Export] dialog > {Select Input Band}: 'link' only your aerial imagery layer to each Band:

* Band 1 [Red color channel]
* Band 2 [Green color channel]
* Band 3 [Blue color channel]

After you 'Check' and 'link' only your aerial imagery layer as input for the R-G-B output bands, click [OK]; < Save As dialog opens>

(c) In ["Save As" dialog], enter your desired output [GeoTIFF file name and path], then click [Save]


AFAIK, you should now have output a "3-Band GeoTIFF" source file for use in development for your project. :pushpin:


PS: One may also wish to use an original copy of any "R-G-B-I" aerial imagery GeoTIFF with the 4th NIR Band intact, for use with Arno's excellent ScenProc ...to further enhance its vegetation detection capabilities when using ScenProc's semi-automated Autogen creation features. ;)


Hope this helps in using GM as a "GUI alternative" to typing obscure GDAL command line switches and parameter values ! :)

GaryGB
 
Last edited:
So far, I've had no luck with gdal_translate. I downloaded the GDAL scripts from the USGS server, and they give me the same tiny file. Also, when attempting to convert from jp2 to geotiff, I get this line in the command prompt:

Input file size is 10000, 10000
0

It stops after that. My guess is that it can't read the image (or it's too large?), but there's no error.

That output doesn't look good indeed. That 0, should grow until it reads 100 (percent). So for sure something is going wrong there. I doubt the file is too big, I have been processing files up to 16 GB with GDAL.
 
I don't know if this can be related to Bill's problem but I just got some NAIP imagery off the map viewer in .jp2 (45.15102 -114.9992) and when I try to do anything with gdalwarp I get "ERROR 6: No translation for Mercator_Auxiliary_Sphere to PROJ.4 format is known." I could run the gdal_translate -b 1 -b 2 -b 3 command and I could even merge two together with gdal_merge. I ran gdalinfo and it said the imagery was already WGS84 and ERViewer said that of the .jp2s as well. ollyau's GeoTiffToInf tool however said I needed to reproject it first and refused to make an .inf.

I googled the error and found this thread:

http://forums.x-plane.org/index.php?showtopic=85342

I ran the suggested command (gdalwarp -s_srs EPSG:3857 -t_srs EPSG:4326 -of gtiff source.jp2 target.tif) and now everything seems normal, the image is now elongated width-wise in PhotoShop from what I'd gotten from the gdal_translate command which is expected, also GeoTiffToInf happily made an .inf. I didn't remove the 4th band but I also didn't end up with transparent image this time, I can just remove the channel in PhotoShop.
 
I don't know if this can be related to Bill's problem but I just got some NAIP imagery off the map viewer in .jp2 (45.15102 -114.9992) and when I try to do anything with gdalwarp I get "ERROR 6: No translation for Mercator_Auxiliary_Sphere to PROJ.4 format is known." I could run the gdal_translate -b 1 -b 2 -b 3 command and I could even merge two together with gdal_merge. I ran gdalinfo and it said the imagery was already WGS84 and ERViewer said that of the .jp2s as well. ollyau's GeoTiffToInf tool however said I needed to reproject it first and refused to make an .inf.

I googled the error and found this thread:

http://forums.x-plane.org/index.php?showtopic=85342

I ran the suggested command (gdalwarp -s_srs EPSG:3857 -t_srs EPSG:4326 -of gtiff source.jp2 target.tif) and now everything seems normal, the image is now elongated width-wise in PhotoShop from what I'd gotten from the gdal_translate command which is expected, also GeoTiffToInf happily made an .inf. I didn't remove the 4th band but I also didn't end up with transparent image this time, I can just remove the channel in PhotoShop.


Interesting, Jim; it seems that the latter command you posted above: :scratchch

(gdalwarp -s_srs EPSG:3857 -t_srs EPSG:4326 -of gtiff source.jp2 target.tif)


...translates imagery from:

"WGS_1984_Web_Mercator_Auxiliary_Sphere" (...aka EPSG:3857 used in aerial imagery tile servers by ex: Google / Bing / etc.)

https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/

...into:

"Geographic (Latitude/Longitude) Projection, WGS84 Datum" (...aka EPSG:4326, or "GCS", required by FS SDK Resample)


CAVEAT
: Both "Projection" and "Datum" must be specified as above for data use with FS SDK Resample


https://msdn.microsoft.com/en-us/library/cc707102.aspx#SourceParameters

http://gis.stackexchange.com/questions/23690/is-wgs84-itself-a-coordinate-reference-system?lq=1



I don't have an example file of NAIP imagery off the National Map Viewer in .jp2 format available to test at the moment; would you be willing to attach- or post a link to- ...the sample you used for the test you described immediately above ? :wave:

http://www.fsdeveloper.com/forum/threads/semi-transparent-geotiffs.432428/#post-720075


I'd like to see what the above file's Metadata looks like in Global Mapper, if you'd be so kind as to "throw us another bone". ;)



PS: The author of the "convert Geo-jp2 files to GeoTif files" tutorial made an easily-overlooked, but very important point ...about the 'slowly-evolving' file base of the USGS:

"NOTE: Not all 10:1 NAIP use the Mercator_Auxiliary_Sphere projection, so be sure to run gdalsrsinfo on your NAIP jp2 to verify the projection system before converting to tif."

http://forums.x-plane.org/index.php?showtopic=85342


Thanks for sharing your insights with us ! :)

GaryGB
 
Last edited:
Hi Gary, the two tiles I downloaded were:

Code:
ftp://rockyftp.cr.usgs.gov/vdelivery/Datasets/Staged/NAIP/id_2013/m_4511449_sw_11_h_20130919_20131118.jp2
ftp://rockyftp.cr.usgs.gov/vdelivery/Datasets/Staged/NAIP/id_2013/m_4511556_se_11_h_20130920_20131118.jp2


Mile Hi airstrip! :)

EDIT: One odd thing I noticed using the command above is that I didn't get the usual black wedges around the perimeter of the reprojected imagery?
 
Last edited:
Hi Jim:

Thanks for the links. :)

Here's the Metadata reported by Global Mapper ("GM") for the above file "m_4511449_sw_11_h_20130919_20131118.jp2"

Code:
FILENAME=D:\Downloads\m_4511449_sw_11_h_20130919_20131118.jp2
DESCRIPTION=m_4511449_sw_11_h_20130919_20131118.jp2
UPPER LEFT X=-12801744.328
UPPER LEFT Y=5651090.183
LOWER RIGHT X=-12794780.828
LOWER RIGHT Y=5641218.683
WEST LONGITUDE=115° 00' 00.0934" W
NORTH LATITUDE=45° 11' 15.0502" N
EAST LONGITUDE=114° 56' 14.8983" W
SOUTH LATITUDE=45° 07' 29.9314" N
UL CORNER LONGITUDE=115° 00' 00.0934" W
UL CORNER LATITUDE=45° 11' 15.0502" N
UR CORNER LONGITUDE=114° 56' 14.8983" W
UR CORNER LATITUDE=45° 11' 15.0502" N
LR CORNER LONGITUDE=114° 56' 14.8983" W
LR CORNER LATITUDE=45° 07' 29.9314" N
LL CORNER LONGITUDE=115° 00' 00.0934" W
LL CORNER LATITUDE=45° 07' 29.9314" N
PROJ_DESC=Mercator / GOOGLE / meters
PROJ_DATUM=GOOGLE MAPS (SPHERE RADIUS 6378137)
PROJ_UNITS=meters
EPSG_CODE=EPSG:3857
COVERED AREA=34.183 sq km
NUM COLUMNS=13927
NUM ROWS=19743
NUM BANDS=4
COLOR BANDS=0,1,2
PIXEL WIDTH=0.5 meters
PIXEL HEIGHT=0.5 meters
SAMPLE TYPE=Unsigned 8-bit Integer
BIT DEPTH=32


Metadata reported by "GM" for the re-projected GeoTIFF output file: "m_4511449_sw_11_h_20130919_20131118.tif"

Code:
FILENAME=D:\Downloads\m_4511449_sw_11_h_20130919_20131118_jp2.tif
DESCRIPTION=m_4511449_sw_11_h_20130919_20131118_jp2.tif
UPPER LEFT X=-115.0000259316
UPPER LEFT Y=45.1875139386
LOWER RIGHT X=-114.9374707543
LOWER RIGHT Y=45.1249809327
WEST LONGITUDE=115° 00' 00.0934" W
NORTH LATITUDE=45° 11' 15.0502" N
EAST LONGITUDE=114° 56' 14.8947" W
SOUTH LATITUDE=45° 07' 29.9314" N
UL CORNER LONGITUDE=115° 00' 00.0934" W
UL CORNER LATITUDE=45° 11' 15.0502" N
UR CORNER LONGITUDE=114° 56' 14.8947" W
UR CORNER LATITUDE=45° 11' 15.0502" N
LR CORNER LONGITUDE=114° 56' 14.8947" W
LR CORNER LATITUDE=45° 07' 29.9314" N
LL CORNER LONGITUDE=115° 00' 00.0934" W
LL CORNER LATITUDE=45° 07' 29.9314" N
PROJ_DESC=Geographic (Latitude/Longitude) / WGS84 / arc degrees
PROJ_DATUM=WGS84
PROJ_UNITS=arc degrees
EPSG_CODE=EPSG:4326
COVERED AREA=34.116 sq km
NUM COLUMNS=19750
NUM ROWS=19743
NUM BANDS=3
COLOR BANDS=0,1,2
PIXEL WIDTH=0.0000032 arc degrees
PIXEL HEIGHT=0.0000032 arc degrees
BIT DEPTH=24
SAMPLE TYPE=Unsigned 8-bit Integer
PHOTOMETRIC=RGB Full-Color
BIT_DEPTH=24
SAMPLE_FORMAT=Unknown Format (0)
ROWS_PER_STRIP=1
COMPRESSION=None
ORIENTATION=row 0 top, col 0 lhs
PIXEL_SCALE=( 0.00000316735075, 0.00000316735075, 1 )
TIEPOINTS=( 0.00, 0.00, 0.00 ) --> ( -115.0000259316, 45.1875139386, 0.0000000000 )
MODEL_TYPE=Geographic lat-long system
RASTER_TYPE=Pixel is Area


And here's the Metadata reported by Global Mapper for the above file "m_4511556_se_11_h_20130920_20131118.jp2"

Code:
FILENAME=D:\Downloads\m_4511556_se_11_h_20130920_20131118.jp2
DESCRIPTION=m_4511556_se_11_h_20130920_20131118.jp2
UPPER LEFT X=-12808701.266
UPPER LEFT Y=5651090.149
LOWER RIGHT X=-12801738.766
LOWER RIGHT Y=5641218.649
WEST LONGITUDE=115° 03' 45.0762" W
NORTH LATITUDE=45° 11' 15.0494" N
EAST LONGITUDE=114° 59' 59.9135" W
SOUTH LATITUDE=45° 07' 29.9306" N
UL CORNER LONGITUDE=115° 03' 45.0762" W
UL CORNER LATITUDE=45° 11' 15.0494" N
UR CORNER LONGITUDE=114° 59' 59.9135" W
UR CORNER LATITUDE=45° 11' 15.0494" N
LR CORNER LONGITUDE=114° 59' 59.9135" W
LR CORNER LATITUDE=45° 07' 29.9306" N
LL CORNER LONGITUDE=115° 03' 45.0762" W
LL CORNER LATITUDE=45° 07' 29.9306" N
PROJ_DESC=Mercator / GOOGLE / meters
PROJ_DATUM=GOOGLE MAPS (SPHERE RADIUS 6378137)
PROJ_UNITS=meters
EPSG_CODE=EPSG:3857
COVERED AREA=34.178 sq km
NUM COLUMNS=13925
NUM ROWS=19743
NUM BANDS=4
COLOR BANDS=0,1,2
PIXEL WIDTH=0.5 meters
PIXEL HEIGHT=0.5 meters
SAMPLE TYPE=Unsigned 8-bit Integer
BIT DEPTH=32


Metadata reported by "GM" for the re-projected GeoTIFF output file: "m_4511556_se_11_h_20130920_20131118.tif"

Code:
FILENAME=D:\Downloads\m_4511556_se_11_h_20130920_20131118_jp2.tif
DESCRIPTION=m_4511556_se_11_h_20130920_20131118_jp2.tif
UPPER LEFT X=-115.0625211700
UPPER LEFT Y=45.1875137282
LOWER RIGHT X=-114.9999754945
LOWER RIGHT Y=45.1249807221
WEST LONGITUDE=115° 03' 45.0762" W
NORTH LATITUDE=45° 11' 15.0494" N
EAST LONGITUDE=114° 59' 59.9118" W
SOUTH LATITUDE=45° 07' 29.9306" N
UL CORNER LONGITUDE=115° 03' 45.0762" W
UL CORNER LATITUDE=45° 11' 15.0494" N
UR CORNER LONGITUDE=114° 59' 59.9118" W
UR CORNER LATITUDE=45° 11' 15.0494" N
LR CORNER LONGITUDE=114° 59' 59.9118" W
LR CORNER LATITUDE=45° 07' 29.9306" N
LL CORNER LONGITUDE=115° 03' 45.0762" W
LL CORNER LATITUDE=45° 07' 29.9306" N
PROJ_DESC=Geographic (Latitude/Longitude) / WGS84 / arc degrees
PROJ_DATUM=WGS84
PROJ_UNITS=arc degrees
EPSG_CODE=EPSG:4326
COVERED AREA=34.111 sq km
NUM COLUMNS=19747
NUM ROWS=19743
NUM BANDS=3
COLOR BANDS=0,1,2
PIXEL WIDTH=0.0000032 arc degrees
PIXEL HEIGHT=0.0000032 arc degrees
BIT DEPTH=24
SAMPLE TYPE=Unsigned 8-bit Integer
PHOTOMETRIC=RGB Full-Color
BIT_DEPTH=24
SAMPLE_FORMAT=Unknown Format (0)
ROWS_PER_STRIP=1
COMPRESSION=None
ORIENTATION=row 0 top, col 0 lhs
PIXEL_SCALE=( 0.00000316735076, 0.00000316735076, 1 )
TIEPOINTS=( 0.00, 0.00, 0.00 ) --> ( -115.0625211700, 45.1875137282, 0.0000000000 )
MODEL_TYPE=Geographic lat-long system
RASTER_TYPE=Pixel is Area



I'll see if I can look into the "black wedges" issue over the weekend. :cool:

GaryGB
 
Hi Bill:

I'm curious if you may be able to eliminate the 4th NIR Band (aka "R-G-B-I") in your version of Global Mapper (aka "GM") via the GeoTIFF export options dialog box ...as alluded to in this online GM documentation:

https://www.bluemarblegeo.com/knowledgebase/global-mapper/GeoTIFF.htm

"Multi-band - This option generates a raster GeoTIFF file with 1 or more bands of data at either 8-, 16-, or 32-bits per band of data. This option is very useful when working with multi-spectral imagery with more than 3 bands of data, like RGBI or Landsat imagery, or data sets with more than 8 bits per color channel. If you select this option, after hitting OK to start the dialog additional dialogs will be presented allowing you to further setup the multi-band export by choosing the input sources for each band in the output image."


Here's a modified version of my recent post on exporting GeoTIFF aerial imagery from Global Mapper...:idea:


Example Global Mapper workflow for exporting aerial imagery as a GeoTIFF:

After first opening a copy of your aerial imagery data file in its native "projection", one must next set Global Mapper to the "projection" required by MSFS / P3D SDK Resample ...so that any subsequent exported data will be correctly formatted:

1.) GM Menu > File > Open Data File(s)... > Browse / select / open [your 4-Band aerial imagery file]; next:

2.) GM Menu > Tools > Configure > [Projection tab]

a.) Configure:

Projection: Geographic (Latitude/Longitude)

Datum: WGS84

Planar Units: Arc Degrees

Parameters > Attribute

Central Longitude = "0"


b.) Click Apply > OK


3.) GM Menu > File > Export > Export Raster Image Format > ("Select Image Format" dialog opens)

4.) In "Select Image Format" dialog pick-list, select "GeoTIFF"; click OK ("GeoTIFF Export Options" dialog opens)

a.) In "GeoTIFF Export Options" dialog > [GeoTIFF Options tab]:

(1) File Type: 'tick' Multi-Band > 'pick' (8-bits per Band) 3 Bands

(2) Palette: < Filled in automatically; IMHO: Do not edit >

(3) Resampling: Default

(4) Sample Spacing / Scale:
(a) X-axis / Y-axis: < Filled in automatically; IMHO: Do not edit >
(b) Always Generate Square Pixels: 'Checked'
(c) Export at the Fixed Scale 1: < 'Un-checked'; IMHO: Do not edit >

(5) TIFF Format Options:
(a) DPI Value to Save in Image (0 For None): "0" < (not used for FS); IMHO: Do not edit >
(b) Compression pick-list: 'pick' "No Compression" (if compression used ...FS SDK Resample may run very slow !)
(c) Make Background (Void) Pixels Transparent: < 'Un-checked'; IMHO: Do not edit >
(d) ADVANCED: Use Tile Rather than Strip Orientation: < 'Un-checked' (not used for FS); IMHO: Do not edit >
(e) ADVANCED: JPEG-in-TIFF Quality: < '75' (not used for FS); IMHO: Do not edit >

(6) Interpolate to Fill Small Gaps in Data: 'Checked'

(7) Generate TFW (World) File: 'Checked'

(8) Generate PRJ File (aka 'projection' info): 'Checked'

(9) Generate OziExplorer map File: 'Un-checked'

(10) ADVANCED: Don't Write GeoTIFF Header: 'Un-checked'

b.) In "GeoTIFF Export Options" dialog > [Tiling tab]
(1.) Select "No Tiling - Just One Export File"

c.) In "GeoTIFF Export Options" dialog > [Export Bounds tab]
(1.) Select "All Loaded Data"



Finally, once again in "GeoTIFF Export Options" dialog > [GeoTIFF Options tab]:

...verify settings in:

(1) File Type: 'tick' Multi-Band > 'pick' (8-bits per Band) 3 Bands

...Now, click [OK]; < [Set Up Bands For Export] dialog opens >

(a) In [Set Up Bands For Export] dialog > {Select Input Layer}: 'Check' only your aerial imagery layer


NOTE: These listed layers should correlate exactly with what layers are listed (and/or 'Checked') ...via:

GM Menu > Tools > Control Center... > Overlay Control Center


(b) In [Set Up Bands For Export] dialog > {Select Input Band}: 'link' only your aerial imagery layer to each Band:

* Band 1 [Red color channel]
* Band 2 [Green color channel]
* Band 3 [Blue color channel]

After you 'Check' and 'link' only your aerial imagery layer as input for the R-G-B output bands, click [OK]; < Save As dialog opens>

(c) In ["Save As" dialog], enter your desired output [GeoTIFF file name and path], then click [Save]


AFAIK, you should now have output a "3-Band GeoTIFF" source file for use in development for your project. :pushpin:


PS: One may also wish to use an original copy of any "R-G-B-I" aerial imagery GeoTIFF with the 4th NIR Band intact, for use with Arno's excellent ScenProc ...to further enhance its vegetation detection capabilities when using ScenProc's semi-automated Autogen creation features. ;)


Hope this helps in using GM as a "GUI alternative" to typing obscure GDAL command line switches and parameter values ! :)

GaryGB

Thanks for the detailed explanation, Gary, but I apparently have an older version (10.02) of GM, because the multiband option isn't present in my GeoTiff export dialog. Holger had walked me through something similar recently, and we discovered that as well. Not sure it's worth ponying up another $500 to get that feature. I'm going to try other options first.
 
A little update on my "progress" with this: I've tried a few methods of getting rid of the 4th band, none that got me to a final GeoTiff that I could use. However, I have managed to remove the 4th band and create a new JP2 using the JP2OpenJPEG driver for gdal_translate. My latest attempt was this:

Code:
gdal_translate -b 1 -b 2 -b 3 -of JP2OpenJPEG -co GeoJP2=YES [input file].jp2 [outputfile].jp2


The resulting JP2 I got looked great (no more IR 4th band!), but it seems to have lost its georeferencing. Apologies in advance for being a bit of a blockhead about this, but I have very little working knowledge of GIS systems - something that should be obvious by now. ;-) Any advice as to how I could perform the above operation while retaining my georeferencing data?
 
Back
Top