CONDOR

The Competition Soaring Simulator
It is currently Sat May 25, 2013 1:34 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Wed Jan 16, 2008 4:28 am 
Offline

Joined: Wed May 09, 2007 2:19 am
Posts: 56
Location: Ottawa, Ontario, Canada
Warning: I already found a problem with this process :oops: .

Unfortunately the problem is fairly fundamental. If your scenery
does not cross the boundary between UTM zones and does not cross the
equator then go ahead and use this process. Calibration errors will be less than 100 metres.

In general, UTM zone boundaries are every 6 degree longitude.
See http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system for details.

Calibration for Dummies
=======================

For those of you who are experts, please bear with me. I struggled through
a lot of the theory, so I think others who are new to scenery development
will appreciate the detail. The first part is long, and explains some
of the theory.

In the end I provide a step by step which is pretty straightforward
because it uses a spreadsheet I provide.

This process replaces task 3 in the Condor Scenery Toolkit PDF file.

Theory

This process describes how to build a CalibrationPoints.csv file to calibrate
your scenery based solely on the contents of the .hdr file produced by 3DEM
and a spreadsheet from the internet to convert UTM coordinates to latitude/longitude.

I am confident enough in the process for someone else to try it.
Let me know if it works for you.

First, lets look at an example .hdr file and talk about the SRTM3 file.

SRTM3 data has a resolution of 90 metres. That means in 3DEM
each pixel represents 90 metres by 90 metres. A Terragen tile 256x256
SRTM3 pixels, so a Terragen tile is 23,040 metres on side.

My sample scenery is 9 Terragen tiles wide and 5 tiles high.
I created it with the new version of 3DEM and the procedure which ASH33M posted late last year.
Thanks for that :-).

So, my sample is 9*23040 == 207360 metres wide and 5*23040 == 115200 metres high.
Remember that.

Here is my .hdr file. map_projection tells us it is UTM Zone 18 North.
That is important for later.

Code:
file_title             = EasternOntario
data_format            = int16
map_projection         = UTM Zone 18N
ellipsoid              = WGS84
left_map_x             = 367020
lower_map_y            = 4947390
right_map_x            = 574290
upper_map_y            = 5062500
number_of_rows         = 1280
number_of_columns      = 2304
elev_m_unit            = meters
elev_m_minimum         = 8
elev_m_maximum         = 771
elev_m_missing_flag    = -9999


left_map_x is the UTM co-ordinate (relative to Zone 18 North) in metres of the
most east SRTM30 pixel. right_map_x is the UTM co-ordinate of the right-most pixel.
Subtract the two. You get 574290-367020 == 207270 metres. 90 metres are missing.
The same is true for Y, or north/south, 90 metres are missing.

The reason is simple (but I missed it for weeks!!). an SRTM30 pixel is 90 meters.
When 3DEM created the .hdr file it put the location in metres of the lower left
corner of the pixels.

See the attached jpg file. It depicts the 4 corners of my scenery height data.
Inside each square is the coordinates in SRTM30 pixels starting at the lower left
(0,0) to the upper right (2303,1279).

The red X's show where I want my four calibration points. At each corner
I have the UTM coordinates of the red X's and the Condor coordinates.

So far so good. Here comes the curve ball. Condor Landscape Editor origin
is the bottom right. It shows you the offset in metres from the origin
in the bottom status bar as PosX and PosY.

I need to convert the UTM coordinates of the four red X's into Condor Landscape
Editor coordinates. Here are the formulas.

CondorX = 90 + (right_map_x - UTMX)
CondorY = UTMY - lower_map_y

Based on this, convert the red X coordinates to Condor coordinates.
Here is the conversion for my example scenery.

Code:
             UTM                 Condor   
             X      Y         X           Y
Lower left   367020 4947390   207360      0
Upper left   367020 5062500   207360      115110
Lower right  574290 4947390   90          0
Upper right  574290 5062500   90          115110


I created this table with a spreadsheet which is in the attached zip file.

The next step is to turn the UTM coordinates into latitude and longitude.
The web page http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM
provides an spreadsheet to do the conversion. I made some minor formatting
changes and included it in the attached zip file. I also added some other
Condor specific bits. I take no credit for the math. I'm not that smart :).

The author says the conversion from UTM to LAT/LON is accurate within 10 metres.
That is more than good enough!!

So, we have everything we need. CalibrationPoints.csv file has one
line of text for each calibration point. On each line we have a location
in Condor coordinates and the latitude/longitude each seperated by commas.

My CalibrationPoints.csv is

Code:
207360,0,44.6675497,-76.6775603
207360,115110,45.7032743,-76.7082686
90,0,44.6760317,-74.0626840
90,115110,45.7120667,-74.0455192





With all of that theory behind us, here is Task 3 step by step.

Task 3

Step 1:

Create your new scenery.

1) Start CSTLandscapeEditor tool.

2) Select File->New Landscape and load the TRN file that was saved from Task 2.
The program will automatically creates the new directory structure in
\Condor\Landscapes folder and then copies the selected TRN file to this location.

3) Do File->Save. Then File->Exit.

Step 2:

Create the CalibationPoints.csv file.

1) Open yourlandscape.hdr with notepad.

2) Open the spreadsheet UTMConversions1.xls.

This section is written assuming you are using openoffice.
If you have Microsoft Office I assume you know what you are
doing.

Select the "Main Page" tab at the bottom.
Scroll down to the area labelled "Condor Data".
Enter left_map_x, lower_map_y, right_map_x, and upper_map_y
from yourlandscape.hdr. Set UTM zone and North/South to values
from yourlandsape.hdr.

Lower in the blue area are coordinates of the corners of yourlandscape
in UTM coordinates, Condor coordinates and in Lat/Lon.

Below that in the green area are the contents of your CalibrationPoints.csv
file. Select the light green cells and copy.

From your spreadsheet menu select "File->New->Spreadsheet".

Click in cell A1 (uppermost left cell) in the new spreadsheet.
Right click and do "Paste Special".

Un-select "Paste all" and unselect everything else under "Selection"
except "Numbers" and "Formats". Click OK.

At this point the new spreadsheet should only have four
columns and four rows of numbers. They should be identical
to the numbers in light green in the UTM1Conversions1
spreadsheet including 6 decimal places for latitude and longitude.


In the new spreadsheet do "File->Save As". Save the file
in \Condor\Landscapes\yourlandscape\Working\CalibrationPoints.csv.
It may complain that CalibrationPoints.csv already exists. Replace it.

Close yourlandscape.hdr.

Close UTMConversions1.xls. If you wish, save it for the unlikely event
something went wrong.

Close CalibrationPoints.csv.

Step 3:

Calibrate your scenery.


1) Start CSTLandscapeEditor tool.

2) Select your scenery in the "Landscape" pulldown menu.

Under "View/Modify" select "Calibration points".

You should see 4 calibration points listed.

Note: Occasionally I've seen the landscape editor confused
if there are extra blank lines after the last calibration point.
Sometimes openoffice does this.
When this happens, it does not show any map or calibration points.

If you have a problem here close the landscape editor and use
notepad to remove any blank lines at the end.

3) Hit the "Calibrate" button and click yes.

4) "File->Save landscape".

That's it!


You do not have the required permissions to view the files attached to this post.


Last edited by CarlPottle on Thu Jan 17, 2008 3:48 am, edited 5 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 5:19 am 
Offline

Joined: Wed May 09, 2007 2:19 am
Posts: 56
Location: Ottawa, Ontario, Canada
Haldor wrote:
Maybe I'm just a little tired tonite but I'm unable to create a calibration file as outlined here - also not getting anywhere with ASH33's suggestion above either.

First, CarlPotte's way:

This is my data:
data_format = int16
map_projection = UTM Zone 32N
ellipsoid = WGS84
left_map_x = 196380
lower_map_y = 6324480
right_map_x = 742860
upper_map_y = 6772950

The xl sheet say a couple of my numbers are invalid, anyone can help?
Also I dont get where CP get his quote "(instead of 207360, 115200). " numbers. I realise these numbers come from somewhere in hos scenery but where can I find mine?

TIA,
Haldor


I just tried my new process (just posted) on this data.

Here is the CalibrationPoints.csv that I get:

Code:
546570,0,56.963486,4.004223
546570,448470,60.973680,3.386095
90,0,56.999645,12.999138
90,448470,61.016099,13.495029


I tried the lat/lon in Google Earth and switch it to display UTM.
The two lower corners (east and west) are at different UTM Y coordinates.
Same with the two upper corners.

That doesn't seem right to me. It looks like a rectangle in Google Earth.

I think the problem is that this scenery spans two UTM zones. Google Earth displays the UTM zone boundaries when you select UTM for Lat/Lon
snd you have grid turned on. Another thing I see in Google Earth is that UTM zone 32 is bigger east/west than other zones and 31 is much smaller.
That might be the problem.

I suspect my excel spreadsheet does not handle that correctly. :-(


Haldor, I think this calibration data may be wrong, but can you try it and let me know for sure?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 9:51 am 
Offline
User avatar

Joined: Fri Jul 21, 2006 4:32 pm
Posts: 405
Location: Slovenia
i will try this and compare it to my .cvs file. my scenery spans from -31 to -35. should be an interested result to compare.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 2:44 pm 
Offline
User avatar

Joined: Mon Jun 06, 2005 3:20 am
Posts: 474
Location: Ålgård, Norway
Carl, I'll try it later tonite as I've just got home from work.
I'll also reply to the PM and add those files you asked for.

_________________
Haldor
LS6a / LN-GHY
Norway

~~ if this is torture chain me to the wall ~~


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 4:20 pm 
Offline

Joined: Wed May 09, 2007 2:19 am
Posts: 56
Location: Ottawa, Ontario, Canada
I updated my post http://forum.condorsoaring.com/viewtopic.php?t=8141&postdays=0&postorder=asc&start=15.

See the note and update at the beginning. The process I provide is good
(I think :-) ) if your scenery does not span a UTM boundary.

Except for Norway/Sweden, UTM boundaries are on 6 degree longitude
boundaries. As scenery from 1 degree to 5 degrees is OK, but
not 4 degrees to 7 degrees.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 17, 2008 3:55 am 
Offline

Joined: Wed May 09, 2007 2:19 am
Posts: 56
Location: Ottawa, Ontario, Canada
I did some experimentation and I've confirmed this process works without a hitch if your scenery fits in one zone and does not cross the equator.

In the three examples I have 0 difference in distances between SeeYou (with WGS84 distance calculation) and Condor task planner.

On the other hand, if I make the scenery a little bit bigger so it crosses
a UTM zone boundary then I see errors of from .2 km to .5 km
for a straight out task of approximately 150 km.

I did not try a scenery that crosses the equator, but I am sure there
will be trouble.

I exchanged email with the author of 3DEM and he acknowledged
that this is a problem in 3DEM when using UTM on large terrains.

I will continue to look for a method to correct for this error, but I am not
optimistic of a good outcome.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 09, 2008 11:47 am 
Offline
User avatar

Joined: Fri Aug 10, 2007 2:08 am
Posts: 229
Location: Earth, Sol System, Orion Arm, Milky Way Galaxy, Galactic Local Group, Virgo Supercluster
Hi Ash33M,

I was wondering if you still had your calibration video posted somewhere? I tried looking in the stickie, but all that was there was the 3DEM program zipped up. Speaking of which... I noticed you called it Condor 3DEM... is there something different in function about it, as compared to the "regular" 3DEM?

I tried your suggestion of calibrating, but am not confidant what the actual coordinates of each corner of the map are--especially since the map has been cropped (and slightly rotated during the UTM projection conversion)... hence the reason I figured your video might help me understand.

***EDIT*** Found your videos buried in this obscure thread and found out that there is a difference between condor 3DEM and regular 3DEM: http://forum.condorsoaring.com/viewtopic.php?t=7767

Thanks.

_________________
CN: TXS
TX-ScubaSteve


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 22, 2009 10:11 pm 
Offline

Joined: Wed Mar 12, 2008 4:19 pm
Posts: 186
Location: Lakewood, CO (expat from France)
Hi everyone, Hi CarlPottle,

I used this approach to calibrate my scenery. It is straight forward and very easy. If I understand correctly the calibration file contains the correspondence between the four map corner expressed in UTM (converted to Condor ) and there respective geographical coordinates latitude longitude in decimal degrees and using WSG84 datum. Easy and should be fool proof.

I used Global Mapper and such calibration points in the display are at the pixel box centers. I doubled checked by zooming in enough to perfectly center my mouse cursor to read out the correct coordinates in both UTM and Geographical coordinate systems. I then realized that there is a coordinate converter tool, where you can switch between coordinate systems.

I noticed that although the longitude values match exactly the ones derived with the spreadsheet used adapted from STeve Dutch's to convert UTM to Geographical the latitude all deviate from the one just derived. See below for details. Note that I calculated the difference between the predicted and original coordinates.

Do you know why the latitude exhibit these differences?
Is there a typo in the latitude conversion formula generating the Condor calibration points?

Have you observed this?

CarlPottle, did you contact already Steve Dutch, the author of this spreadsheet at dutchs@uwgb.edu ?

Note that my scenery extend by 0.5degree East of zone 11, but since other tools converted correctly the coordinate, I suspect it the conversion used here in the spreadsheet that might introduce such discrepancy (see below).

CalibrationPoints.csv As measured in GM Diff = predicted - original GM
Condor X Y Lat/Lon Derived La/Lon from GM (expected) Lat/Lon Diff.
552960 0 34.57406801 -119.47590312 34.57410202 -119.47590312 -0.0000340 0.0000000 lower left
552960 414630 38.30839234 -119.59757682 38.30843399 -119.59757682 -0.0000416 0.0000000 upper left
90 0 34.54743818 -113.45044860 34.54758215 -113.45044860 -0.0001440 0.0000000 lower right
90 414630 38.27788578 -113.27625875 38.27806204 -113.27625876 -0.0001763 0.0000000 upper right

Error on Latitudes summary:
Lower Left = -0.0000340
Upper Left= -0.0000416
Lower Right= -0.0001440
Upper Right= -0.0001763

Here is an example:
X=272880m Y=4243230m converts exactly with different conversion tools (including the Global Mapper conv. tool) to:
119.59757682° W 38.30843399° N
but according to your modified spreadsheet only the longitudes are converting exactly:
119.59757682° W 38.30839234° N

Do you think it'd be ok to use directly the geographical coordinates expected for the UTM points (i.e. with consistent latitude values) instead of those from the spreadsheet?

For those without GlobalMapper here is a link to an online coordinate converter:
http://home.hiwaay.net/~taylorc/toolbox ... eoutm.html

I am attaching your spreadsheet as I used it with my specific input data for my calibration file. Let me know if you can help explain the discrepancy on latitude calculation before I get in touch with Steve Dutch about this spreadsheet he created and that is used here for conversion.

Thank you in advance for your replies.
Donat


You do not have the required permissions to view the files attached to this post.

_________________
ImageImage


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 12:52 am 
Offline
User avatar

Joined: Fri Aug 10, 2007 2:08 am
Posts: 229
Location: Earth, Sol System, Orion Arm, Milky Way Galaxy, Galactic Local Group, Virgo Supercluster
This doesn't exactly answer your question as to why your latitude numbers have errors, and perhaps I've missed your point.

However, I wouldn't discount crossing a UTM zone boundary by 1/2 a degree, I experienced even greater calibration errors when including only 15 minutes of an adjacent zone!

Your greatest error is the upper right corner which is approximately 64 feet. When using terrain that has resolution a little higher than 295 feet (90m), I think you're doing pretty good! The elevation numbers you see on the landscape editor, are at the center of 90m x 90m "pixel". As to why you're not getting an error with your longitude--I don't know...

I use Condor 3DEM to read coordinates. I've noticed that the highest zoom level seems to be a function of how large the map that you're working with is. In my case, I usually find that 9x9 pixels area on 3DEM translates to 90m X 90m "pixel" in the landscape editor.

I used to try the "corner" technique, until I realized that the extreme corners didn't represent the centers of the 90x90m "pixels" in the landscape editor's corners, but actually offset approximately 45m from the edges.

The technique I use which usually gives me no perceptual error in calibration (at least when comparing tasks 1000Km in length with SeeYou) is to find a pattern of elevation points (probably much easier for coast lines), by using the keypad to move the mouse cursor one pixel at a time on 3DEM, that matches the elevation numbers I can see on the Landscape Editor. Once I've verified that I'm looking at the same point in both 3DEM as well as the landscape editor (by the pattern of elevation numbers) then I mark that down as a calibration point.

_________________
CN: TXS
TX-ScubaSteve


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 1:33 am 
Offline

Joined: Wed Mar 12, 2008 4:19 pm
Posts: 186
Location: Lakewood, CO (expat from France)
Thanks for the replies and PM.

Flying.islander, you are right the greatest error is the upper right corner, actually the upper latitude are great in magnitude than the lower ones.

Before I can test further I noticed that there are few approximation/rounding introduced by 3DEM when projecting to UTM with WSG84 datum. I am contacting Richard Horne (3DEM developer about that). In particular it seems that 3DEM is not interpreting the header file (i.e. containing the geotiff metadata).

At any rate though, as you pointed out, there are "only" slight errors on the latitudes introduced when converting the coordinate of the map corners. Since the longitude are "spot on", seems to indicate that converting them directly should work.

I am also puzzled that Condor developer do not make use of the HDR file when converting BIN to TRN, there should be not need to calibrate then. I mean when using applications like GlobalMapper such terrain/elevation map file display coordinate according to the related metadata file. There must be a good reason to operate like this, the only one I can see is for tweaking, but then it should be an option when converting BIN to TRN

On a different note I just installed SeeYou to test the file and I am having some issue with Condor Free Flight when uploading my new scenery. There is an access violation error at address 005BE038B in 'condor.exe'. Any suggestions?

Thanks,
Donat

_________________
ImageImage


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 1:54 am 
Offline
User avatar

Joined: Fri Aug 10, 2007 2:08 am
Posts: 229
Location: Earth, Sol System, Orion Arm, Milky Way Galaxy, Galactic Local Group, Virgo Supercluster
Concerning your error... look for my response here:

http://forum.condorsoaring.com/viewtopic.php?t=9824

_________________
CN: TXS
TX-ScubaSteve


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 2:55 am 
Offline

Joined: Wed Mar 12, 2008 4:19 pm
Posts: 186
Location: Lakewood, CO (expat from France)
Thanks for your tip. It was already in my short list of posts for scenery development.
AT teh moment I do not have any airport so not chance of ghost yet, isn't it?

I re calibrated using the points I posted earlier (i.e. with slight error on latitude but perfect on longitude) and saved the file again - same error.

Regarding the scenery name the instruction called for 16character long only and no space. I see that some developers used spaces and their scenery names seem to exceed 16 characters long?! What is the filename specification then?

I'd like to have a version number in the format used by most scenery (e.g. Scenery Name [1.0]

On a different note, I generated form SeeYou the list of official waypoinst for my scenery (using the bounding box) and will integrate them with my scenery. Next weekend I should get list of landable fields from the pilots using XCSoar like me at my local club.

The first airport when the calibration accuracy is assessed and validated is Jean, NV. In the mean time, I am learning Terragen.
I am wondering how difficult it'd be to use satellite photo for airport though... that is another thread.

In the mean time I keep looking into this error with Condor.

Thanks again for your suggestions.
Donat

_________________
ImageImage


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 3:47 am 
Offline
User avatar

Joined: Fri Aug 10, 2007 2:08 am
Posts: 229
Location: Earth, Sol System, Orion Arm, Milky Way Galaxy, Galactic Local Group, Virgo Supercluster
Well, not having any airports will probably cause the same error... I think you have to have at least one airport for the scenery to load without an error.

I believe the 16 character no space limit is only for the .bin file that is to be converted to TRN.

_________________
CN: TXS
TX-ScubaSteve


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 6:31 am 
Offline

Joined: Wed Mar 12, 2008 4:19 pm
Posts: 186
Location: Lakewood, CO (expat from France)
Thanks for the clarifications. If I understand the scenery file name can be changed by renaming the TRN file after it has been generated from the RAW file.

Regarding the scenery loading error, my mistake, I did not realize I had to have at least one airport saved to be able to test the scenery sa well as exporting few other files, which are empy for now (e.g. forest map). It was clearly explained in the CST tutorial. Maybe condor could handle this error by issuing message indicating that scenery files are missing?

With the 1st calibration (i.e. with a slight error on latitudes of bound area) a task starting from Jean and covering all four corners of the map and back to Jean in 5 waypoints, and a total distance in Condor task of 2293.9km is reported in SeeYou (with WSG84 ellipsoid selected) with a total length of 2293.4km. SeeYou underestimates by 0.5km.

I will fix the slight error on the latitude and see if it is perfect then. :D

I emailed Richard Horne about the sampling used by 3DEM when converting to UTM projection, which is approximated to 90m. Does Condor rely on pixel width and height of exactly 90m(i.e. square)?
For my zone UTM11, build with a 3 arc second DEM, according to GlobalMapper the sample spacing along x and y should be:
x/lon=76.7925329839642m
y/lat=93.7612601174106m

Maybe I should write another post about this last issue.

Donat

_________________
ImageImage


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 24, 2009 12:17 am 
Offline

Joined: Wed Mar 12, 2008 4:19 pm
Posts: 186
Location: Lakewood, CO (expat from France)
Update,

THe corrected latitudes in the calibarion file were modified to match the expected values. There were no change between Condor and SeeYou, when using the same flight plan than yesterday with these updated calibration values (i.e. just updated latitude values).

For the very same task (file) which was used yesterday with the calibration displaying slight deviation for latitude values:
Condor reports a total distance of 2293.9km
and SeeYou (with WSG84 ellipsoid selected) a distance of 2293.4km.

It is a little surprising that no difference is registered on such an extensive task (covering the most outer periphery of the map). Is it because the slight variation of calibration values are to small to significantly in impact the reported distance?

Here are the old (using data from spreadsheet) and new (adjusted latitude values) *.csv calibration files:
Old:
CalibrationPoints.csv Reported latitudes from SpreadSheet are not consistent with other coordinate converter tools
552960 0 34.57406801 -119.47590312
552960 414630 38.30839234 -119.59757682
90 0 34.54743818 -113.45044860
90 414630 38.27788578 -113.27625875

New:
CalibrationPoints.csv Corrected to use “correct?!” latitudes
552960 0 34.57410203 -119.47590312
552960 414630 38.30843399 -119.59757682
90 0 34.54758215 -113.45044860
90 414630 38.27806204 -113.27625875

While, I tested the new calibration the scenery was broken down and I deleted it and recreated it from scratch. For future reference what are the steps to update the calibration of a scenery and what is best approach to test it with SeeYou?

Thank you,
Donat

_________________
ImageImage


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group