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

FWTools reprojection help

Messages
50
Country
us-illinois
I'm trying to reproject a JPEG format image, created by USAPhotomaps from Microsoft Terraserver imagery for the Chicago, IL USA area. Terraserver imagery is in UTM projection, NAD83 datum. I've read the Wiki article by Arno, as well as a few posts and other forums about this, but I'm not having much success. Would someone be able to talk me through reprojecting the image in WGS84 datum and saving it in .bmp format for use in either Photo Scenery Maker or the FS2004 SDK tools? Any help appreciated. I was able to successfully get my image into FS through Photo Scenery Maker, but it is a bit off given that it is in UTM projection rather than the WGS84 needed by FS.

Running gdalinfo on my jpeg image yields the following information:

Image extents: (in UTM format - UTM zone 16)

4652802.00 N
415198.00 W
427992.69 E
4643207.50 S

Image corners: (also UTM)
upper left 415198.000, 4652802.000
lower left 415198.000, 4643202.000
upper right 427998.000, 4652802.000
lower right 427998.000, 4643202.000
center 421598.000, 4648002.000

3200X2400 pixels

Thanks!

Mark
 
Hi Mark,

It seems like you have a JPG2000 image then, since the coordinate information is already in there. That is nice, what you could try to do is run only the gdalwarp program in that case, with a target projection of WGS84. That should work I think, since the source projection is in the file already.
 
Hi Arno. Thank you for your help. I tried the following command, which I think should do what you suggest.

gdalwarp -s_srs "+proj=utm +zone=16 +datum=NAD83" -t_srs "+proj=latlong +datum=WGS84" -of BMP e415200n4658400z16c.jpg chicago1.bmp

I think this should take the source file (e415200n4658400z16.jpg) in UTM format and warp it to a lat/long WGS84 projection and convert to a BMP called Chicago1.bmp

However, I get the following error:

Error 1: Too many points (439 out of 441)failed to transform,
unable to compute output bounds.
0...10...20...30...40...50...60...70...80...90...100 - done.

No output file is created.

Any ideas of what my problem may be? I've tried this on a couple of jpegs created by USAPhotomaps, and have gotten the same error with each. I'm not sure about the file being in the Jpeg2000 format. The file has a standard .jpg extension, with two additional files created - a .JGW and a .txt, which appear to be world files containing the georeference data for the jpeg. Any advice you can offer is greatly appreciated. I'm stuck.

Thanks again.

Mark
 
Actually, I spoke (wrote :)) too soon.

Two files actually were produced by the above command. A bmp, which is blank (will not open in Windows picture and Fax viewer, and shows up as just black in Paint Shop Pro), and an xml file which contains the following text:

<PAMDataset>
<SRS>GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137,298.257223563,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0,AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.0174532925199433,AUTHORITY[&quot;EPSG&quot;,&quot;9108&quot;]],AXIS[&quot;Lat&quot;,NORTH],AXIS[&quot;Long&quot;,EAST],AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</SRS>
</PAMDataset>

Does this tell you anything about what's not working properly, Arno?

Thanks again,

Mark
 
Success!

On a whim, I tried reprojecting my jpg image as a GTiff, and it worked! I was then able to open the GTiff in Paint Shop Pro, and save as a bmp.

The command I used:

gdalwarp -s_srs "+proj=utm +zone=16 +datum=NAD83" -t_srs "+proj=latlong +datum=WGS84" -of GTiff e415200n4658400z16c.jpg chicago1.tif

This was a test image, basically centered on KORD and covering a few miles in each direction. While the image appears good, I do notice some offset at the edges with major roads and rivers in FS, and only slight offsets of runways at KORD. How much inaccuracy should I expect between a propery reprojected image and the default FS lines? By the way, I used Photo Scenery Maker to process my bmp into FS, using a two point callibration method.

Thanks!

Mark

Success1.jpg
 
Hi,

Until now I always noticed that the FS runways and roads are spot on with my images, once convertered correctly. Although most of that was in FSX, for FS2004 the data is slightly less accurate in many places.

Given the fact that you have convertered to WGS84 already, can you not get the exact edges of the image with gdalinfo or so? Using a calibration method on an image of which you have the exact position already sounds like the chance of introducing some new errors to me.
 
Hi Arno,

You're right. Using gdalinfo, I've gotten the lat/lon of the four sides of the image, as well as the coordinates of the four corners. From this, I've carefully calculated (checked and double checked) my cell(x) and cell(y)dimensions and all seems well there. I see no obvious errors in the .inf file. I went back and used the FS2004 SDK tools (specifying the four lat/lon extents of the edges in the .inf), and the details on the airport (O'Hare) are now almost dead-on. However, I still am seeing significant problems with how the major highways and rivers line up at the edges of the photo tiles. Also, the photo appears to end in the middle of an FS tile, showing just a plain brown/green color with the mesh details around the edges. From this, I can see the path of the river that is on the east side of my image - but it is located several hundred meters east of where the river is in the photo (although this mesh-only area appears to be where the photo should extend to). It seems as if the scaling is not right. Seems odd that the airport detail is very close (within meters), but the river only a couple of km to the east is a couple hundered meters off.

I wonder if there is some problem in using the reprojected or warped image. When reprojected, there is some black space at the edges where the image has been rotated. This is the only place I can see where I might be coming up with errors. Perhaps the gdalinfo relates to the coordinates of the actual photo and not the black space added due to reprojection?

As a separate question, provided I get past the proper display of the image, what do I do about the black edges of the photo? This is just a small test of a larger photoscenery area I'd like to create. I've attached a small screen capture to show the reprojected GeoTiff to show what I'm talking about.

Sorry to have so many questions for you. I am very thankful that knowledgeable people like yourself are willing to help the newbies like me.

Thanks,

Mark

Photoreal.jpg
 
I've noticed something that leads me to believe that my photo may be placed correctly, and that the default locations of FS features may be off.

In the attached screen shot, notice the deep "trench" which lines up with the default MS representation of the Des Plaines River. Also notice, in the lower third of the picture that the photo river does line up rather nicely with a shallower terrain feature (sort of an "omega" shaped oxbow in the river). This more subtle feature is in a replacement higher resolution DEM mesh. Maybe I have placed my photo scenery properly, but the MS FS2004 default items are misplaced? This would make sense, given the accuracy of my airport runways, taxiways and vor at KORD, but misplacement of roads/railroads and this river at the edges of my photo.

If this is the case, I feel much better, since I've checked and rechecked my numbers and method for photo placement.

In any case, how do I make sure that a photo completely covers a LOD tile? Is it simply a matter of choosing a BMP that has pixel dimensions exactly divisible by the 256 pixels of a standard FS terrain tile?

Any thoughts and comments are most welcome!

Thanks,

Mark

compare.jpg
 
Hi Mark,

Those black parts are indeed due to your photo not filling an entire LOD square. What you have to do is make sure that in the INF file the output area is setup so that it does cover such a LOD. With the information from the SDK you can calculate exactly where the LOD edges are (or maybe some terrain tool can do it for you as well).
 
Thank you, Arno. Using the SDK method to figure LOD edges worked perfectly! I had missed that earlier. I now have a test photo scenery placed in FS, and other than what I now think are some inaccuracies in MS placement of some line/terrain features, it looks good.

I'm sure I'll have many more questions down the line, but thank you again for your help on this!!!!:)

Mark
 
Back
Top