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 wlbragg » Wed Jan 26, 2022 1:03 pm

Thanks, I didn't see that.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Photoscenery generator for Julia compiler

Postby Delta5142 » Mon Feb 21, 2022 5:06 pm

I finally got the photoscenery to work, but is there a way to exclude the airports from the coverage? Since I have a low end system, I'm using a low resolution, and because of that the airport runways and apron appear blurry.
Image

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

Re: Photoscenery generator for Julia compiler

Postby merspieler » Mon Feb 21, 2022 7:19 pm

1st ortho scenery doesn't really impact performance... only thing you need is enough RAM and VRAM.
2nd even on the highest res ortho scenery, taxiways and so on look quite blurry... so you always wanna see the normal scenery.
I've got no clue why it disables the generic runway stuff but increasing the terrain setting by one level solved that for me.
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 Delta5142 » Mon Feb 21, 2022 8:30 pm

Thanks for the explanation, my terrain setting was on Low, so that's why the generic stuff wasn't showing. Everything is fine now after I brought it up by one.
Delta5142
 
Posts: 340
Joined: Thu Jul 02, 2020 4:18 pm
Location: Northern California
Callsign: DAL5142
Version: next
OS: Mac OS X

Re: Photoscenery generator for Julia compiler

Postby Delta5142 » Sat Feb 26, 2022 11:56 pm

Another question, let's say that I wanted to downloaded photoscenery for an entire region, such as California. What would be the easiest way to do this?

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

Re: Photoscenery generator for Julia compiler

Postby merspieler » Sun Feb 27, 2022 4:05 pm

Just get the bounding box and set the parameters right... like you do with a smaller area.
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 D-MKF1 » Wed Mar 02, 2022 6:45 pm

Hello,
I have just install the fg version 2020.3.12 on my mac and follow the wiki for julia an photoscenery. Everything works fine and I start fg via console. My --fg-scenery path is =/Users/xxxx/xxxx/flightgear/photodir/Orthophotos/:/Users/xxxx/more/sceneries/:/User/xxxx/more/etc
On the Wiki Site the path in the startup file must be set on /Users/xxxx/xxxx/flightgear/photodir without Orthopotos. Is it right?
However, I can't find any more parameters under rendering options in the fg menu that I can set.
Menu > View > Rendering Options > Satellite Photoscenery is not there.
What do I have to set?
Cheers,
Marc
D-MKF1
 
Posts: 99
Joined: Mon Sep 30, 2013 6:03 pm
Version: Git
OS: GNU/Linux | Mac OS X

Re: Photoscenery generator for Julia compiler

Postby wkitty42 » Wed Mar 02, 2022 7:39 pm

IIRC, that option is only available in the nightlies, right now... that's 2020.4 at the moment... it is too new a feature to be included in the current LTS release...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Photoscenery generator for Julia compiler

Postby Michat » Mon Mar 21, 2022 9:36 pm

Page 11 of this thread .

SDeAstis wrote in Sun Sep 19, 2021 6:09 pm:
Hi,
can somebody explain me why every time I run the tool all the previous DDS file are deleted?
Also the Orthophoto-saved is cleaned!
I lost 65GB of files!
Also with the --connect option avery istance ran deletes all the previous DDS! Is this a bug of the latest version?


I-BASSY answered:

Hello, it is strange because there is no deletion of files, but only the copy from the directories you used for saving to the directory of the operational scenario.
Remember the command you used that I verify?
I often use to save an external disk, at this point I wonder, if the external disk was correctly mounted?
Honestly I have never had news of file losses, but obviously there are many different situations that can perhaps give something abnormal, if I discover them I can intervene to correct.


User Miguel (w10 on nightly) is reporting the same issue.
It seems FG misses the dds content of the photoscenery folder (no orthophotos folder in his path, but FGJulita it was working fine for months).

This week he founded that photoscen(a)ry.Jl on standard parameter julia -t 10 photoscenary.jl -s 4 -i LEGR didn't work as expect, program hangs during the process (in a black happening). Quick Control c combination is not given the normal quick interruptions however it seems to work by pressing Control c for longer time.

I have installed juliaimage-magic-FGJulita on my MX linux on imac and is working okay, but i DON'T HAVE NIGHTLY TO USE IT :( I have Julia 1.7.
Miguel have tried with the former and working for months J1.6 and today we tried with J1.7
He get the same dis-function of this week with the generation process hanging. Control c having the same strange behavior.

As a test I told Miguel to use close terminal, next open a new CMD navigate to the directory as usual and execute this FGJulita naked command:

julia photoscenary.jl

¡ surprise! it seems to flush the drain and reuse the former blocks that weren't processed. But for any new other terrain generation attempt, we have to flush it next.

Finally he got the dds, but we don't know how those files disappeared while FGJulita stop working as usual.

That's all I know. FYI we didn't use any network seettings

29.92
User avatar
Michat
 
Posts: 1226
Joined: Mon Jan 25, 2010 7:24 pm
Location: Spain
Version: 191b
OS: MX 21 Fluxbox oniMac

Re: Photoscenery generator for Julia compiler

Postby Valafenn » Sun Apr 03, 2022 10:12 am

Hi to all

First, many thanks for the abilities to download photoscenery :)

Second, i like to plan my flies for the planes' range, thus it is sometimes complicated to plan the download of tiles, due to the amount of data required. So I don't know if it already exist (and i am not a programmer :), so i made this in python. Here an example of KORD to KLGA.

As usual, any comment is welcome.

Cheers

Code: Select all
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 03 07:27:37 2022

@author: xxxx
"""
#------------------------------------------------------------------------------
# ASSUMPTION
#
# This file is dedicated to produce the fgfs download tiles command file

# A set file must contain :
# the departure coordinates
# the arrival coordinates
# the line betwenn departure and arrival is the euclidian straight line

 
#------------------------------------------------------------------------------
# CHAPTER 0 - LIBRARIES
#
import os
import math
from datetime import date


#-----------------------------------------------------------------------------
import os
# CHAPTER 1 : CALLED PARAMETERS

# # # ============
# # # photoscenery folder destination
scenery_folder="/home/xxxx/photoscenery"
print("scenery folder : " + str(scenery_folder))

# # # ============
# # # folder location destination
folder_location="./flightgear-photoscenery/"
print("folder location : " + str(folder_location))

# # # ============
# # # command file definition
flightgear_directory="/home/xxxx/Desktop/FLIGHTGEAR/ORTHO/"
print("flightgear directory : " + str(flightgear_directory))


# # ============
# departure name
dep_name="KORD"

# arrival name
arr_name="KLGA"


# the first point coordinates must be wester to the second point coordinates
# # ============
# # departure coordinates in decimals
long_dec_dep=-179.999999
lat_dec_dep=-89.999999

# # ============
# # arrival coordinates in decimals
long_dec_arr=179.999999
lat_dec_arr=89.999999


# # ============
# # departure coordinates in deg minutes seconds
long_dms_dep=-87.5417
lat_dms_dep=41.5843

# # ============
# # arrival coordinates in deg minutes seconds
long_dms_arr=-73.5230
lat_dms_arr=40.4630


# # ============
# # units choice
# 1 : decimals
# 2 : degrees minutes seconds
units=2

#-----------------------------------------------------------------------------
import os
# CHAPTER 2 : FUNCTIONS AND METHODS

# # ============
def dms_to_dec(dms) :
    dms_abs=abs(dms)
   
    dms_int=math.floor(dms_abs)
    dms_int=dms_int

    dms_min_int = math.floor((dms_abs - dms_int)*100)
    dms_min_int=dms_min_int

    dms_sec_int = math.floor((dms_abs - dms_int - (dms_min_int/100))*10000)
    dms_sec_int=dms_sec_int

    dec_sec = dms_sec_int / 60

    dec_min = (dms_min_int + dec_sec) / 60

    dec_abs = round((dms_int + dec_min),6)

    if dms < 0 :
        dec = -dec_abs
    else :
        dec = dec_abs
   
    # debug_dialog
    # print("dms_abs : " + str(dms_abs))
    # print("dms_int : " + str(dms_int))
    # print("dms_min_int : " + str(dms_min_int))
    # print("dms_sec_int : " + str(dms_sec_int))
    # print("dec_sec : " + str(dec_sec))
    # print("dec_min : " + str(dec_min))
    # print("dec_abs : " + str(dec_abs))
    # print("dec : " + str(dec))
   
    return dec


# # ============
def coord_to_gap(x) :
    x_gap_int_min=math.floor(abs(x))
   
    x_gap_int_max=x_gap_int_min + 1
   
    x_gap_min=x_gap_int_min - 1
       
    x_gap_max=x_gap_int_max + 1   
   
    if x < 0 :
        x_gap_min_s = -x_gap_max
    else :
        x_gap_min_s = x_gap_min   
   
    if x < 0 :
        x_gap_max_s = -x_gap_min
    else :
        x_gap_max_s = x_gap_max   
   
    list_return=(x_gap_min_s,x_gap_max_s)   
   
    # debug_dialog
    # print("x_gap_int_min : ", x_gap_int_min)
    # print("x_gap_int_max : ", x_gap_int_max)
    # print("x_gap_min : ", x_gap_min)
    # print("x_gap_max : ", x_gap_max)
    # print("x_gap_min_s : ", x_gap_min_s)
    # print("x_gap_max_s : ", x_gap_max_s)
    # print("list_return : ", list_return)
   
    return list_return


#-----------------------------------------------------------------------------
import os
# CHAPTER 3 : INTERNAL FILE PARAMETERS

# # # ============
# # # file definition
file_name="fgfs_way_" + str(dep_name) + "-" + str(arr_name) + ".sh"
print("file name : " + str(file_name))

file_name_path=str(flightgear_directory) + str(file_name)
print("file name path : " + str(file_name_path))


# # # ============
# # # coordonates translation
long_ddec_dep = dms_to_dec(long_dms_dep)
print("long_ddec_dep : " + str(long_dms_dep) + " to " + str(long_ddec_dep))

lat_ddec_dep = dms_to_dec(lat_dms_dep)
print("lat_ddec_dep : " + str(lat_dms_dep) + " to " + str(lat_ddec_dep))

long_ddec_arr = dms_to_dec(long_dms_arr)
print("long_ddec_arr : " + str(long_dms_arr) + " to " + str(long_ddec_arr))

lat_ddec_arr = dms_to_dec(lat_dms_arr)
print("lat_ddec_arr : " + str(lat_dms_arr) + " to " + str(lat_ddec_arr))


# # # ============
# # # coordinates definition
# # ============
# # departure coordinates
if units == 1 :
    long_dep=long_dec_dep
else :
    long_dep=long_ddec_dep
   
print("long_dep : " + str(long_dep))
   
if units == 1 :
    lat_dep=lat_dec_dep
else :
    lat_dep=lat_ddec_dep
   
print("lat_dep : " + str(lat_dep))

# # ============
# # arrival coordinates
if units == 1 :
    long_arr=long_dec_arr
else :
    long_arr=long_ddec_arr
   
print("long_arr : " + str(long_arr))

if units == 1 :
    lat_arr=lat_dec_arr
else :
    lat_arr=lat_ddec_arr

print("lat_arr : " + str(lat_arr))


# # # ============
# # # x, y coordinates definition
xd=long_dep
yd=lat_dep

xa=long_arr
ya=lat_arr

print("(xd, yd) : " + "(" + str(xd) + ", " + str(yd) + ")")
print("(xa, ya) : " + "(" + str(xa) + ", " + str(ya) + ")")


# # # ============
# # # y = ax + b , affine coefficients
a=((ya-yd)/(xa-xd))
b = -(xd*ya - xa*yd)/(xa-xd)
print("a : " + str(a) + ", b : " + str(b))

# angle between x_axis and trajectory line
alpha=math.atan(a)
print("alpha : " + str(alpha))

alpha_deg=math.degrees(alpha)
print("alpha_deg : " + str(alpha_deg))


# # # ============
# # # points suivants
# distance au point suivant
dec=3
x_delta = dec * math.cos(alpha)
print("x_delta : " + str(x_delta))

y_delta = dec * math.sin(alpha)
print("y_delta : " + str(y_delta))

# point suivant
x1 = xd + x_delta
print("x1 : " + str(x1))

y1 = yd + y_delta
print("y1 : " + str(y1))

# # # ============
# # # x, y gap coordinates
xd_gap=coord_to_gap(xd)
xd_gap_min=xd_gap[0]
xd_gap_max=xd_gap[1]
print("xd_gap : " + str(xd_gap_min) + " to " + str(xd_gap_max))

yd_gap=coord_to_gap(yd)
yd_gap_min=yd_gap[0]
yd_gap_max=yd_gap[1]
print("yd_gap : " + str(yd_gap_min) + " to " + str(yd_gap_max))

xa_gap=coord_to_gap(xa)
xa_gap_min=xa_gap[0]
xa_gap_max=xa_gap[1]
print("xa_gap : " + str(xa_gap_min) + " to " + str(xa_gap_max))

ya_gap=coord_to_gap(ya)
ya_gap_min=ya_gap[0]
ya_gap_max=ya_gap[1]
print("ya_gap : " + str(ya_gap_min) + " to " + str(ya_gap_max))


#-----------------------------------------------------------------------------
import os
# CHAPTER 4 : WRITING FILE 

# Open file with write rights, if file doesn't exist, the file is created
file = open(file_name_path,"w+")

# # # ============
# # # file header
# bash
file.write("#/bin/bash\n\n")

# Creator
file.write("#   My Name aka 'MyPseudo'\n")
dodate=date.today()
file.write("#   " + str(dodate) + "\n")
file.write("\n")

# # # ============
# # # file main
file.write("#=================================================================\n")
# ------------ Write the file
file.write("# Destination folder location\n")
file.write("\n")
file.write("cd " + str(folder_location) + "\n")
file.write("\n")

file.write("#=================================================================\n")
# ------------
file.write("# Points coordinates\n")
file.write("\n")
file.write("# Departure name : " + str(dep_name) + "\n")
file.write("# Departure point coordinates\n")
file.write("#   Longitude : " + str(long_dep) + "\n")
file.write("#   Lattitude : " + str(lat_dep) + "\n")
file.write("\n")
file.write("# Arrival name : " + str(arr_name) + "\n")
file.write("# Arrival point coordinates\n")
file.write("#   Longitude : " + str(long_arr) + "\n")
file.write("#   Lattitude : " + str(lat_arr) + "\n")
file.write("\n")
file.write("\n")
file.write("# affine line : y = a.x + b\n")
file.write("#   a : " + str(a) + "\n")
file.write("#   b : " + str(b) + "\n")
file.write("\n")

file.write("#=================================================================\n")
# ------------
file.write("# Loading tiles\n")
file.write("\n")
file.write("# Loading tiles for departure\n")
file.write("echo \"Loading tiles for departure\"\n")
file.write("perl create_bbox.pl --latLL " + str(yd_gap_min) + " --lonLL " + str(xd_gap_min) + " --latUR " + str(yd_gap_max) + " --lonUR " + str(xd_gap_max) + " -- --cols 2 --scenery_folder " + str(scenery_folder) + "\n")
file.write("\n")

# # # ============
# # # while loop
# preparation
i=0

xi = xd + x_delta
yi = yd + y_delta

# loop
while xi < xa :
    i = i + 1
    # x{i}
    # print("xi : " + str(x(i)))
    print("step_" + str(i))
   
    # x, y gap coordinates
    xi_gap=coord_to_gap(xi)
    xi_gap_min=xi_gap[0]
    xi_gap_max=xi_gap[1]
    print("xi_gap : " + str(xi_gap_min) + " to " + str(xi_gap_max))
   
    yi_gap=coord_to_gap(yi)
    yi_gap_min=yi_gap[0]
    yi_gap_max=yi_gap[1]
    print("yi_gap : " + str(yi_gap_min) + " to " + str(yi_gap_max))
   
    file.write("# Loading tiles for step " + str(i) + "\n")
    file.write("echo \"Loading tiles for step " + str(i) + "\"\n")
    file.write("perl create_bbox.pl --latLL " + str(yi_gap_min) + " --lonLL " + str(xi_gap_min) + " --latUR " + str(yi_gap_max) + " --lonUR " + str(xi_gap_max) + " -- --cols 2 --scenery_folder " + str(scenery_folder) + "\n")
    file.write("\n")
   
    # print(xi)
    xi = xi + x_delta
    yi = yi + y_delta
   
else :
    print("xi is no longer less than xa")

file.write("# Loading tiles for arrival\n")
file.write("echo \"Loading tiles for arrival\"\n")
file.write("perl create_bbox.pl --latLL " + str(ya_gap_min) + " --lonLL " + str(xa_gap_min) + " --latUR " + str(ya_gap_max) + " --lonUR " + str(xa_gap_max) + " -- --cols 2 --scenery_folder " + str(scenery_folder) + "\n")
file.write("\n")


#=============================================================================
# CHAPTER end : CLOSING FILE

# Close the file
file.close()


print("fgfs_way.py file completed")

Valafenn
 
Posts: 26
Joined: Sat May 26, 2018 7:23 am

Re: Photoscenery generator for Julia compiler

Postby MariuszXC » Sun Apr 03, 2022 1:01 pm

So why did you go this way instead of using the option to have julia photoscenery generator run in the background, connected to FG, tracking your plane location and downloading tiles as necessary?
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Photoscenery generator for Julia compiler

Postby Valafenn » Mon Apr 04, 2022 7:48 am

Hi to all

Many thanks to reply. As i written, i prefer to plan the download in order to control the amount of data. Further it avoids the lags during playing game :).

Thanks
Valafenn
 
Posts: 26
Joined: Sat May 26, 2018 7:23 am

Re: Photoscenery generator for Julia compiler

Postby wkitty42 » Mon Apr 04, 2022 9:58 am

i'm slightly confused as to why you have to put in the coords in decimal degrees and DMS formats... why not choose one of them and use math to convert to the other if/when needed? or just choose the one that's needed and forego any conversions? i mean you do appear to have (in your chapter 2) the conversions between the two formats so i'm apparently missing something...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Photoscenery generator for Julia compiler

Postby MariuszXC » Mon Apr 04, 2022 10:48 am

I do not see how, for a given planned route, downloading the data in advance would be different from downloading it in the background while flying this route. In both cases the amount of data should be the same.
I did not observe lags related to downloading, but your hardware may be different.
The main advantage of your approach is having the data stored in advance, enabling a later flight without a need for any internet connection. On the other hand, if you decide to divert to an alternate you may run into an un(photo)charted territory ;)
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Photoscenery generator for Julia compiler

Postby Valafenn » Mon Apr 04, 2022 5:44 pm

Hi to all

Many thanks for your comments. the little code is not a competitor versus JULIA, it is just a tool that serves to my needs and be shared.

@wkitty42 : euh, i think I prefers use the decimal (like FG shows), but somes use DMS (skyvector, Wikipedia), so i let choose and just convert dms to decimal for calculation.

@MariuszXC you pointed the reason. sometimes i don't have enough time to finish my flight and don't pause it.

Thanks
Valafenn
 
Posts: 26
Joined: Sat May 26, 2018 7:23 am

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 15 guests