• 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.

Resample Issue

Messages
11
Country
unitedstates
I used Gdalwarp to reproject a group of Geotiff images to WGS84 format. I then saved the tags for each image.

I resampled the images and the resulting bgl file displayed in FSX. It had some black borders and the color wasn't right. I edited the images color and saved them as tiff images. Using geotifcp I put the tags back in the tiff images. I rewrote the INF file with the retagged file names. I changed the null to 0,0,0 and tried to resample.

Resample hung and would not run. It gave me the TimeDate warning, which I've read isn't important. It also stated it cannot resample with 0,0 as the images pixel dimensions.

If someone can tell me what I did, or didn't do, I'd truly appreciated it. I'd hate to have to reproject the images again.
 

arno

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

Can you try to run a gdalinfo on the images after you put the geo information back? Do it still how the same projection information as before you edited?
 
Messages
11
Country
unitedstates
Here is the tag info for one of the images using listgeo:
Code:
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0                
         -91.48951834464550.0003339993751050770                
      ModelPixelScaleTag (1,3):
         9.64019947672082e-0119.64019947672082e-0110                
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeGeographic
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GeographicTypeGeoKey (Short,1): GCS_WGS_84
      GeogCitationGeoKey (Ascii,7): "WGS 84"
      GeogAngularUnitsGeoKey (Short,1): Angular_Degree
      GeogSemiMajorAxisGeoKey (Double,1): 6378137          
      GeogInvFlatteningGeoKey (Double,1): 298.257223563    
      End_Of_Keys.
   End_Of_Geotiff.

GCS: 4326/WGS 84
Datum: 6326/World Geodetic System 1984
Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)

Corner Coordinates:
Upper Left    ( 91d29'22.27"W,  0d 0' 1.20"N)
Lower Left    ( 91d29'22.27"W,  0d 0' 1.20"N)
Upper Right   ( 91d29'22.26"W,  0d 0' 1.20"N)
Lower Right   ( 91d29'22.26"W,  0d 0' 1.20"N)
Center        ( 91d29'22.26"W,  0d 0' 1.20"N)
Here is the same image after editing with PSP:
Code:
Driver: GTiff/GeoTIFF
Files: bwg_1_wgs84.tif
Size is 7007, 3432
Coordinate System is `'
Metadata:
  TIFFTAG_SOFTWARE=Paint Shop Pro 8.0
  TIFFTAG_DATETIME=Paint Shop Pro 8.0
  TIFFTAG_ARTIST=
  TIFFTAG_XRESOLUTION=200
  TIFFTAG_YRESOLUTION=200
  TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 3432.0)
Upper Right ( 7007.0,    0.0)
Lower Right ( 7007.0, 3432.0)
Center      ( 3503.5, 1716.0)
Band 1 Block=7007x8 Type=Byte, ColorInterp=Red
Band 2 Block=7007x8 Type=Byte, ColorInterp=Green
Band 3 Block=7007x8 Type=Byte, ColorInterp=Blue
Here is the info after using geotifcp to inject the tag:
Code:
Driver: GTiff/GeoTIFF
Files: BWG_1_WGS84_Edit.tif
Size is 7007, 3432
Coordinate System is `'
GCP Projection =
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
          (0,0) -> (-91.4895183446455,0,0)
Metadata:
  TIFFTAG_SOFTWARE=Paint Shop Pro 8.0
  TIFFTAG_DATETIME=Paint Shop Pro 8.0
  TIFFTAG_ARTIST=
  TIFFTAG_XRESOLUTION=200
  TIFFTAG_YRESOLUTION=200
  TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 3432.0)
Upper Right ( 7007.0,    0.0)
Lower Right ( 7007.0, 3432.0)
Center      ( 3503.5, 1716.0)
Band 1 Block=7007x8 Type=Byte, ColorInterp=Red
Band 2 Block=7007x8 Type=Byte, ColorInterp=Green
Band 3 Block=7007x8 Type=Byte, ColorInterp=Blue

Resampling worked fine the first time but after editing the images it's not working. It looks like PSP put "stuff" in the tag that geotifcp didn't overwrite.

Thanks
Tom
 

arno

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

It seems the geo information has not been inserted back correctly. In the last listing I do not see any mention of the bounds of the images in lat/lon.
 
Messages
11
Country
unitedstates
Thanks Arno, I can't seem to find a way to strip, or overwrite, the PSP header before injecting the Geotiff tag. GeoTifcp seems to create some sort of hybrid file that won't overwrite the PSP coordinates. I don't know enough to say for certain.

I'll try different option switches with listgeo and geotifcp to see if I can come up with different results. I'll let you know.

___________
tom
 
Messages
506
Country
unitedstates
Once you have your geo data and then manually edit the source file, why not just use that geo data in the INF file instead of remaking the image as a GeoTiff?

Once I generate a GeoTiff and what's called a .TFW file (holds boundary geo data) I edit the source, save to a BMP and use the Upper Left Corner data in the INF file. I wrote a little program to handle the TFW files and INF file creation, as there were/are a lot of source files and all that cutting and pasting would have driven me mad. But for a few files (?), trying to fix something that doesn't need fixing is a waste of time, IMO.
 
Messages
11
Country
unitedstates
I'll sure try and see how it lines up.

For me, this is a small learning project in preparation for the larger one I'm planning. It's all an experiment to see what method I'm most comfortable with.

Thanks

_________
tom
 

arno

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

Putting it in the INF file should also work indeed. Personally I prefer to use GeoTIFF files, since that allows me to use a very simple INF file. I am too lazy to fill in all those numbers in the INF file :D.
 
Messages
506
Country
unitedstates
I am too lazy to fill in all those numbers in the INF file :D.

It's surprising to see how a few lines of spaghetti-coded BASIC can automate some of the "mind numbing" work involved in making scenery! :idea:
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
True, but personally I find making a GeoTIFF with FWTools just as easy (I use that tool often at work as well).
 
Messages
11
Country
unitedstates
Alright gentlemen, I've been at this for a week now and cannot seem to find the right solution.

I gave up on trying to insert the data for the geotiff images. Using PSP I saved them as 24bit BMP's and relayed the data using the inf file. I entered the coordinates of the top left corner as well as the y & xdim with 1 meter resolution, which is native. I've reset the LOD about 10 different ways. Images and the directories locations are correctly listed. I've tried multi and single source. Each time resample does it's thing, without error, and creates the bgl. The bgl can be viewed with TMFViewer at the various LOD and all appears correct to me. The bgl is moved to my addon directory and my FSX setting are all set for the highest resolutions.

I cannot get the imagery to show in FSXA. I've read through the SDK, checked, and re-checked my figures many many times. There is nothing else in the area but what Microsoft put there. Can anyone tell me where else to look for this problem.

Thanks

__________
tom
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,945
Country
us-wisconsin
You need to show us the INF file and give us the size of the bitmaps, and masks.

Dick
 
Messages
11
Country
unitedstates
This was originally 6 images projected to WGS84. First, I resampled all 6 "as is" and they displayed in FSX "as is". After modifying the images I ran into trouble (see above). I've attempted many different procedures including deleting everything and starting over by re-projecting the original UTM geotiffs again. Now I can't get the originals to render as they had originally. It's as if something very small has changed and I can't find where it is. I've tried so many ways to render I feel the problem is not with the images or inf but either resample or something in FSX I changed without realizing.

Resample creates the bgl's without issues. I resample to the SDK directory and then place the bgl in my Addon Scenery\Scenery directory. This directory contains most of my custom bgl's which display correctly.

I dropped the 6 images and have been working with one or two images to keep it simple until I resolve my problem. I've tried numerous variations to the inf file. These two compile and are the most common.

Using a geotiff image which is 7059X3434:
Image Info
Code:
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0                
         -86.444978561724837.0313576645638 0                
      ModelPixelScaleTag (1,3):
         1.06814142142497e-0051.06814142142497e-0050                
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeGeographic
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GeographicTypeGeoKey (Short,1): GCS_WGS_84
      GeogCitationGeoKey (Ascii,7): "WGS 84"
      GeogAngularUnitsGeoKey (Short,1): Angular_Degree
      GeogSemiMajorAxisGeoKey (Double,1): 6378137          
      GeogInvFlatteningGeoKey (Double,1): 298.257223563    
      End_Of_Keys.
   End_Of_Geotiff.

GCS: 4326/WGS 84
Datum: 6326/World Geodetic System 1984
Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)

Corner Coordinates:
Upper Left    (-86.4449786,37.0313577)
Lower Left    (-86.4449786,36.9946777)
Upper Right   (-86.3695785,37.0313577)
Lower Right   (-86.3695785,36.9946777)
Center        (-86.4072785,37.0130177)

inf info
Code:
[Source]

Type = GeoTiFF
Layer = Imagery
SourceDir = "."
SourceFile = "BWG_1_WGS84.tif"
SamplingMethod = Gaussian
Variation = Day
NullValue = 0,0,0

[Destination]
DestDir = "."
DestBaseFileName = "BWG_KY"
LOD = AUTO,15

Using BMP images which are 7059X3434 and 7061X3435:

Code:
[Source]
Type = MultiSource
NumberOfSources = 2

[Source1]
Type = BMP
Layer = Imagery
SourceDir = "."
SourceFile = "BWG_1_WGS84.BMP"
ulxMap = -86.444978
ulyMap = 37.0313577
xDim = 0.0000107622181
yDim = 0.0000106930610
SamplingMethod = Gaussian
Variation = Day
NullValue = 0,0,0

[Source2]
Type = BMP
Layer = Imagery
SourceDir = "."
SourceFile = "BWG_2_WGS84.BMP"
ulxMap = -86.444978
ulyMap = 36.995428
xDim = 0.0000106801226
yDim = 0.0000106805310
SamplingMethod = Gaussian
Variation = Day
NullValue = 0,0,0

[Destination]
DestDir = "."
DestBaseFileName = "BWG_KY"
LOD = AUTO
UseSourceDimensions = 1

The bitmaps are 24Bit and both of these examples compile and can be seen in TmfViewer.

They're are no masks.

Thanks
____________
tom
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,945
Country
us-wisconsin
I would try this:

Code:
[Source]
Type = MultiSource
NumberOfSources = 2

[Source1]
Type = BMP
Layer = Imagery
SourceDir = "."
SourceFile = "BWG_1_WGS84.BMP"
ulxMap = -86.444978
ulyMap = 37.0313577
xDim = 0.0000107622181
yDim = 0.0000106930610
Variation = Day
NullValue = 0,0,0

[Source2]
Type = BMP
Layer = Imagery
SourceDir = "."
SourceFile = "BWG_2_WGS84.BMP"
ulxMap = -86.444978
ulyMap = 36.995428
xDim = 0.0000106801226
yDim = 0.0000106805310
Variation = Day
NullValue = 0,0,0

[Destination]
DestDir = "."
DestBaseFileName = "BWG_KY"
LOD = 12, 19
UseSourceDimensions = 1

I got rid of the SamplingMethod = Gaussian, as that only should be in the masking. I also changed the LOD to 12, 19. This assures it should display in FSX. You can set the display to show 7cm. per pixel texture resolution. That isn't too far from what you've got, so resample shouldn't loose too much image data in the interpolation.

If this doesn't do it, you may need to zip the images and inf and attach it here. If it is too big, you may need to use a file-share website to convey it. ( I use Windows Live, as it offers 25GB file storage for free, and it's pretty secure ).

EDITED++++++++++++

I did try your INF, and the result:

attachment.php


So your INF does make a valid BGL... ?

Dick
 
Last edited:
Messages
11
Country
unitedstates
I finally got a bgl to render. It appears my spreadsheet, used for calculating the bmp's Dims, had an error. One of the bmp images was listed with the yDim slightly off. This must have caused the entire bgl to not render. I'm puzzled why Resample didn't complain or at least render a skewed image.

Thanks to everyone. I'm sure I'll be seeking advice quite a bit as I move forward. Your patience is truly appreciated.

____________
tom
 
Top