Problem with calibrate from geotiff file

This is the Forum to discuss the use of SBuilderX (version 3.10 and above). For previous versions of SBuilder please use the "SBuilder for Flight Simulator FS2004" forum.
MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Problem with calibrate from geotiff file

Post by MarkkuS » Sun Nov 14, 2010 10:32 am

I have a probem with the calibration of a geotiff file.
I'm using SbuilderX 3.10 in Windows 7.

Description:
- I created a geotiff file with fwtools
- gdalinfo shows following data for the file:

Code: Select all

Driver: GTiff/GeoTIFF
Files: ESQO-eniro-stor-geotiff.tif
Size is 1899, 1652
Coordinate System is:
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"]]
Origin = (15.890545899999999,59.405709600000002)
Pixel Size = (0.000033180358083,-0.000021140314770)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  15.8905459,  59.4057096) ( 15d53'25.97"E, 59d24'20.55"N)
Lower Left  (  15.8905459,  59.3707858) ( 15d53'25.97"E, 59d22'14.83"N)
Upper Right (  15.9535554,  59.4057096) ( 15d57'12.80"E, 59d24'20.55"N)
Lower Right (  15.9535554,  59.3707858) ( 15d57'12.80"E, 59d22'14.83"N)
Center      (  15.9220506,  59.3882477) ( 15d55'19.38"E, 59d23'17.69"N)
Band 1 Block=1899x1 Type=Byte, ColorInterp=Red
Band 2 Block=1899x1 Type=Byte, ColorInterp=Green
Band 3 Block=1899x1 Type=Byte, ColorInterp=Blue
In SbuilderX I do following:
- Add map from disk and select the geotiff file
- Sbuilder show message: You may need calibrate this bitmap
- In the Map properties I select "Geo Tiff"
- An Exception window is opened showing problems with "GDI+"

What's wrong?

/Markku

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Problem with calibrate from geotiff file

Post by meshman » Sun Nov 14, 2010 3:40 pm

What is the file size?

What are you trying to accomplish with this source by loading it into SBuilderX?
Lance

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Sun Nov 14, 2010 5:11 pm

The file size is about 9 Mbyte.

I thought a geotiff file would a easier way of calibrating the image, if the Sbulider can read the image coordinates from the file.

Is this a incorrect conclusion?

I have done image calibrations before, but never with a geotiff file.

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Problem with calibrate from geotiff file

Post by meshman » Sun Nov 14, 2010 9:53 pm

A GeoTiff is an image file with all the location data embedded into the file. If the GeoTiff is in Geographic/WGS84 format it can go right through the Resample compiler. Having TFW files to match the GeoTiff is nice, but not mandatory.

That's why I was wondering about what you were trying to get SBX to accomplish? If you add the GeoTiff as a Map from disk, isn't it in the correct location?
Lance

User avatar
luisfeliztirado
Posts: 436
Joined: Sun May 15, 2005 9:15 am
Location: Santo Domingo

Re: Problem with calibrate from geotiff file

Post by luisfeliztirado » Sun Nov 14, 2010 11:35 pm

Hello Markku,

SBuilder X will always automatically show the message: You may need to calibrate this bitmap.

You do not have to calibrate the image if it is a GeoTIFF, so do not do it.

Also, the "GeoTIFF" button in the calibration window only serves to create a GeoTIFF file from a non-GeoTIFF Map, so there as well, do not press that button.

Simply add your GeoTIFF to the SBuilderX workspace and it will automatically be in the right place, just cancel out of the calibration window.

Best regards.
Luis

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Tue Nov 16, 2010 4:30 pm

Thank for the answers!
Now I understand how-to use geotiff-maps!

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Sat Nov 20, 2010 2:07 pm

I have still problems with geotiff map files.

I have have created a geotiff file with coordinates (according to fwtools/gdalinfo):

Code: Select all

Upper Left  (  15.6000000,  59.5000000) ( 15d36'0.00"E, 59d30'0.00"N)
Lower Left  (  15.6000000,  59.3000000) ( 15d36'0.00"E, 59d18'0.00"N)
Upper Right (  16.2000000,  59.5000000) ( 16d12'0.00"E, 59d30'0.00"N)
Lower Right (  16.2000000,  59.3000000) ( 16d12'0.00"E, 59d18'0.00"N)
Center      (  15.9000000,  59.4000000) ( 15d54'0.00"E, 59d24'0.00"N)
In SbuilderX I do following:
- Add map from disk
- The map properties window shows:

Code: Select all

North Lat: 59,5099108
South Lat: 59,3099108
West Lon: 15,7339763
East Long: 15,9339763
-

Could this be a problem with the period character?
The Swedish locale is using a comma character instead of a period.

User avatar
luisfeliztirado
Posts: 436
Joined: Sun May 15, 2005 9:15 am
Location: Santo Domingo

Re: Problem with calibrate from geotiff file

Post by luisfeliztirado » Sat Nov 20, 2010 11:31 pm

Hello Markkus,

Because of operating system limitations, you must use a period as decimal separator in your regional settings, or SBuilderX and many other FS tools will not work correctly.

Best regards.
Luis

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Sun Nov 21, 2010 2:28 pm

Hi again!

I have now changed the decimal separator to a period, but SbuilderX still does not read the coordinates.

But the gdalinfo shows the coordinates with period as decimal separator, when queering the tif-file.

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Problem with calibrate from geotiff file

Post by meshman » Sun Nov 21, 2010 5:29 pm

Here's something to try. Convert the GeoTiff to a BMP file. I use IrfanView for such things. I "love" IrfanView! Name the BMP something simple, like Test1.BMP. Then make a text file named Test1.txt with a layout like this;

[GEOGRAPHIC]
Name=test1
North=41.926803206488
South=41.8920550237883
West=-120.52001953125
East=-120.355224609375

Plug your coordinates into the proper place. Copy the BMP and TXT file to the \Work folder and see if SBX will load the file from disk?
Lance

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Mon Nov 22, 2010 5:43 pm

meshman wrote:Here's something to try. Convert the GeoTiff to a BMP file. I use IrfanView for such things. I "love" IrfanView! Name the BMP something simple, like Test1.BMP. Then make a text file named Test1.txt with a layout like this;
[GEOGRAPHIC]
Name=test1
North=41.926803206488
South=41.8920550237883
West=-120.52001953125
East=-120.355224609375
Plug your coordinates into the proper place. Copy the BMP and TXT file to the \Work folder and see if SBX will load the file from disk?
It does not work!

I have also tried several other combinations:
- Created a new project, added the bmp-map, got wrong coordinates, written a new data file, checked the coordinates were ok in the txt-file
- Created a new project, moved to a different not default position, added the map created above and SbuildX shows wrong coordinates!

I have tried above with both a period and a comma as a decimal separator.

I'm using Windows 7 (32-bit), could this be a problem?

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Problem with calibrate from geotiff file

Post by meshman » Tue Nov 23, 2010 1:11 am

Is it possible to zip up the original GeoTiff file and upload to a file service so that it can be looked at?

You're using FW Tools to reproject the file to Geographic/WGS84, so it helps to know what the original Projection data is.

Once the coordinates are known SBuilderX should import the BMP file. Unless those coordinates are coming out wrong some where along the way.
Lance

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Wed Nov 24, 2010 6:21 pm

Ok, I have uploaded to: http://msaweb.se/Fsim/Field.zip

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Problem with calibrate from geotiff file

Post by meshman » Thu Nov 25, 2010 1:17 am

I'm confused here? Your zip file contains a Tif file that has been run through GIMP. Of course it will no longer contain any geo-refrencing data once it's gone into and out of an image editor, be it GIMP or most any other image editor. There are Tiff files and then there are GeoTiff files. Orignially you mentioned the GeoTiff was 9mb in size. Where did the shrinkage come from in file size? Is the original file only 250x234 pixels in size?

I don't use the FWTools, as I have another program to do conversions to the format that FSX requires. I can't address where the problem lies in the workings of the file from one format to another or from one projection/datum to another. I can only try to eliminate that the problem is not with SBX, which generally is the case.

I'd be happy to look at the file that you first started with, the GeoTiff. I can't try to fill in the gaps of what's been done from original file to current file without knowing the original file is good.
Lance

MarkkuS
Posts: 16
Joined: Fri Apr 27, 2007 2:30 pm

Re: Problem with calibrate from geotiff file

Post by MarkkuS » Sat Nov 27, 2010 11:03 am

I'm also confused! :-)

Do you mean the uploaded does not contain a valid geotiff file?

I have downloaded the file, unziped it, and the gdlainfo shows following:

Code: Select all

Driver: GTiff/GeoTIFF
Files: field-geo.tif
Size is 250, 234
Coordinate System is:
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"]]
Origin = (15.895860000000001,59.397640000000003)
Pixel Size = (0.000163760000000,-0.000083504273504)
Metadata:
  TIFFTAG_DOCUMENTNAME=C:\Users\Markku\Mina dokument\Flygsim\Sceneri\ESQO_Arboga\Bilder\Flygbild\fältet.tif
  TIFFTAG_IMAGEDESCRIPTION=Created with GIMP
  TIFFTAG_XRESOLUTION=72
  TIFFTAG_YRESOLUTION=72
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  15.8958600,  59.3976400) ( 15d53'45.10"E, 59d23'51.50"N)
Lower Left  (  15.8958600,  59.3781000) ( 15d53'45.10"E, 59d22'41.16"N)
Upper Right (  15.9368000,  59.3976400) ( 15d56'12.48"E, 59d23'51.50"N)
Lower Right (  15.9368000,  59.3781000) ( 15d56'12.48"E, 59d22'41.16"N)
Center      (  15.9163300,  59.3878700) ( 15d54'58.79"E, 59d23'16.33"N)
Band 1 Block=250x8 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=250x8 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=250x8 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=250x8 Type=Byte, ColorInterp=Alpha
I must admit I don't know anything about geotiff files.
But as I understand it, it doesn't matter what the orginal tif-file (without geo-info) contains?
I thought I could put any image in the tiff and when the coordinates are added, the geotiff file will be streched/put on the correct coordinates in Sbuilder.
Last edited by MarkkuS on Sun Nov 28, 2010 6:53 am, edited 1 time in total.

Post Reply