• 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

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi Bill,

Do you maybe a file to test with? I'm curious why you can't get rid of it in an easier way.
 

spotlope

FSDevConf team
Messages
346
Country
portugal
Sure, I can do that. The file is too large to attach here, but I've uploaded it to my sever here.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,932
Country
us-wisconsin
Hi Bill.

Are you trying to get a geotiff for use with resample? And why do you want to loose the 4th band? (That band already has the masking for water transparency)

Dick
 

spotlope

FSDevConf team
Messages
346
Country
portugal
My goal with this imagery is thus:

1. Get a version of the images I can use for resample
2. Once the .inf file is set up with the proper coordinates, make a copy of the images that I can use in Photoshop to do color corrections and data masking

If the water masking is in there, that's great! Problem is, I don't have any tools that can interpret that band and show me that's what's in there. In my copy of GlobalMapper (and in photoshop, should I open the raw jp2 file) it's treating the fourth band as an alpha channel that knocks out all the darker colors in the image, which isn't helpful. My thinking was that by eliminating the fourth band, I could at least get at the actual RGB imagery to being performing the above.
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi Bill, Dick,

The alpha channel doesn't contain the water, I think it's more likely a NIR band. The water is visible in there, but other parts also have values other than 0.

Bill, I just tried gdal_translate on it and it seems to be very slow. Like you said it shows 0 for a long time, but it is actually doing something. Only at that pace I think it might take days to process the whole photo. Normally that's quicker (with the jp2 files I used before).
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,932
Country
us-wisconsin
Hi Bill.

I used a batch file to process the file you had on the server:

Code:
gdalwarp -t_srs EPSG:4326 10TER295460_201007_0x1500m_4B_1.jp2 test.tif

gdal_translate -b 1 -b 2 -b 3 -of GTiff test.tif test_no_alpha.tif

gdalinfo >test_no_alpha.txt test_no_alpha.tif

pause

gdalwarp to make the image wgs84 lat-lon (EPSG:4326)
gdal_translate to get rid of the alpha (it is weird, isn't it?)
gdalinfo to save the co-ordinates so you can make an .inf after you photoshop.

My computer processed this pretty quickly. I'm using a 64-bit version OSGEO4W (OSGEO4W64) on Windows 10 home.

Dick
 

spotlope

FSDevConf team
Messages
346
Country
portugal
I wondered if perhaps it wasn't just very, very slow, Arno. I left it running for half and hour yesterday on a test image, and never even got to 10%, so it would be largely useless for the work I'm trying to do. Just the one airport I'm working on would take 13 tiles this size, which would mean days of processing just to get to the start of the project.

Dick, I'm trying out OSGEO4W. Perhaps that will provide some help. Thanks for the batch file, btw. I'll let you know how I get along with it.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
It's weird Dick, I'm also using OSGeo4W64, but it's really slow. Maybe I need to check if an updated version is available. Normally the GDAL tools are much quicker.
 

spotlope

FSDevConf team
Messages
346
Country
portugal
Wow, Dick's solution worked beautifully! I'm not sure why gdal_translate worked great in this case, and so poorly when used on its own (newer version?), but it did. It only took about 3 minutes to do the whole transform from original jp2 to usable GeoTiff. Thanks, Dick, you saved me tons of time.
 
Top