Mesh resample.exe issue

#1
Hi all, I've found some EXCELLENT mesh data for my area on the USGS site and have got it all converted to GeoTIFFs and ready to go with a .inf file. When I drop the .inf on Resample.exe, the box pops up and rapidly vanishes without giving me any sort of indication what went wrong. For reference, here is my .inf file. I don't know what else to do with the .tif files, they should be in the proper format (as converted by Global Mapper)


[Source]
Type = MultiSource
NumberOfSources = 4

[Source1]
Type = GeoTIFF
Layer = Elevation
SourceDir = "C:\Users\Jon\Documents\The Airport Guys\Documents\Scenery Development\Mesh Workshop"
SourceFile = "USGS_NED_one_meter_x39y412_VA_FEMA_R3_Southwest_A_2016_IMG_2018.tif"

[Source2]
Type = GeoTIFF
Layer = Elevation
SourceDir = "C:\Users\Jon\Documents\The Airport Guys\Documents\Scenery Development\Mesh Workshop"
SourceFile = "USGS_NED_one_meter_x39y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.tif"

[Source3]
Type = GeoTIFF
Layer = Elevation
SourceDir = "C:\Users\Jon\Documents\The Airport Guys\Documents\Scenery Development\Mesh Workshop"
SourceFile = "USGS_NED_one_meter_x40y412_VA_FEMA_R3_Southwest_A_2016_IMG_2018.tif"

[Source4]
Type = GeoTIFF
Layer = Elevation
SourceDir = "C:\Users\Jon\Documents\The Airport Guys\Documents\Scenery Development\Mesh Workshop"
SourceFile = "USGS_NED_one_meter_x40y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.tif"

[Destination]
DestDir = "C:\Users\Jon\Documents\The Airport Guys\Documents\Scenery Development\Mesh Workshop"
DestBaseFileName = "GDYmeshtest"
DestFileType = BGL
LOD = Auto
FractionBits = 7
 
#3
Toprob thank you for the suggestion. This is what I got:


TIFFReadDirectory: Warning (the file name): unknown field with tag 42113 (0xa481) encountered.
GeoTIFF: Only geographic coordinates are supported
Unable to open data source (the file name)
Failed to create data source
 
#6
Hi Jon:

The 'error' message:

"TIFFReadDirectory: Warning (the file name): unknown field with tag 42113 (0xa481) encountered. "

...can be ignored, as it is only an incidental 'status' message seen with some types of GIS Raster TIFF files


BTW: IMHO, you may not need more than a *.INF FractionBits parameter value of "2" or "3" for this project location

Also, you may wish to use "LOD=4,AUTO" to create a larger 'extent' to ensure priority loading over other terrain meshes


USGS NED search coordinates: -82.124997,37.232393

https://prd-tnm.s3.amazonaws.com/St...A_FEMA_R3_Southwest_A_2016_IMG_2018_thumb.jpg

https://prd-tnm.s3.amazonaws.com/St...y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.zip


USGS Metadata for your above example NED source file:

https://www.sciencebase.gov/catalog/item/5bff6adee4b0815414ca872f


Global Mapper Metadata for loaded layer:

FILENAME=USGS_NED_one_meter_x40y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.img ([Downloads]\USGS_NED_one_meter_x40y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.zip)
DESCRIPTION=USGS_NED_one_meter_x40y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.img
UPPER LEFT X=399993.500
UPPER LEFT Y=4130005.500
LOWER RIGHT X=410006.500
LOWER RIGHT Y=4119994.500
WEST LONGITUDE=82.12856906° W
NORTH LATITUDE=37.31233847° N
EAST LONGITUDE=82.01437879° W
SOUTH LATITUDE=37.22109298° N
UL CORNER LONGITUDE=82.12856906° W
UL CORNER LATITUDE=37.31131485° N
UR CORNER LONGITUDE=82.01558990° W
UR CORNER LATITUDE=37.31233847° N
LR CORNER LONGITUDE=82.01437879° W
LR CORNER LATITUDE=37.22211329° N
LL CORNER LONGITUDE=82.12722328° W
LL CORNER LATITUDE=37.22109298° N
PROJ_DESC=UTM Zone 17 / NAD83 / meters
PROJ_DATUM=NAD83
PROJ_UNITS=meters
EPSG_CODE=EPSG:26917
COVERED AREA=100.24 sq km
NUM COLUMNS=10014
NUM ROWS=10012
NUM BANDS=1
PIXEL WIDTH=1 meters
PIXEL HEIGHT=1 meters
MIN ELEVATION=297.608 meters
MAX ELEVATION=725.693 meters
ELEVATION UNITS=meters
BIT DEPTH=32
SAMPLE TYPE=32-bit Floating Point


THIS ELEVATION DATA MUST BE 'RE-PROJECTED' BEFORE ATTEMPTING TO USE WITH SDK RESAMPLE


FYI: Global Mapper (aka "GM") will initially load source files in their native GIS cartographic "projection"; this typically will be a 'non-warped' map format such as in your source file above.

After all your NED elevation source files are all loaded in Global Mapper in the 'non-warped' map format of their native GIS cartographic "projection", one should export a Elevation Grid format GeoTIFF Raster file.

Next, after unloading all files, one loads the 1-piece Elevation Grid format GeoTIFF Raster file.

Then one must re-project that 1-piece Elevation Grid format GeoTIFF Raster file into:

Geographic (Lat-Lon) projection / WGS84 datum / Units in Arc Degrees (aka "EPSG: 4326")


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 internal projection settings of a GIS data file in order to import it and display it within the Global Mapper workspace ...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:

So when one opens a GIS data file, it may by default be displayed in the same 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 workspace 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 when that GIS file is loaded FIRST, re-projected, and then load the other multiple file layers afterwards. :pushpin:



Example settings in Global Mapper for export of elevation data

This configuration may work for certain source data file formats in Global Mapper after downloading and opening a GIS elevation data file ...when that data is to be exported for use with FS SDK Resample to output a terrain mesh BGL:

1.) Global Mapper Menu > File > Export > Export Elevation Grid Format...

2.) At 'Select Export Format' prompt, choose "GeoTIFF" from the pick list

3.) In 'GeoTIFF Export dialog, on [GeoTIFF options] tab:

File Type: "Elevation (16-bit integer or 32-bit floating point) samples (=Radio Button 'Ticked')

[EDITED]

NOTE: 32-bit floating point is required for use with SDK Resample FractionBits parameter to eliminate contour 'terracing'

[END_EDIT]

Vertical Units: "Meters"

Resampling: "Bicubic Interpolation"

Sample Spacing / Scale: (disregard =Automatically filled in by Global Mapper)

Always Generate Square Pixels: (=Checked)

Always Export At The Fixed Scale 1: "0" (=Not-Checked)

DPI Value To Save in Image (0 for None): "0" (=Not-Checked)

Compression: Default (No Compression)

ADVANCED: Use Tile Rather than Strip Orientation: (=Not-Checked)

ADVANCED: JPEG-in-TIFF Quality: "75" (disregard =Automatically filled in by Global Mapper)

Interpolate to Fill Small Gaps in Data: (=Checked)

Generate TFW (World) File: (=Checked)

Generate PRJ File: (=Checked)

Generate OziExplorer .map File: (=Not-Checked)

ADVANCED: Don't Write GeoTIFF Header: (=Not-Checked)


4.) In 'GeoTIFF Export dialog, on [Tiling] tab:

No Tiling - Just One Export File: (=Radio Button 'Ticked')

Skip Existing Files (Use to Complete Cancelled Exports): (=Not-Checked)


5.) In 'GeoTIFF Export dialog, on [Export Bounds] tab:

All Loaded Data: (=Radio Button 'Ticked')

...or:

Click "[Draw a Box...]" button and select desired area from displayed workspace (or specify otherwise via the GUI in that dialog box Tab).



You should now have a elevation GeoTiff source file compatible for use with FS SDK Resample.


The GeoTiff source file should be ready for use with a *.INF file for processing of the elevation data by FS SDK Resample to output a FS terrain mesh BGL.


For simplicity, you may wish to use Ollyau's "GeoTiff-To-INF" utility to read the Geo-referencing within the file header of the elevation GeoTiff output by GM along with accompanying *.TFW and *.PRJ files, and which will then output a basic *.INF file with computed Geo-referencing parameter values.

http://www.fsdeveloper.com/forum/resources/geotiff-to-inf.119/




NOTE: Ollyau's "GeoTiff-To-INF" utility (as programmed thus far) is only intended for use in creating a *.INF file structured for use with FS SDK Resample to output a custom photo-real aerial imagery BGL (from a aerial imagery source data GeoTiff).

However, with minimal editing in Windows NotePad (or NotePad++), a COPY of that *.INF can be modified for use in creating a *.INF file structured for use with FS SDK Resample to output a custom terrain mesh BGL (from a elevation source data GeoTiff. :idea:


Alternatively, the required Geo-referencing parameter values for a properly structured *.INF file to be used in processing of the elevation GeoTiff source file by FS SDK Resample to output a FS terrain mesh BGL, can be derived from 'Metadata' for your USGS_NED_one_meter_x40y413_VA_FEMA_R3_Southwest_A_2016_IMG_2018.img layer within GM's Overlay Control Center ...after it has been re-projected for use with SDK Resample (Geographic coordinates may sometimes change between different projections :pushpin:).


GaryGB
 
Last edited:
Top