Jump to content
Sign in to follow this  
wsieffert

Reprojection of Raster Bitmaps into Geographic WGS84

Recommended Posts

Guest luissa

Hi,If you have installed SBuilder 2.02, you may get a 2.03 beta and test Reprojection of Raster Bitmaps files into the "Geographic WGS84" system. Before SBuilder reprojected BLN vector files only. Now you can select "Bitmap" in addition to "BLN".The bitmaps must be in 24-bit format. If the input file is called my_original.bmp, a sister file with the name of my_original_bmp.txt should be present in the same folder with some lines to specify the boundaries. Example:this is needed if you are going to reproject from Transverse Mercator[MERCATOR]North=3333333South=222222West=522222East=1233333this is needed if your bitmap "is" already a geographic projection but in a different datum[GEOGRAPHIC]North=33.33South=22West=-40East=-20you can mix text in the file. If the original bitmap is an UTM system specify the borders as follows:[uTM]North=3333333South=222222West=522222East=1233333end of example.2 files with names my_original_WGS84.bmp and my_original_WGS84_bmp.txt are created.I will be grateful if you can test this feature. I think that the output images are OK but did not test it fully.You can download the latest EXE from here:http://www.ptsim.com/downloads/sbxxx.zipPlease back up any project before using this 2.03 version as I made some significant changes.Regards, Luis

Share this post


Link to post
Share on other sites

Hi Luis,Very interesting, I will give it a try.The only problem I must first solve is that I have my images in the Dutch RD coordinate system, so I must convert their coordinates to Mercator or UTM first. Let me see if I can find that somewhere :).


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Luis,I downloaded 2.03 and hit a snag. I tried Appending a VTP file and all I get is an error menu.Went back to 2.02 and it worked fine.W. Sieffert

Share this post


Link to post
Share on other sites
Guest luissa

Hi,Thanks! I will check it later tonight! I would be grateful if someone confirms this problem as it was working for me when I uploaded. Arno - may be the Dutch grid is some kind of Transverse Mercator projection. You can add a specific datum to datum.txt.Luis

Share this post


Link to post
Share on other sites

Hi Luis,I will have a look at the datum.txt file. We have some conversion formulas to transform it to lat/lon, so maybe I can put it in there.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Thanks, I have been able to add the datum now. But I must be missing something. Is there a command somewhere to ask for the image reprojection or is it supposed to happen automatically? I can't find it yet :).


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest luissa

Hi Arno,You need to go to File > Coordinates Tool and set the "File Conversion" radio buttons. You need to set Bitmap in opposition to BLN and, in your case, "Transverse Mercator to Geographic WGS84". You need to set, on the "Transverse Mercator" window on the left, the relevant parameters for the Dutch grid. Also you need to enter the boundaries of the bitmap in the sister TXT file. Regarging the datum here is an explanation on how to add a new datum to SBuilder.SBuilder ships with a file called datum.txt which contains 21 different datuns. These datuns are the ones used in Portuguese cartography. You can customize this. For example you can delete any datum that you will not use. And, of course, you can add the datum used in your region. The important point is that the LAST DATUM in the list should be WGS 1984. Here are the last 3 lines of the file datum.txt:... 6378160 6356774.719 -60 -2 -41 0 0 0 0 6378135 6356750.52 0 0 4.5 0.219 0 0 0.554 6378137 6356752.314 0 0 0 0 0 0 0In order to add a new datum you need to know 9 values:a b dx dy dz ds rx ry rzThese values are the major axis (a) and the minor axix (:( of the datum's ellipsoid and the "seven parameters" for the Helmert transformation as shown here:http://earth-info.nga.mil/GandG/datums/natodt.htmlIn the bottom of this page there is a link to a pdf file with a list of values. I used these values except in cases where I got updated values from the national geographic institutions.The second value in the list is not the minor axis of the ellipsoid but the flattening squared e2. You need to derive the minor axis (:( using the formulae to relate a b and e2:e2=(a*a-b*:(/a*ab=a*sqr(1-e2)If I want to add the datum for Holland the file datum.txt will look like:... 6378160 6356774.719 -60 -2 -41 0 0 0 0 6377397.155 6356078.963 565 49.9 465.8 4.08 -0.409 0.36 -1.869 6378135 6356750.52 0 0 4.5 0.219 0 0 0.554 6378137 6356752.314 0 0 0 0 0 0 0I hope this information is correct.Regards, Luis

Share this post


Link to post
Share on other sites

Hi Luis etal,Did anyone else have the problem I report, Append VTP error problems?W. Sieffert

Share this post


Link to post
Share on other sites
Guest luissa

Hi,W. Sieffert - yesterday, following your post, I downloaded the sbxxx.zip file from www.ptsim.com and appended 2 or 3 VTP BGLs without problems. SCott - later today I will check the water landclass problem that you refer. I almost replace the word "as Integer" by "as Long" in the source code of SBuilder. Now the limit of 32677 points, lines, polys, etc, does not exist. But there is the possibilty that something could be wrong. This is the reason why I do not upload the file to AVSIM.Regards, Luis

Share this post


Link to post
Share on other sites

Hi Luis,I downloaded again but had the same problem. However, I have some different results to report.I tried appending an ABxxxxx.bgl file that doesn't have too many elements. I kept clicking the OK button and all of a sudden the areas finally showed up. I then went back to my AB926210.BGL file and did the same procedure. It took quite awhile to get each and every area loaded by clicking the OK button but it eventually loaded. The small box comes up and has a number and an OK button. Each time you press OK, a different number shows.It seems the append wants conformation to load each area. If I go back to version 2.02, it loads everything automatically.W. Sieffert

Share this post


Link to post
Share on other sites
Guest luissa

>I tried appending an ABxxxxx.bgl file that doesn't have too>many elements. I kept clicking the OK button and all of a>sudden the areas finally showed up. ~HelloI am truly sorry! I forgot that there are VTP polygons and I only checked VTP lines in HL... RD... UT... BGLs! The message that you refer to was for debugging and showed the number of Points of every Polygon! If the file had 1000 polygons, you would need to press 1000 OKs! I removed it and I updated sbxxx.zip !Regards, Luis :-shy

Share this post


Link to post
Share on other sites

Thanks Luis, I got it working now. Great feature :).One question, would it not be useful if the parameters like the central lat/lon and the false north/east would also be stored together with the datum? Then it would not be necesairy to enter them again and again.I will continue to do some more tests with this new version now that I got my photo placed correct :D.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest luissa

>One question, would it not be useful if the parameters like>the central lat/lon and the false north/east would also be>stored together with the datum? Then it would not be necesairy>to enter them again and again.Hi Arno,I am very happy to know that it works. Regarding your question I would not mix the datum with the projection system because, normally, a datum can be used with many projection systems. I forsee 2 possibilities:a) add those parameters in the sister TXT file:( add those parameters in the INI fileI think :( is best.Regards, Luis

Share this post


Link to post
Share on other sites

Hi Luis,That is also fine for me. I was not really aware that a datum is sometimes used in different projections. As far as I know the Dutch RD coordinate system is only used with one projection.My main point was that it would be nice if these projections could also be stored somewhere, so that you don't have to look up the values every time. Storing them in a different TXT or INI file is also perfect I would say.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Bless you! Bless you! You owe me a new mouse and medical bills for my sore finger!!! :-lolW. Sieffert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...