Elevation Grid Generator

Note that alterations to the YSFlight .EXE is forbidden
User avatar
decaff_42
First Class Membership
First Class Membership
Posts: 3389
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 521 times
Been thanked: 1171 times
Contact:

Elevation Grid Generator

Post by decaff_42 » Tue May 05, 2015 2:24 pm

Excelent Tutorial Video! :D
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Feel free to ask me a question! I'll try to answer it as well as I can or recommend a more knowledgeable member if necessary.

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Elevation Grid Generator

Post by Barr » Sat Jun 13, 2015 1:29 am

Am I doin it right?

600x600 @ aprox 3min.


Edit:

How can you lower the height amplification. For example for a maximum of 50ft? I tried using decimals but the program makes everything flat.
Attachments
Screenshot (435).png
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Sat Nov 07, 2015 5:06 pm

Bumping old topic for goodness...

How does the height amplification work? Is 255m default? So if its at 1 the max height will be 255m? Right and if its at .5 the max height will be 122.5m, correct?
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
Flake
Staff
Staff
Posts: 4214
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 792 times
Been thanked: 1101 times
Contact:

Re: Elevation Grid Generator

Post by Flake » Sun Nov 08, 2015 1:38 am

1 to 1 of the pixel value.

Height amplification * pixel value = height in meters of point.

So if the heigh amp is 1, and the pixel is 255 white, then the point would be 255m. ;)

EDIT: 3000th post! Bow before my true Planar form! :lol:

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Sun Nov 15, 2015 1:07 am

OfficerFlake wrote:1 to 1 of the pixel value.

Height amplification * pixel value = height in meters of point.

So if the heigh amp is 1, and the pixel is 255 white, then the point would be 255m. ;)

EDIT: 3000th post! Bow before my true Planar form! :lol:
Ay mind dumbing that down for me :?:

oh wait never saw the white after 255. So basically the brighness of each pixel is basically the height.


Also Im using 100x100 pixel bitmaps but it takes about 30 seconds for it to process it? Surely cant be my computer? And to add the .flds are coming out blank and zoomed in? No elevation grids
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
Flake
Staff
Staff
Posts: 4214
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 792 times
Been thanked: 1101 times
Contact:

Re: Elevation Grid Generator

Post by Flake » Sun Nov 15, 2015 3:41 am

BARRACUZ wrote:So basically the brighness of each pixel is basically the height.
Exactament.

BARRACUZ wrote:Also Im using 100x100 pixel bitmaps but it takes about 30 seconds for it to process it? Surely cant be my computer? And to add the .flds are coming out blank and zoomed in? No elevation grids
Probably your PC.

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Sun Nov 15, 2015 1:32 pm

Hmm okay I'll check on it. Though a 3.3ghz processor with 8gb of ram should be plenty.
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
kiwiflieger
Contributor
Contributor
Posts: 227
Joined: Thu Mar 27, 2014 7:09 am
Favorite Aircraft: Die Fledermaus
Has thanked: 125 times
Been thanked: 92 times

Re: Elevation Grid Generator

Post by kiwiflieger » Sun Jun 26, 2016 7:46 pm

Apologies for bumping old topic, but I think I may have a fix for:
BARRACUZ wrote:Also Im using 100x100 pixel bitmaps but it takes about 30 seconds for it to process it? Surely cant be my computer? And to add the .flds are coming out blank and zoomed in? No elevation grids
It may not be the PC, as I have very similar specs to BARRACUZ, but the fld.
I have conducted some testing of this program and found that removing the fld information in a text editor and leaving just the elevation grid information, then saving as a .ter file, gives a working elevation grid.

Example:

Code: Select all

FIELD
FLDNAME WANAKAELEV
GND 0 0 215
SKY 23 106 189
GNDSPECULAR FALSE
DEFAREA LAND
BASEELV 0.00m
MAGVAR 0.00deg
CANRESUME TRUE
PCK "00000000.ter" 274601
TerrMesh
SPEC FALSE
NBL 501 546
TMS 108.00 108.00
CBE 0.00 1833.76 46 112 10 194 169 92
BLO 0.00 R 1 46 112 10 1 46 112 10
BLO 0.00 L 1 73 122 25 1 73 122 25
BLO 0.00 R 1 100 133 40 1 73 122 25
If the start of the generated elevation grid looks like this, then remove this:

Code: Select all

FIELD
FLDNAME WANAKAELEV
GND 0 0 215
SKY 23 106 189
GNDSPECULAR FALSE
DEFAREA LAND
BASEELV 0.00m
MAGVAR 0.00deg
CANRESUME TRUE
PCK "00000000.ter" 274601
So the file starts at TerrMesh.

Hope this helps...
Currently dormant... playing IL2 Cliffs of Dover

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Sun Jun 26, 2016 9:10 pm

Can confirm What kiwi said. I kept having troubles with the output flds. Simply deleting a few lines and saving as a ter file gave me a working elevation grid.


Also just so others are aware both kiwi and I have noticed that the program will also include any "picture" that shows up on screen and behind the running program window. For example if you decide to load and generate a bitmap while having a chrome window or fancy wallpaper in the background you will see it in the resulting elevation grid.
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
DD-Destroyer
Contributor
Contributor
Posts: 308
Joined: Tue May 22, 2012 11:45 pm
Favorite Aircraft: FA-50 Golden Eagle
Location: Seoul
OS: Windows
Has thanked: 3 times
Been thanked: 148 times
Contact:

Re: Elevation Grid Generator

Post by DD-Destroyer » Tue Aug 09, 2016 10:34 am

What is my problem???????

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Wed Aug 10, 2016 1:15 am

DD-Destroyer wrote:What is my problem???????
I'm a boob at this so take my suggestions lightly. Hopefully flake or grigor can chime in.

1. The grid generator will generate the bitmap plus whatever is under or ontop of it on the screen. So let's say you have a pickachu wallpaper and have a text document open. The generator will pick these up and include it in the end result so you will get a mountain plus a pikachu mountain. So set your wall paper to none or black and drag all windows even the generator itself away from under the image.

2. Make sure to set the program to run as administrator and run it under xp compatibility. Also try not to run major cpu hog programs like chrome or a videogames. I've noticed that the generator will take a tad longer probably due to the CPU usage priority.

3. Make sure the bitmap is a true 100 pixel by 100 pixel image. I used paint.net and it has some weird settings when you resize so depending on your program double check. Remember that the generator takes the color value of each and every pixel and turns it into a coordinate for ys. So the more pixels or larger the image is the longer it will take to process it all.

4.The generator uses raw cpu power to make the grids so if you have an older machine it will take longer



And if someone can please explain in some detail how to properly use the height amplification. I'm having g trouble getting accurate sized grids since I don't know what to multiply the height amplification by. Like do you average out your highest or Max rgb values and use that?
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
Flake
Staff
Staff
Posts: 4214
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 792 times
Been thanked: 1101 times
Contact:

Re: Elevation Grid Generator

Post by Flake » Wed Aug 10, 2016 1:58 am

BARRACUZ wrote:I'm a boob at this
But that's okay because I like boobs. 8-)

User avatar
kiwiflieger
Contributor
Contributor
Posts: 227
Joined: Thu Mar 27, 2014 7:09 am
Favorite Aircraft: Die Fledermaus
Has thanked: 125 times
Been thanked: 92 times

Re: Elevation Grid Generator

Post by kiwiflieger » Wed Aug 10, 2016 3:47 am

BARRACUZ wrote:And if someone can please explain in some detail how to properly use the height amplification.
The height amplification is a multiple of the pixel value, e.g. black (0,0,0) or white (255,255,255). So if the height amp. was set to 20, say, then the height of a white pixel (in metres, of course 8-) ) would be 255 x 20 = 5100 metres.
Currently dormant... playing IL2 Cliffs of Dover

User avatar
DD-Destroyer
Contributor
Contributor
Posts: 308
Joined: Tue May 22, 2012 11:45 pm
Favorite Aircraft: FA-50 Golden Eagle
Location: Seoul
OS: Windows
Has thanked: 3 times
Been thanked: 148 times
Contact:

Re: Elevation Grid Generator

Post by DD-Destroyer » Wed Aug 10, 2016 4:53 am

Thanks. I'll try again. I forgot to tell my PC specification

1. OS : Windows 10 64bit
2. CPU : Intel Skylake i7-6700k with quad core and 4.0Ghz clock
3. VGA : nVidia Geforce GTX 1080
4. RAM : 8G

User avatar
Flake
Staff
Staff
Posts: 4214
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 792 times
Been thanked: 1101 times
Contact:

Re: Elevation Grid Generator

Post by Flake » Wed Aug 10, 2016 12:00 pm

Also, for your viewing pleasure BARRACUZ: viewtopic.php?p=86162#p86162

User avatar
DD-Destroyer
Contributor
Contributor
Posts: 308
Joined: Tue May 22, 2012 11:45 pm
Favorite Aircraft: FA-50 Golden Eagle
Location: Seoul
OS: Windows
Has thanked: 3 times
Been thanked: 148 times
Contact:

Re: Elevation Grid Generator

Post by DD-Destroyer » Thu Aug 11, 2016 9:11 am

I got what is the problem. I think grigor have to add "7. Don't click or change to other program in actual before process completely finish." This script reflex screen in actual and start from left top point of the window to as image file's pixel.

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Sat Aug 13, 2016 11:38 pm

OfficerFlake wrote:Also, for your viewing pleasure BARRACUZ: viewtopic.php?p=86162#p86162
Ok so if im understading the max elevation in the bitmap must be 255 white? It cant be a max of like 180,43,189.

Or is there a way to scale a maps elevation when the highest point in the bitmap is not a 255 white? This what ive been trying to understand. If you cant then its a real bummer since youll need to edit alot when you pull elevation maps of gis sites
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
kiwiflieger
Contributor
Contributor
Posts: 227
Joined: Thu Mar 27, 2014 7:09 am
Favorite Aircraft: Die Fledermaus
Has thanked: 125 times
Been thanked: 92 times

Re: Elevation Grid Generator

Post by kiwiflieger » Sun Aug 14, 2016 12:42 am

Just did some testing and determined that the equation for grid face height is always:

pixel brightness (0-255) * height amplification = final grid height

The maximum pixel value doesn't have to be 255 and the scaling is only determined by the brightness of an individual pixel, not the maximum value anywhere on a bitmap.
BARRACUZ wrote:Or is there a way to scale a maps elevation when the highest point in the bitmap is not a 255 white? This what ive been trying to understand. If you cant then its a real bummer since youll need to edit alot when you pull elevation maps of gis sites
Normally, I find the highest pixel value in the bitmap, and then find its elevation on a map. Then just divide elevation of highest point by pixel value and you have the height amplification value.
Example:
Say I'm using this image:
Image
(a random bit of NZ I picked out) and the highest point is somewhere in the bottom right corner. I'd find the elevation on a map and calculate accordingly. ( I think the amplification is something around 15 on this example)

NB all measurements are in metres!
Currently dormant... playing IL2 Cliffs of Dover

User avatar
Barr
Veteran
Veteran
Posts: 1002
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 268 times
Been thanked: 199 times

Re: Elevation Grid Generator

Post by Barr » Sun Aug 14, 2016 1:44 am

kiwiflieger wrote:Just did some testing and determined that the equation for grid face height is always:

pixel brightness (0-255) * height amplification = final grid height

The maximum pixel value doesn't have to be 255 and the scaling is only determined by the brightness of an individual pixel, not the maximum value anywhere on a bitmap.
BARRACUZ wrote:Or is there a way to scale a maps elevation when the highest point in the bitmap is not a 255 white? This what ive been trying to understand. If you cant then its a real bummer since youll need to edit alot when you pull elevation maps of gis sites
Normally, I find the highest pixel value in the bitmap, and then find its elevation on a map. Then just divide elevation of highest point by pixel value and you have the height amplification value.
Example:
Say I'm using this image:
Image
(a random bit of NZ I picked out) and the highest point is somewhere in the bottom right corner. I'd find the elevation on a map and calculate accordingly. ( I think the amplification is something around 15 on this example)

NB all measurements are in metres!
Okay so now you have me at pixel brightness. A quick Google search and I think I need to find a way to convert the bitmap to a true grey scale image and not just use the "black and white" color function.
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
Flake
Staff
Staff
Posts: 4214
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 792 times
Been thanked: 1101 times
Contact:

Re: Elevation Grid Generator

Post by Flake » Sun Aug 14, 2016 3:51 am

kiwiflieger wrote:pixel brightness (0-255) * height amplification = final grid height
So basically what I've been saying this whole time.

I mean, have I explained this poorly or...?

---
BARRACUZ wrote:It cant be a max of like 180,43,189?
You could do that. The height is based of the LUMINANCE value of the pixel, Colors are irrelevant.

Colors can be defined by Red, Green, Blue, or Hue, Saturation, Luminence. Full white is 255 luminence, regardless of hue and saturation levels. Full black is 0 luminence, regardless of hue and saturation. It would be best to think of the light level in regards to luminence.

I tried explaining in RGB as this is what everyone is most familiar with.

You could use colors but they would have NO impact on the grid height - just the luminance of the pixel is all that matters.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest