FSX Resmaple.exe Not Compiling

#21
https://www.fsdeveloper.com/forum/threads/resmaple-exe-not-compiling.442820/post-799220

Ok, will download soon.

Here is the metadata:
Code:
FILENAME=C:\Users\Caleb\Documents\CB Simulations\Scenery\X10\Photoreal\Purchace\DG_Satellite_1.tif
DESCRIPTION=DG_Satellite_1.tif
UPPER LEFT X=532999.623
UPPER LEFT Y=2956194.610
LOWER RIGHT X=536320.023
LOWER RIGHT Y=2950002.610
WEST LONGITUDE=80° 40' 6.0787" W
NORTH LATITUDE=26° 43' 35.6746" N
EAST LONGITUDE=80° 38' 5.3075" W
SOUTH LATITUDE=26° 40' 14.1167" N
PROJ_DESC=UTM Zone 17 / WGS84 / meters
PROJ_DATUM=WGS84
PROJ_UNITS=meters
EPSG_CODE=32617
COVERED AREA=20.56 sq km
NUM COLUMNS=11068
NUM ROWS=20640
NUM_BANDS=3
PIXEL WIDTH=0.3 meters
PIXEL HEIGHT=0.3 meters
BIT_DEPTH=24
PHOTOMETRIC=RGB Full-Color
BIT_DEPTH=24
ROWS_PER_STRIP=1
COMPRESSION=None
ORIENTATION=row 0 top, col 0 lhs
PIXEL_SCALE=( 0.3, 0.3, 1 )
TIEPOINTS=( 0.00, 0.00, 0.00 ) --> ( 532999.623, 2956194.610, 0.000 )
MODEL_TYPE=Projection Coordinate System
RASTER_TYPE=Pixel is Area
OK, your aerial imagery file:

C:\Users\Caleb\Documents\CB Simulations\Scenery\X10\Photoreal\Purchace\DG_Satellite_1.tif

...is in a 'native' non-warped local Projection called Universal Transverse Mercator (aka "UTM"), and within that Coordinate Reference System (aka "CRS") projection, your local Zone is 17 (Northern Hemisphere).

The Projection Units are in Meters, and must be re-projected to Arc Degrees when the Projection is changed from the current 'native' UTM Zone 17 (EPSG_CODE:32617) to Geographic (Lat-Lon) Projection (EPSG_CODE:4326)

This projection is not directly compatible with SDK Resample, and must be re-projected to Geographic (Lat-Lon) Projection via a GIS application.

The Datum is WGS 84 (also known as WGS 1984, EPSG:4326)

This Datum is already directly compatible with SDK Resample, and does not need to be re-projected via a GIS application.


FYI: The above Metadata information confirms that you will need to have the "free 14-day full-featured demo" of Global Mapper installed in order to re-project and export DG_Satellite_1.tif ...into a file format compatible for use with SDK Resample.

Remember: Global Mapper version-13 (aka "DLGv32_Pro") does not allow exports or other output. :duck:


I will prepare a step-by-step guide to re-project your aerial imagery file, and will post that here either tonight (Tuesday) or tomorrow (Wednesday). :coffee:


In the mean time, I assume you will install a current version of the "free 14-day full-featured demo" of Global Mapper. :pushpin:


CAVEAT: I suggest that you install that 'current' Global Mapper demo version on your desktop computer, as Blue Marble has recently changed the OpenGL graphics display version minimum requirements to a newer version number, which may not be possible to use on some laptop computers due to older graphics chip-sets not being sufficiently powerful and/or not yet having drivers available ...to run the latest OpenGL code used by Global Mapper 18 or newer. :alert:

https://www.fsdeveloper.com/forum/threads/resmaple-exe-not-compiling.442820/post-799220

Are the "UPPER LEFT X" and "UPPER LEFT Y" entries above what I need to put in the "ulxmap" and "ulymap" fields in my inf?
Normally, BUT... coordinates for the current projection are not correct; this file must be re-projected for use with Resample :alert:

https://www.fsdeveloper.com/forum/threads/resmaple-exe-not-compiling.442820/post-799220

Where in the above code can I find what to put in the yDim and xDim fields in my inf?
PIXEL WIDTH=0.3 meters = 30 cm or ~ 1 Foot
PIXEL HEIGHT=0.3 meters = 30 cm or ~ 1 Foot

BUT... Pixel Width / Height for the current projection are not correct; this file must be re-projected for use with Resample :alert:

After the file is re-projected, you will use the Metadata from the re-projected GeoTIFF file ...not the original GeoTIFF ;)


PS: I assume the purchased DG_Satellite_1.tif file is in full resolution and is not highly-compressed via Mr.Sid (aka JPEG-2000) ?

The reason I ask is, because, AFAIK, there is other free-to-use aerial imagery for the X-10 area available from USGS / USDA. :idea:

GaryGB
 
Last edited:
#22
Hi Caleb:

Some initial considerations are in order prior to starting the re-projection work-flow with your GeoTIFF.

* Always work with a COPY of your original file; keep a backup of the original inside a ZIP file.

CAVEAT:

An important consideration may be necessary when working with Global Mapper due to a change in behavior which was apparently implemented in more recent versions in that program. :pushpin:

It seems that Global Mapper (sometimes) dynamically accepts and defaults to the 'native' internal projection settings of a GIS data file in order to import it and display it within the Global Mapper work-space ...even if one has already set the default configuration of Global Mapper to be at "Projection: "Geographic (Latitude / Longitude)", Datum: "WGS84", Planar Units: "ARC DEGREES". :alert:

Thus, when one opens a GIS data file, it may by default be displayed in the same 'native' internal projection stored within that file.


To "force" the re-projection in Global Mapper to make the GIS source data display and export in the format required when that data is to be exported for use with the FS SDK, one must again reset the projection during the work session immediately after one's first GIS data file is loaded ...via this procedure:

The correct configuration to set up in Global Mapper 'before' opening a GIS data file or downloading GIS data ...and AGAIN 'after' opening data files when that data is to be "Exported" for use with the FS SDK:

Global Mapper Menu > Tools > Configure... > [Projection Tab]

Projection: "Geographic (Latitude / Longitude)"

Datum: "WGS84"

Planar Units: "ARC DEGREES"

Parameters:

Attribute: "CENTRAL LONGITUDE"

Value: "0"


BTW: As a visual clue that one has 'remembered" to re-project to WGS84 for ex: FS SDK use, the Global Mapper work-space display of the GIS data should compress vertically and rotate counter-clockwise to some extent. ;)


NOTE: Global Mapper is IMHO likely to yield more consistent results when the GIS file which one needs to re-project is the ONLY file loaded in a particular work session; thus it is preferable to not attempt to use that file as one of multiple files which are being turned on and off in the "Control Center" within a work session.

If it is necessary to attempt isolation of a particular GIS file which one needs to re-project and/or export as the ONLY "active" or visible file within a multiple file layer work session, it may be likely to yield more consistent results if that GIS file is loaded FIRST, re-projected, and to then load other multiple file layers afterwards. :idea:

Let me know when you have the "free 14-day full-featured demo" of Global Mapper installed. :)

GaryGB
 
Last edited:
#23
Example Global Mapper workflow for your aerial imagery: :teacher:

After first opening your GeoTIFF 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.) Global Mapper Menu > File > Open Data File(s)... > Browse / select your:

"C:\Users\Caleb\Documents\CB Simulations\Scenery\X10\Photoreal\Purchace\DG_Satellite_1.tif"


2.) Global Mapper 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.) Global Mapper 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: 24-bit RGB
(2.) Resampling: Default
(3.) Sample Spacing / Scale: (Filled in automatically; IMHO: Do not edit)
(4.) Check "Always Generate Square Pixels"
(5.) Compression pick-list: select "No Compression"
(6.) Check "Generate TFW (World) File
(7.) Check "Generate PRJ File (aka 'projection' info)

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"

Click OK ("Save As" dialog opens); enter desired file name and click "Save"

You should now have a GeoTIFF source file suitable for further use in development for your project. :pushpin:

When this is completed, let me know, and we can discuss optimal settings to use in the *.INF file. :)
 
Last edited:
#24
I quote Charmes:
Quote:
.....as long as you have the coordinates for left, right, top and bottom, you can calculate those by dividing the difference in coordinates by the number of pixels.

eg for xdim

coordinates difference: 126.3426649-126.287294 = 0.0553709

if the width of the image is 6842 pixels, then

0.0553709/6842 = 8.0927945045308389359836305173926e-6

so xdim = 8.0927945045308389359836305173926e-6

All these numbers are just random, but that's how you can do it. The same process is used for ydim.
Unquote
That is (like Gary said) if your TIFF is a WGS84 projection.
For what it is worth. I hope it helps.
 
#26
Example Global Mapper workflow for your aerial imagery: :teacher:

After first opening your GeoTIFF 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.) Global Mapper Menu > File > Open Data File(s)... > Browse / select your:

"C:\Users\Caleb\Documents\CB Simulations\Scenery\X10\Photoreal\Purchace\DG_Satellite_1.tif"


2.) Global Mapper 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.) Global Mapper 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: 24-bit RGB
(2.) Resampling: Default
(3.) Sample Spacing / Scale: (Filled in automatically; IMHO: Do not edit)
(4.) Check "Always Generate Square Pixels"
(5.) Compression pick-list: select "No Compression"
(6.) Check "Generate TFW (World) File
(7.) Check "Generate PRJ File (aka 'projection' info)

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"

Click OK ("Save As" dialog opens); enter desired file name and click "Save"

You should now have a GeoTIFF source file suitable for further use in development for your project. :pushpin:

When this is completed, let me know, and we can discuss optimal settings to use in the *.INF file. :)
I opened the 14-day demo of Global Mapper and followed the steps you outlined above.

Then I opened my re-projected image in DLGv32, found the metadata, and inserted the contents of "UPPER LEFT X" in the metadata into "ulxmap" in the *.inf, and the contents of "UPPER LEFT Y" in the metadata into "ulymap" in the *.inf, and the contents of "PIXEL HEIGHT" in the metadata into "ydim" in the *.inf and the contents of "PIXEL WIDTH" in the metadata into "xdim" in the *.inf. Is this correct?

This is the new inf:
Code:
[Source]
Type = MultiSource
NumberOfSources = 3

[Source1]
Type = TIFF
Layer = Imagery
SourceDir = "."
SourceFile = "X10_imagery.tif"
Variation = January, February, March, April, May, June, July, August, September, October, November, December
Channel_BlendMask = 2.0
Channel_LandWaterMask = 3.0
ulyMap =  26.7265762813
ulxMap =  -80.6683551942
xDim =  0.0000027
yDim =   0.0000027

[Source2]
Type = TIFF
Layer = None
SourceDir = "."
SourceFile = "X10_blendmask_gimp.tif"
SamplingMethod = Gaussian
ulyMap =  26.7265762813
ulxMap =  -80.6683551942
xDim =  0.0000027
yDim =   0.0000027

[Source3]
Type = TIFF
Layer = None
SourceDir = "."
SourceFile = "X10_watermask.tif"
SamplingMethod = Gaussian
ulyMap =  26.7265762813
ulxMap =  -80.6683551942
xDim =  0.0000027
yDim =   0.0000027


[Destination]
DestDir = "."
DestBaseFileName = "x10_photoreal"
DestFileType = BGL
LOD = Auto
UseSourceDimensions = 1
CompressionQuality = 85
When I dragged my inf onto resample it began, and it is compiling as we speak, when it's done I'll test it in the sim. If there are any other changes that should be made to the inf let me know.

Thanks so much for the help. I would have never been able to figure this out without you.
 
#27
Hi Caleb:

First, verify your Exported GeoTIFF was re-projected properly by unloading all open files from the Global Mapper work-space:

1.) Global Mapper Menu > File > Unload All...

2.) Global Mapper Menu > File > Open Data File(s)... > Browse / select your:

"C:\Users\Caleb\Documents\CB Simulations\Scenery\X10\Photoreal\Purchace\DG_Satellite_1.tif"


3.) GMv19.2 Menu > Tools > Control Center... (Control Center dialog opens)

a.) In Control Center dialog > click [Metadata] button

b.) Verify current projection is:

Geographic (Lat-Lon) Projection / WGS84 Datum (aka "EPSG:4326") / Units=Arc Degrees


NOTE: Although the re-projected Metadata is likely to be identical in Global Mapper versions 19.2 (aka "GMv19.2") and 13.x, it is probably a good idea to use the Metadata directly from GMv19.2 via:

GMv19.2 Control Center dialog > click [Metadata] button > click [Copy to Clipboard] button > Paste into Windows NotePad.


I will post further with regard to the INF file parameter values within an hour or so, as I must now depart for an appointment.


PS: If LZW compression was toggled 'on' in GMv19.2, your *.TIF aerial imagery Resample session may take 2 or 3 hours ;)

GaryGB
 
Last edited:
#28
Hi again:

I will be away from my FS development computers until later this afternoon, so I shall be limited to a couple of considerations drawn from memory with regard to the *.INF file parameter values, and based on SDK Resample Docs:

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

https://www.fsdeveloper.com/forum/threads/resmaple-exe-not-compiling.442820/post-799264

I opened the 14-day demo of Global Mapper and followed the steps you outlined above.

Then I opened my re-projected image in DLGv32, found the metadata, and inserted the contents of "UPPER LEFT X" in the metadata into "ulxmap" in the *.inf, and the contents of "UPPER LEFT Y" in the metadata into "ulymap" in the *.inf, and the contents of "PIXEL HEIGHT" in the metadata into "ydim" in the *.inf and the contents of "PIXEL WIDTH" in the metadata into "xdim" in the *.inf. Is this correct?
Yes, IMHO, that is the 'preferred method'; although you can also create a basic *.INF for your GeoTIFF using Ollyau's GeoTIFF2INF utility, then edit it as needed.


Initial Recommendations:

In the [Source1] section, I would use this parameter value instead:

Type = GeoTIFF ; <-- Allows Resample to read internal GeoTIFF Metadata for optimal processing
Layer = Imagery
SourceDir = "."
SourceFile = "X10_imagery.tif"
Variation = January, February, March, April, May, June, July, August, September, October, November, December
Channel_BlendMask = 2.0
Channel_LandWaterMask = 3.0
ulyMap = 26.7265762813
ulxMap = -80.6683551942
xDim = 0.0000027
yDim = 0.0000027


In the [Destination] section, I would use these parameter values instead:

DestDir = "."
DestBaseFileName = "x10_photoreal"
DestFileType = BGL
LOD = 6,Auto ; <-- LODs lower than 6 not needed for aerial imagery, as they are not visible in FS from far away
UseSourceDimensions = 1
CompressionQuality = 100 ; <-- Allows your purchased full resolution aerial imagery to display at highest sharpness
;
; NOTE: Use of CompressionQuality = 85 reduces Resample output BGL size by ~ 40%, but may still look acceptable

Let me know how this *.INF configuration works with SDK Resample (and how it looks in FSX / P3D) for you. :)

GaryGB
 
Last edited:
#30
LOD = 6,Auto ; <-- LODs lower than 6 not needed for aerial imagery, as they are not visible in FS from far away
My satellite imagery is 30 cm/pixel (LOD17 I think). Will setting this to 6 in the INF make things lower resolution when viewed in FS?

Thanks
 
#31
My satellite imagery is 30 cm/pixel (LOD17 I think). Will setting this to 6 in the INF make things lower resolution when viewed in FS?

Thanks
No; the "6" sets the cut-off limit for only the lowest resolution LODs and MIPMAPs of the aerial imagery BGL.

"Auto" allows SDK Resample to automatically set the highest LODs and MIPMAPs based on having read the GeoTIFF internal Metadata, so you will get the highest resolution output in your BGL ...without the useless lower LODs below "6". ;)

GaryGB
 
Last edited:
#32
No; the "6" sets the lowest LOD cut-off limit.

"Auto" allows SDK Resample to automatically set the highest LOD based on having read the GeoTIFF internal Metadata, so you will get the highest resolution output in your BGL ;-)

GaryGB
Ok. Thanks. I will test soon.
 
#33
Remember the caveat about use of LZW compression when outputting GeoTIFFs / TIFs from a graphics application and/or Global Mapper.

LZW is useful as it is "non-lossy" and IMHO therefore 'better' than the "always lossy" PTC compression used by SDK Resample, but it will require more Resample processing time.

It is an option to be used (only ?) if needed to fit more data into a BGL which otherwise might have exceeded the SDK Resample BGL 'output' size limit or FSX and P3D BGL 'read' limit of 2 GB (...which can occur when working with larger coverage area extents and/or higher resolution data). ;)

GaryGB
 
Last edited:
#36
Yes; all Season / Night / Mask images derived as copies from the original aerial imagery GeoTIFF should have the same identical pixel Row and Column totals, and Geo-referencing parameter values in the *.INF file ...as that original aerial imagery GeoTIFF.

[EDITED]

You should be able to load them into Global Mapper and 'Geo-rectify' them using the same Geo-referencing parameter values in the Metadata file as that original aerial imagery GeoTIFF used before it was re-projected ...using a UTM - Zone 17 (Northern Hemisphere) Projection / WGS84 Datum with Meters as Units.

[END_EDIT]

Then they must be re-projected prior to export in the GIS format required by SDK Resample using the procedural steps I outlined for you above (substitute the actual name of the image file to be Geo-rectified):

https://www.fsdeveloper.com/forum/threads/resmaple-exe-not-compiling.442820/post-799229

If you need help with the Geo-rectification procedure, just ask, as that process requires one to know how to enter the "image pixel coordinate numbers" (not to be confused with 'Geographic coordinates') for the Upper Left (NW) and Lower Right (SE) corners of the individual image currently being loaded and Geo-rectified. :pushpin:

GaryGB
 
Last edited:
#37
Yes; all Season / Night / Mask images derived as copies from the original aerial imagery GeoTIFF should have the same identical pixel Row and Column totals, and Geo-referencing parameter values in the *.INF file ...as that original aerial imagery GeoTIFF.
My masks in the INF have the same "ulymap," "ulxmap," "xdim," and "ydim" entries as the "ulymap," "ulxmap," "xdim," and "ydim" entries for the imagery source in the INF.
[EDITED]

You should be able to load them into Global Mapper and 'Geo-rectify' them using the same Geo-referencing parameter values in the Metadata file as that original aerial imagery GeoTIFF used before it was re-projected ...using a UTM - Zone 17 Projection / WGS84 Datum with Meters as Units.

[END_EDIT]

Then they may be re-projected prior to export in the GIS format required by SDK Resample using the procedural steps I outlined for you above (substitute the actual name of the image file to be Geo-rectified):

https://www.fsdeveloper.com/forum/threads/resmaple-exe-not-compiling.442820/post-799229

If you need help with the Geo-rectification procedure, just ask, as that process requires one to know how to enter the 'image pixel coordinate numbers' (not to be confused with Geographic coordinates) for the Upper Left (NW) and Lower Right (SE) corners of the individual image currently being loaded and Geo-rectified. :pushpin:
It would be nice if you you could show me how to Geo-rectify my watermask and blendmask, but before you do so I am going to try one other thing that might fix it. I will let you know if that fixes things, if not then you can show me how to Geo-rectify my watermask and blendmask.

Thank you so much for your help.
 

=rk=

Resource contributor
#39
There is actually so much information on each topic, it would take a lifetime - as in this one we've just lived - to review it. Between that and the crosslinks, it's like a tight orb of existence on the WWW.

 
#40
My solution did not fix the problem, so @GaryGB it would be great if you could show me how to Geo-Rectify my watermask and blendmask as it seems must be done in order for them to line up.

Once again, thank you very much. I appreciate it.
 
Top