Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby legoboyvdlp » Sat Nov 10, 2018 3:20 pm

sounds like a fgelev issue, make sure it is there in that directory for a start (check the obvious thing first :) )

you also have scenery in the area you are generating for, correct?
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby merspieler » Sat Nov 10, 2018 4:04 pm

Just saw, that i've had a typo...
Code: Select all
/games/.fgfa


Still doesn't explain why no roads and buildings are seen
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: 2228
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: osm2city.py development

Postby legoboyvdlp » Sat Nov 10, 2018 4:22 pm

well, they would all be at elev 0 if fgelev fails: thus they will be below the terrain.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby merspieler » Sat Nov 10, 2018 4:33 pm

fixed the problem... i had to remove all .pkl files in the working directory and generate again...
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: 2228
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: osm2city.py development

Postby legoboyvdlp » Sat Nov 10, 2018 5:59 pm

I now have an error as well :lol:

Code: Select all
SpawnPoolWorker-3 root ERROR    Exception occurred while processing tile 1629568.
Traceback (most recent call last):
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\build_tiles.py", line 147, in process_scenery_tile
    my_stg_entries, file_lock)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\roads.py", line 1323, in process_roads
    coords_transform, stats, False)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\roads.py", line 1283, in _process_clusters
    ac.write(os.path.join(path_to_stg, file_name + '.ac'))
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\utils\ac3d.py", line 288, in write
    f = open(file_name, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/redpa/Documents/FlightGear/Custom Scenery/Florida-fg-CustomScenery\\Roads\\w090n20\\w081n28\\w090n20\\w081n28\\1629568roads0005.ac'
SpawnPoolWorker-3 root ERROR    ******* Exception in tile 1629568 - to reprocess use boundaries: -81.0_28.0_-80.75_28.125 *******
Traceback (most recent call last):
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\build_tiles.py", line 147, in process_scenery_tile
    my_stg_entries, file_lock)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\roads.py", line 1323, in process_roads
    coords_transform, stats, False)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\roads.py", line 1283, in _process_clusters
    ac.write(os.path.join(path_to_stg, file_name + '.ac'))
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\utils\ac3d.py", line 288, in write
    f = open(file_name, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/redpa/Documents/FlightGear/Custom Scenery/Florida-fg-CustomScenery\\Roads\\w090n20\\w081n28\\w090n20\\w081n28\\1629568roads0005.ac'



params.ini:

Code: Select all
PREFIX = "Florida"
PATH_TO_SCENERY = "C:/Users/redpa/Documents/FlightGear/TerraSync-b"
PATH_TO_OUTPUT = "C:/Users/redpa/Documents/FlightGear/Custom Scenery/Florida-fg-CustomScenery"
PATH_TO_OSM2CITY_DATA = "C:/Users/redpa/Documents/FlightGear/osm2city-work/osm2city-data"

NO_ELEV = False
FG_ELEV = "C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/bin-nightly/fgelev.exe"

DB_HOST = "localhost"
DB_PORT = 5432
DB_NAME = "florida"
DB_USER = "postgres"
DB_USER_PASSWORD = redacted

FLAG_2018_3 = True
BUILDING_USE_SHARED_WORSHIP = True
BUILDING_NEVER_SKIP_LEVELS = 4
BUILDING_REDUCE_CHECK_TOUCH = True

OVERLAP_CHECK_CONSIDER_SHARED = True

OWBB_GENERATE_BUILDINGS = True
OWBB_USE_BTG_LANDUSE = True
C2P_PROCESS_POWERLINES_MINOR = True
C2P_PROCESS_OVERHEAD_LINES = True


Any suggestions?
Last edited by legoboyvdlp on Sat Aug 22, 2020 2:29 pm, edited 1 time in total.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby vanosten » Sun Nov 11, 2018 9:17 am

I have not run on Windows for a while, but indeed the file path looks a bit odd, as the directory structure below "roads" is doubled ("w90n20\\w081n28"). It is also strange because apparently 1629568roads0001-4.ac have already been written. Could you check what has been written in which directory structure?
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
Joined: Sat Sep 25, 2010 6:38 pm
Location: Denmark - but I am Swiss
Pronouns: he/his
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby legoboyvdlp » Sun Nov 11, 2018 10:02 am

No .ACS whatsoever were written anywhere as far as I can see.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby vanosten » Sun Nov 11, 2018 6:10 pm

So: you run this with "all" and nothing is written at all? Or do you run "roads" and the first thing you get is this error? I have never had this problem and reading my code I do not see an obvious way. => could you send me the command you are running this with?

Btw: do not use FLAG_2018_3=True. (It is a residual - I will rename it to a more obvious name)
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
Joined: Sat Sep 25, 2010 6:38 pm
Location: Denmark - but I am Swiss
Pronouns: he/his
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby legoboyvdlp » Sun Nov 11, 2018 6:41 pm

Hi,
I was using build_tiles.py

I am almost certain its to do with path errors. I find absolute paths usually work first time, but in this case maybe I will try relative paths and see if that helps.

my command would be:

Code: Select all
cd Documents/FlightGear/osm2city-work/osm2city
build_tiles.py -f ../Projects/Florida/params.ini -b *-81_28_-80_29 -p 2


there were some messages such as
Code: Select all
SpawnPoolWorker-2 root INFO     Loading elev cache failed ([Errno 2] No such file or directory: '1629576_elev.pkl')
SpawnPoolWorker-1 root INFO     Loading elev cache failed ([Errno 2] No such file or directory: '1629568_elev.pkl')


but I assume that is because no cache was created yet.

here is a complete log:

https://pastebin.com/T1zHuFWb
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby legoboyvdlp » Sun Nov 11, 2018 8:44 pm

roads.py line 1280 - 1283:

Code: Select all
 path_to_stg = stg_manager.add_object_static(file_name + '.ac', center_global, cluster_elev, 0,
                                                    stg_verb_type)
        stg_paths.add(path_to_stg)
        ac.write(os.path.join(path_to_stg, file_name + '.ac'))


if file_name contains not only the name but the path, then this error could occur.
the path would occur twice. Let me try with

Code: Select all
ac.write(os.path.join(path_to_stg + '.ac'))


edit:

no,
still
Code: Select all
Traceback (most recent call last):
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\build_tiles.py", line 144, in process_scenery_tile
    osm_buildings, file_lock)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\buildings.py", line 704, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\building_lib.py", line 1473, in write
    ac.write(ac_file_name)
  File "C:\Users\redpa\Documents\FlightGear\osm2city-work\osm2city\utils\ac3d.py", line 288, in write
    f = open(file_name, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\redpa\\Documents\\FlightGear\\Custom Scenery\\Florida-fg-CustomScenery\\Buildings\\w090n20\\w081n28\\w090n20\\w081n28\\1629592city00903.ac'


but this indicates the error is in file_name. Let me try something else.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby legoboyvdlp » Sun Nov 11, 2018 9:14 pm

Seems to work by replacing
code such as:
Code: Select all
ac.write(os.path.join(path_to_stg, file_name + '.ac'))

with
Code: Select all
        ac.write(os.path.join(path_to_stg + '.ac'))



in roads, buildings, and pylons files

Code: Select all
SpawnPoolWorker-2 root INFO     writing cluster w090n20\w081n28\1629592city01104 with 9 buildings



it now puts the .ac files in the wrong place: e.g. w081n28.ac under w090n20 folder, not

"1629584city11006.ac"

under w081n28 folder

hopefully this helps you diagnose it

obviously this is still not correct, but it at least does not fail anymore.

Its strange nobody else has this error though :?
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby legoboyvdlp » Mon Nov 12, 2018 11:45 am

Sorry for the spam, but I have found the cause:
Using some print() elements, I found this:
Code: Select all
Path to stg: C:\Users\redpa\Documents\FlightGear\Custom Scenery\Florida-fg-CustomScenery\Roads\w090n20\w081n28

file name: w090n20\w081n28\1629576roads0503

combined: C:\Users\redpa\Documents\FlightGear\Custom Scenery\Florida-fg-CustomScenery\Roads\w090n20\w081n28\w090n20\w081n28\1629576roads0503.ac


therefore, filename is the problem: it has the entire path, not the filename alone.

A further print on replacement_prefix returns:
Code: Select all
w090n20\w081n28\1629576


replacement_prefix should contain,
Code: Select all
Florida

instead

therefore, it seems that on my system the problem is within replacement_prefix?

edit: yes, a further print reveals PREFIX is being replaced by things such as
Code: Select all
w090n20\w081n28\1629576
somewhere. It should instead be
Code: Select all
Florida


edit 2: by adjusing roads, buildings, pylons, and piers.py to remove the prefix, I got a successful build :)
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby radi » Tue Nov 13, 2018 7:37 am

legoboyvdlp wrote in Mon Nov 12, 2018 11:45 am:I have found the cause:

Good to see you're trying to fix things! ...but if you need to change something in four different places to fix a problem that nobody else is seeing, the root cause is very likely something entirely different.
OSM buildings for LOWI, EDDC
Custom scenery for VHXX YMML
Edit .stg via the FG Object Placement Tool
radi
 
Posts: 659
Joined: Mon Aug 25, 2008 5:24 pm
Location: YMML, EDDC

Re: osm2city.py development

Postby legoboyvdlp » Tue Nov 13, 2018 12:12 pm

build_tiles.py line 117:
Code: Select all
parameters.PREFIX = scenery_tile.prefix


Is there a reason for this?

maybe it should actually be
Code: Select all
scenery_tile.prefix = parameters.PREFIX


later at line 264 we have:

Code: Select all
tile_prefix = ("%s%s%s" % (calc_tile.directory_name((full_lon, full_lat)), os.sep, tile_index))


this is why PREFIX contains the dircetory and tile index (e.g. w090n20\w081n28\1629576)
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: osm2city.py development

Postby merspieler » Tue Nov 13, 2018 12:58 pm

I'm getting this error from time to time (changing id):
Code: Select all
SpawnPoolWorker-3 root ERROR    Unable to process building relation osm_id 7585239
Traceback (most recent call last):
  File "/storage/scenery/osm2city/osm2city/buildings.py", line 170, in _process_osm_relations
    my_buildings, coords_transform)
  File "/storage/scenery/osm2city/osm2city/buildings.py", line 248, in _process_multipolygon_buildings
    a_building = _make_building_from_way(nodes_dict, all_tags, outer_way, coords_transform, inner_rings)
  File "/storage/scenery/osm2city/osm2city/buildings.py", line 524, in _make_building_from_way
    refs=way.refs)
  File "/storage/scenery/osm2city/osm2city/building_lib.py", line 257, in __init__
    self.update_geometry(outer_ring, inner_rings_list, refs)
  File "/storage/scenery/osm2city/osm2city/building_lib.py", line 309, in update_geometry
    self.roll_inner_nodes()
  File "/storage/scenery/osm2city/osm2city/building_lib.py", line 332, in roll_inner_nodes
    outer_nodes_avail.remove(min_o)
ValueError: list.remove(x): x not in list


Another thing: in the distance the buildings are very grey and get it's texture when coming closer... how can i change that?
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: 2228
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

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 2 guests