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 11:48 am

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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby vanosten » Sun Oct 18, 2020 6: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby merspieler » Sun Oct 18, 2020 3: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
If everything is going against you, keep in mind that airplanes take off against the wind, not with it.
merspieler
 
Posts: 731
Joined: Thu Oct 26, 2017 10:43 am
Location: Wish to be in YBCS
Callsign: JST935. ORI1711
IRC name: merspieler
Version: next
OS: Debian Bullseye

Re: osm2city.py development

Postby vanosten » Sun Oct 18, 2020 7:23 pm

montagdude wrote in Tue Sep 08, 2020 11:06 am: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby vanosten » Sun Oct 18, 2020 7:33 pm

merspieler wrote in Sun Oct 18, 2020 3: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby merspieler » Sun Oct 18, 2020 8:00 pm

okay...
If everything is going against you, keep in mind that airplanes take off against the wind, not with it.
merspieler
 
Posts: 731
Joined: Thu Oct 26, 2017 10:43 am
Location: Wish to be in YBCS
Callsign: JST935. ORI1711
IRC name: merspieler
Version: next
OS: Debian Bullseye

Re: osm2city.py development

Postby vanosten » Mon Oct 19, 2020 6: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby montagdude » Mon Oct 19, 2020 12:50 pm

vanosten wrote in Sun Oct 18, 2020 7:23 pm:
montagdude wrote in Tue Sep 08, 2020 11:06 am: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: 234
Joined: Tue Dec 31, 2019 6:04 am

Re: osm2city.py development

Postby vanosten » Sun Oct 25, 2020 8: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby vanosten » Sun Oct 25, 2020 12: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby vanosten » Tue Nov 10, 2020 7: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: 482
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Previous

Return to Scenery

Who is online

Users browsing this forum: YandexBot [Bot] and 2 guests