Board index FlightGear Development Scenery

Photoscenery generator for Julia compiler

Questions and discussion about enhancing and populating the FlightGear world.

Re: Photoscenery generator for Julia compiler

Postby Hooray » Fri Jul 09, 2021 6:13 pm

Volador wrote in Fri Jul 02, 2021 10:55 pm:I could only think of a map overlay (perhaps intgrated into the osm or terramaster for the model/ scenery locations) that showed the areas/tiles that had been downloaded on the local drive perhaps with a colour code or numeral that indicated the resolution


The overlay can be created/shown using Nasal + Canvas, even without doing much/any Nasal coding - for instance, the application could act as a map server and simply serve a live map, which can then be shown inside FlightGear/Phi or elsewhere:

https://wiki.flightgear.org/Canvas_snip ... e_tile_map
Image

abassign wrote in Mon Jul 05, 2021 9:39 pm: the time I can devote to the project I am using to build a more direct integration with Flightgear. The reason is that I want to test the possibility of using Julia applications in place of NASAL and C ++ applications so that I can do things that are currently difficult for kernel developers to achieve. When I get a good coupling method with FGFS I could introduce more advanced graphics functions and then insert the nice function you proposed.


Look up any topics mentioning FGPythonSys, FGNasalSys or HLA/RTI to learn why this is probably not such a good idea without doing some reading/research first and reaching out to the developers mailing list :wink:
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Photoscenery generator for Julia compiler

Postby abassign » Sat Jul 10, 2021 10:55 pm

Manus wrote in Fri Jul 09, 2021 10:18 am:I have problems to run this tool.
After installation is ran into a error on the first run with the "Hello World" Script. The Installation seems to be ok, no errors where reported during the setup.

Here is a screenshot of the error message:

Image

If someone has an idea how to fix it please let me know ^^


Hi I think I solved your problem which was due to the presence of unicode characters in the file names. I just updated the GIT with the fix, I hope it is ok now, I hope you can test it and communicate if it is ok now or not.
Thank you for reporting this issue to me.

GIT: https://github.com/abassign/Photoscenary
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby abassign » Wed Jul 28, 2021 5:13 pm

I uploaded on GIT version 0.3.3 of the program which inserts two important options, as well as a series of corrections in the code. The most interesting option is the --save which allows you not to lose the images inserted in the scenarios folder and to group them in a different folder (often a different hard disk) for future use or exchange between FGFS users.
The other option is --png which allows you to have PNG files instead of DDS files. This option can be convenient for those who want to download images for other purposes. PNG files are not compressed and therefore, with the same covered area, they require about 4 times more disk space.

In the wiki manual there is the explanation:

For --save param: https://wiki.flightgear.org/Julia_photoscenery_generator#--save

Image

For --png param: https://wiki.flightgear.org/Julia_photoscenery_generator#--png

Image

The photoscenary.jl program can be downloaded at this GitHub link:
https://github.com/abassign/Photoscenary

The complete manual can be found on the FGFS wiki:
https://wiki.flightgear.org/Julia_photoscenery_generator
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby merspieler » Wed Jul 28, 2021 10:05 pm

abassign wrote in Wed Jul 28, 2021 5:13 pm: PNG files are not compressed


PNG is compressed... but lossles
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Photoscenery generator for Julia compiler

Postby abassign » Thu Jul 29, 2021 5:09 pm

merspieler wrote in Wed Jul 28, 2021 10:05 pm:
abassign wrote in Wed Jul 28, 2021 5:13 pm: PNG files are not compressed

PNG is compressed... but lossles


Ciao,

PNG is compressed, but for a scenario image its compression factor is very small, the problem is that when it is loaded for the GPU the program, which follows this step, converts it to DDS and this takes some time. Since the execution is sequential and not parallel in FGFS, this compression activity blocks the loading / updating of the scenario, leading to a block in the execution of the FGFS program.
If, on the other hand, the DDS format is immediately adopted, there is a loading into the GPU without processing and this considerably reduces the possibility of having momentary execution blocks of the simulation.
This is the reason why the photoscenary.jl program performs the transformation of PNG files into DDS and does so trying to use at least 2-4 CPUs in order to avoid slowdowns in the download.
The DDS file is compressed simply because it averages a bunch of pixels via an interpolation function, something like a primitive JPG. This method makes it easy to convert a PNG to DDS, but conversely converting a DDS to PNG may not give as good results, so I decided not to let the program perform the DDS-> PNG conversion if you want a PNG format. But some of you asked for this possibility and so I introduced the --png parameter which produces .png files instead of .dds files
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby SchoolBusesC2 » Wed Aug 04, 2021 8:50 pm

Hey! Thanks for this great tool, however, I am facing some issues. The image of the error is here. It seems like a few others have the same problem. This is freshly pulled from git.
SchoolBusesC2
 
Posts: 19
Joined: Sat Aug 18, 2018 1:08 am
Callsign: N1440/JBU1440
OS: Manjaro

Re: Photoscenery generator for Julia compiler

Postby frtps » Thu Aug 05, 2021 8:48 am

That is probably because you have some non-ASCII characters in your directory path (looks like Chinese?). If you can't wait for @abassign to fix it you will need to create a directory path that is ASCII only.
frtps
 
Posts: 145
Joined: Sun Aug 05, 2018 10:58 am

Re: Photoscenery generator for Julia compiler

Postby merspieler » Thu Aug 05, 2021 9:39 am

The 1980s called, they want their inflexible char sets back :P
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Photoscenery generator for Julia compiler

Postby abassign » Mon Aug 09, 2021 7:48 am

SchoolBusesC2 wrote in Wed Aug 04, 2021 8:50 pm:Hey! Thanks for this great tool, however, I am facing some issues. The image of the error is here. It seems like a few others have the same problem. This is freshly pulled from git.


Hi, The characters that the scanner handles are 2 bytes (UTF-8), but there are problems for 3 and more byte characters, but the problem is manageable, here is a note explaining the problem:
https://docs.julialang.org/en/v1/manual/strings/#Unicode-and-UTF-8
To understand better I need to build a directory with characters of this type in order to solve your problem (and not just yours I'm sure).
Just solved I insert the change in version 0.3.4.
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby abassign » Mon Aug 09, 2021 2:22 pm

SchoolBusesC2 wrote in Wed Aug 04, 2021 8:50 pm:Hey! Thanks for this great tool, however, I am facing some issues. The image of the error is here. It seems like a few others have the same problem. This is freshly pulled from git.


Hello,
i just updated the version of Photoscenary.jl which is now 0.3.4 this version has the fix to the Chinese characters problem you reported, I have tested the program and it seems to work fine, but I ask you please if you can test it and if it works correctly.
Thanks for collaboration
Adriano
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby abassign » Mon Aug 16, 2021 4:05 pm

The photoscenary.jl program has been updated with version 0.3.5 which introduces an important improvement.

These changes allow to have a dynamic management of the images of the tiles during the flight and works well up to mach 0.9 with a fast ADSL connection (20 Mbit / s)

Modified the common.jl module, the module has been reorganized with the structure: module PhotoscenaryCommons and the file name is: PhotoscenaryCommons.jl

Various errors have been corrected in the management of the automatic variation of the file size according to the distance. Vertical distance has also been introduced in order to reduce the size of the tiles on the vertical. The calculation is inserted in the function: getSizePixelWidthByDistance and has this algorithm: sizePixelFound = Int64 (size - round ((size-sizeDwn) * sqrt (distance ^ 2 + altitudeNm ^ 3.0) * 1.5 / radius)) The cubic exponent is used to increase the size reduction factor also as a function of the height with respect to the ground.

The function has been changed connector.getFGFSPositionSetTask introducing the radiusStepFactor parameter with value 0.5 This allows a more frequent update when the program is connected with FGFS and dynamically downloads the tiles images.

As usual you can download the program at this link:
https://github.com/abassign/Photoscenary
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby lomar » Mon Aug 16, 2021 11:10 pm

guys, i'm trying to run the tool ut it gives me a "too many arguments" error and nothing is downloaded. what should i do?
lomar
 
Posts: 479
Joined: Mon Jun 30, 2014 2:38 am
Location: Rio de Janeiro, Brazil
Callsign: lomar
Version: nightly
OS: win 10

Re: Photoscenery generator for Julia compiler

Postby merspieler » Tue Aug 17, 2021 8:30 am

check your arguments?

or post your command, so we can check it...
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Photoscenery generator for Julia compiler

Postby abassign » Tue Aug 17, 2021 2:06 pm

lomar wrote in Mon Aug 16, 2021 11:10 pm:guys, i'm trying to run the tool ut it gives me a "too many arguments" error and nothing is downloaded. what should i do?


Hi I tried to reproduce the problem you reported, I noticed that if you enter more than one topic in the same option I get the same error you reported to me.
for example

Code: Select all
-s 2 3


This is the command line effect:
Code: Select all
julia -t 6 photoscenary.jl -s 2 1


Code: Select all
abassign@abassign-P7xxTM1:~/github/Photoscenary$ julia -t 6 photoscenary.jl -s 2 1
The actiual Julia is 1.7.0-beta3.0 The current version is correct in order to obtain the best performances

Photoscenary.jl ver: 0.3.5 date: Testing 20210816 System prerequisite test


Photoscenery generator by Julia compilator,
Program for uploading Orthophotos files

Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

ImageMagic is operative!
too many arguments
usage: photoscenary.jl [--map MAP] [--latll LATLL] [--lonll LONLL]
                       [--latur LATUR] [--lonur LONUR] [-a LAT]
                       [-o LON] [-x] [--png] [-i ICAO] [--route ROUTE]
                       [-t TILE] [-r RADIUS] [-s SIZE] [--sdwn SDWN]
                       [--over OVER] [-p PATH] [--save SAVE]
                       [--connect CONNECT] [--proxy PROXY]
                       [--attemps ATTEMPS] [-d DEBUG] [--version]


I hope I have solved your problem, if not send the command line you did. Then check that the Julia version is at least 1.5.4 the program returns the version to the first line, in my case the 1.7.0 Beta 3
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery generator for Julia compiler

Postby Delta5142 » Sun Aug 29, 2021 12:12 am

Ok... So I'm successfully able to download the scenery for KSFO with the command:
Code: Select all
julia photoscenary.jl -s 1 -i KSFO


It downloaded the scenery in FGFS-scenery/photoscenery/Orthophotos/w130n30/.... and two other directories by the names of w122n37 and w123n37, which both contain the photoscenery dds files. It seems successful enough, so now how do I actually implement the photoscenery into flightgear and use it?

Thanks in advance,
Delta
Delta5142
 
Posts: 340
Joined: Thu Jul 02, 2020 4:18 pm
Location: Northern California
Callsign: DAL5142
Version: next
OS: Mac OS X

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 8 guests