Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby vanosten » Sat Oct 17, 2020 12:48 pm

osm2city sources have been updated to use Python 3.8, updated requirements.txt and been tested again Postgresql 12. If you are using Ubuntu or some of its derivates, then 20.04 LTS is fine as a basis (be aware that Postgresql default port is 5434 in version 12 on Ubuntu).

Please use Python 3.8 and use pip install requirements.txt in a virtual environment.
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 vanosten » Sun Oct 18, 2020 7:50 am

If someone still gets problems with very high memory consumption etc. Please do me a favour:
  • Make sure that all DEBUG* flags are False and that no PDF files are generated by mistake. matplotlib takes lots of memory and does not release it (and because it is a debug feature I have not bothered finding a proper solution)
  • Create a proper issue with as much info as possible - or comment on an existing issue.
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 merspieler » Sun Oct 18, 2020 4:39 pm

So we depend now on python 3.8? No more 3.7?

That would be bad cause the osm2city stuff runs on debian stable with only has 3.7
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 vanosten » Sun Oct 18, 2020 8:23 pm

montagdude wrote in Tue Sep 08, 2020 12:06 pm:It's strange, I'm still getting an issue with this same tile using the latest master. I've done most of the state of Pennsylvania now, and this is the only place where this or any other exception has occurred. As I mentioned in a previous post, this tile also built successfully with commit 61464a366939cd2e4af41574a6871fdcda3f9601 from May.

Code: Select all
******* Exception in tile 1712251 - to reprocess use boundaries: -75.25_39.875_-75.0_40.0 ******* at 2020-09-07_104413 - 
Traceback (most recent call last):
  File "/home/dello/Projects/FGScenery_tools/osm2city/build_tiles.py", line 143, in process_scenery_tile
    buildings.process_buildings(the_coords_transform, my_fg_elev, blocked_apt_areas, my_stg_entries,
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/buildings.py", line 1129, in process_buildings
    write_buildings_in_meshes(coords_transform, buildings_in_meshes, stg_manager, stats)
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/buildings.py", line 1034, in write_buildings_in_meshes
    building_lib.write(os.path.join(path_to_stg, file_name + ".ac"), cl.objects,
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1766, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1267, in write_to_ac
    number_prev_ring_nodes += self._write_faces_for_ac(ac_object, self.polygon.exterior,
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1313, in _write_faces_for_ac
    tex_coord_bottom, tex_coord_top = _calculate_vertical_texture_coords(self.body_height, self.facade_texture)
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1598, in _calculate_vertical_texture_coords
    if t.v_can_repeat:
AttributeError: 'NoneType' object has no attribute 'v_can_repeat'


I can submit the osm.pbf, script, and params.ini if that would help debug.
ssu
This issue should be solved now.
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 vanosten » Sun Oct 18, 2020 8:33 pm

merspieler wrote in Sun Oct 18, 2020 4:39 pm:So we depend now on python 3.8? No more 3.7?

That would be bad cause the osm2city stuff runs on debian stable with only has 3.7


Well, I did not know what your worldbuild run on. I am following Ubuntu LTS and Python 3.8 has been out for 1 year. You can try 3.7 and the related versions of the dependencies - I just do not know.
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 merspieler » Sun Oct 18, 2020 9:00 pm

okay...
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 vanosten » Mon Oct 19, 2020 7:06 am

I have pushed a change, which might fix the problem that the program never returns even though all tiles seem to have been processed. I cannot test it, because I have never seen that problem myself. If it should happen again, then please create an issue instead of a discussion in this topic.
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 montagdude » Mon Oct 19, 2020 1:50 pm

vanosten wrote in Sun Oct 18, 2020 8:23 pm:
montagdude wrote in Tue Sep 08, 2020 12:06 pm:It's strange, I'm still getting an issue with this same tile using the latest master. I've done most of the state of Pennsylvania now, and this is the only place where this or any other exception has occurred. As I mentioned in a previous post, this tile also built successfully with commit 61464a366939cd2e4af41574a6871fdcda3f9601 from May.

Code: Select all
******* Exception in tile 1712251 - to reprocess use boundaries: -75.25_39.875_-75.0_40.0 ******* at 2020-09-07_104413 - 
Traceback (most recent call last):
  File "/home/dello/Projects/FGScenery_tools/osm2city/build_tiles.py", line 143, in process_scenery_tile
    buildings.process_buildings(the_coords_transform, my_fg_elev, blocked_apt_areas, my_stg_entries,
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/buildings.py", line 1129, in process_buildings
    write_buildings_in_meshes(coords_transform, buildings_in_meshes, stg_manager, stats)
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/buildings.py", line 1034, in write_buildings_in_meshes
    building_lib.write(os.path.join(path_to_stg, file_name + ".ac"), cl.objects,
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1766, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1267, in write_to_ac
    number_prev_ring_nodes += self._write_faces_for_ac(ac_object, self.polygon.exterior,
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1313, in _write_faces_for_ac
    tex_coord_bottom, tex_coord_top = _calculate_vertical_texture_coords(self.body_height, self.facade_texture)
  File "/home/dello/Projects/FGScenery_tools/osm2city/osm2city/building_lib.py", line 1598, in _calculate_vertical_texture_coords
    if t.v_can_repeat:
AttributeError: 'NoneType' object has no attribute 'v_can_repeat'


I can submit the osm.pbf, script, and params.ini if that would help debug.
ssu
This issue should be solved now.

Okay, thank you. Next time I work on scenery generation I will switch back to the latest master and make sure I don't see this error anymore.
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

Re: osm2city.py development

Postby vanosten » Sun Oct 25, 2020 9:26 am

I have changed the code in roads for lighting. It is much less code now and less complicated - plus generates fewer errors, fewer objects and runs faster. Please report with before/after pictures if you see any lighting issues, which were not there before.
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 vanosten » Sun Oct 25, 2020 1:03 pm

Railways now differentiate between normal, trams and with racks for max allowed slopes. This reduces some residuals with unlikely/impossible embankments. I have also changed the max slope allowed for roads to a bit more aggressive values. See also https://osm2city.readthedocs.io/en/late ... s-railways.
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 vanosten » Tue Nov 10, 2020 8:11 pm

Parameter TILE_SIZE is now called CLUSTER_DIMENSION to reflect, what it really is (and never has been). It is validated to be at least 3000 in order to reduce the number of files. Also latitude is now max 83 degs North/South (because anything more towards the poles is problematic in terms of flat earth projections and will never be tested).
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 vanosten » Sat Jan 02, 2021 3:13 pm

There are trees, baby!

osm2city now also works with trees from OSM (manually mapped single trees, along lines) as well as heuristics for OSM parks as well as heuristics for gardens around houses. However, this only works on Next.

The first picture is from Edinburgh looking North (castle and railway station on right lower corner).

Image

The next picture is from the same spot looking West - you can see the tile border, as the next tile only has trees according to BTG land-class (golf course and wooks) - I have replaced the urban land class with grass - see https://osm2city.readthedocs.io/en/late ... n-textures.

Image
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 merspieler » Sat Jan 02, 2021 4:21 pm

awesome...
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 wlbragg » Sat Jan 02, 2021 6:08 pm

That is awesome, nice work! You giving us the tools to make the custom scenery really rich.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: osm2city.py development

Postby merspieler » Sat Jan 02, 2021 6:45 pm

Custom? ... only for some time... :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: 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 3 guests