Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby saul » Wed Jul 11, 2018 9:32 pm

Hello,

I have just pulled the latest version (Sun Jul 1 21:30:29 2018 +0200) and tried to generate osm objects around Stockholm - Uppsala area. It seems some of the tiles could not be generated due to some exceptions. The problematic tiles are exactly on Stockholm downtown. Here below you can find the osm2city.exceptions.log and my params.ini file. I am executing the script with the following line using python3.6:

/usr/bin/python3.6 build_tiles.py -f stockholm/params.ini -b 17.00_59.00_19.20_60.00 -p 4

Any help is highly appreciated!

Saul

Code: Select all
**************** osm2city-exceptions.log **********************'

******* Exception in tile 1627558 - to reprocess use boundaries: -80.25_-3.5_-80.125_-3.375 ******* at 2018-07-01_100144 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1288, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 355, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 724, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 1627743 - to reprocess use boundaries: -80.125_-0.625_-80.0_-0.5 ******* at 2018-07-01_101351 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1288, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 355, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 724, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 1627767 - to reprocess use boundaries: -80.125_-0.25_-80.0_-0.125 ******* at 2018-07-01_101531 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1288, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 355, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 724, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 1627714 - to reprocess use boundaries: -80.75_-1.0_-80.625_-0.875 ******* at 2018-07-01_104444 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1288, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 355, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 724, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 1660483 - to reprocess use boundaries: -78.625_-1.0_-78.5_-0.875 ******* at 2018-07-01_111321 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 1644218 - to reprocess use boundaries: -79.75_0.875_-79.625_1.0 ******* at 2018-07-01_111512 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237200 - to reprocess use boundaries: 17.0_59.25_17.25_59.375 ******* at 2018-07-11_171621 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1288, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 355, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 724, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 3237194 - to reprocess use boundaries: 17.5_59.125_17.75_59.25 ******* at 2018-07-11_172046 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237195 - to reprocess use boundaries: 17.75_59.125_18.0_59.25 ******* at 2018-07-11_172529 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237219 - to reprocess use boundaries: 17.75_59.5_18.0_59.625 ******* at 2018-07-11_173221 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237211 - to reprocess use boundaries: 17.75_59.375_18.0_59.5 ******* at 2018-07-11_180913 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3253618 - to reprocess use boundaries: 18.5_59.75_18.75_59.875 ******* at 2018-07-11_182152 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1387, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 928, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 998, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3253584 - to reprocess use boundaries: 18.0_59.25_18.25_59.375 ******* at 2018-07-11_194000 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1288, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 355, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 724, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 3237200 - to reprocess use boundaries: 17.0_59.25_17.25_59.375 ******* at 2018-07-11_204234 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1284, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 343, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY, self.refs_shared)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 736, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples
******* Exception in tile 3237194 - to reprocess use boundaries: 17.5_59.125_17.75_59.25 ******* at 2018-07-11_204620 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1383, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 921, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 991, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237195 - to reprocess use boundaries: 17.75_59.125_18.0_59.25 ******* at 2018-07-11_205042 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1383, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 921, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 991, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237219 - to reprocess use boundaries: 17.75_59.5_18.0_59.625 ******* at 2018-07-11_205737 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1383, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 921, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 991, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3237211 - to reprocess use boundaries: 17.75_59.375_18.0_59.5 ******* at 2018-07-11_213420 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1383, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 921, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 991, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3253618 - to reprocess use boundaries: 18.5_59.75_18.75_59.875 ******* at 2018-07-11_214628 - 
Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 697, in process_buildings
    cluster_elev, cluster_offset, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1383, in write
    b.write_to_ac(ac_object, cluster_elev, cluster_offset, roof_mgr, face_mat_idx, roof_mat_idx, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 921, in write_to_ac
    face_mat_idx)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 991, in _write_faces_for_ac
    self.body_height * tex_coord_top_input)
ZeroDivisionError: float division by zero
******* Exception in tile 3253584 - to reprocess use boundaries: 18.0_59.25_18.25_59.375 ******* at 2018-07-11_230625 - 
Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 234, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saul/flightgear/dev_osmcity/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/saul/flightgear/dev_osmcity/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 1284, in analyse
    stats.nodes_simplified += b.simplify()
  File "/home/saul/flightgear/dev_osmcity/osm2city/building_lib.py", line 343, in simplify
    parameters.BUILDING_SIMPLIFY_TOLERANCE_AWAY, self.refs_shared)
  File "/home/saul/flightgear/dev_osmcity/osm2city/utils/utilities.py", line 736, in simplify_balconies
    reduced_poly = shg.Polygon(shg.LinearRing(ny_coords))
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 53, in __init__
    self._set_coords(coordinates)
  File "/usr/lib/python3/dist-packages/shapely/geometry/polygon.py", line 68, in _set_coords
    ret = geos_linearring_from_py(coordinates)
  File "shapely/speedups/_speedups.pyx", line 321, in shapely.speedups._speedups.geos_linearring_from_py
ValueError: A LinearRing must have at least 3 coordinate tuples

****************************** params.ini ******************************'
PREFIX = "STOCKHOLM"

MAX_SLOPE_ROAD = 0.20
MIN_ABOVE_GROUND_LEVEL = 0.02

PATH_TO_SCENERY = "/home/saul/flightgear/scenery"
PATH_TO_OUTPUT = "/home/saul/flightgear/custom_scen/STOCKHOLM"

PATH_TO_OSM2CITY_DATA = "/home/saul/flightgear/dev_osmcity/osm2city-data"

DB_HOST = "localhost"
DB_PORT = 5432
DB_NAME = "stockholm"
DB_USER = "giuser"
DB_USER_PASSWORD = "hola"


NO_ELEV = False
FG_ELEV = "/home/saul/flightgear/stable/install/flightgear/bin/fgelev"
Last edited by Johan G on Sun Jul 29, 2018 3:35 pm, edited 1 time in total.
Reason: Added [code] tags.
saul
 
Posts: 32
Joined: Tue Nov 26, 2013 9:57 pm

Re: osm2city.py development

Postby merspieler » Thu Jul 12, 2018 11:27 am

Just a thought... how about providing a docker image like it's available for terragear?

This would make things much easier for ppl who just want to build some area...
Love at first flight
Checkout Autopush. An improvment to the pushback to make your life easier.
merspieler
 
Posts: 163
Joined: Thu Oct 26, 2017 10:43 am
Location: GCLP
Callsign: LH454, HG3840, LX64
IRC name: merspieler
Version: 2018.3.1
OS: Linux

Re: osm2city.py development

Postby vanosten » Sun Jul 15, 2018 5:47 pm

As of now osm2city needs also (parts of) FG for terrain elevation (fgelev). In order to minimize the Docker image you would have to make a minimal compile - which I have no intentions to invest time into. Maybe it can be done differently too. If someone could creste a script, then I might look into it. However the image would also need hosting space and would probably be outdated pretty fast. (osm2city has no releases - yet)
Maintaining osm2city
vanosten
 
Posts: 332
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 » Sat Jul 28, 2018 7:50 am

saul wrote in Wed Jul 11, 2018 9:32 pm:Hello,

I have just pulled the latest version (Sun Jul 1 21:30:29 2018 +0200) and tried to generate osm objects around Stockholm - Uppsala area. It seems some of the tiles could not be generated due to some exceptions. The problematic tiles are exactly on Stockholm downtown. ...


I just pushed a small correction. I am working more on roofs etc. this weekend (actually it drives me crazy as the side effects of changes are not always obvious and slow to test). I would be glad if you could test a small area. Btw: your exception file contains a lot of other errors - but I have not looked at those.
Maintaining osm2city
vanosten
 
Posts: 332
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 Jul 29, 2018 2:54 pm

I just pushed another set of changes, which again should improve roofs to make more gabled roofs - and increase the probability that gabled roofs are aligned properly.

I have a few other ideas how to make for a more consistent look, but I am running out of ideas (there is the possibility to re-write "skeleton" roofs, but that would be a significant task.

There are many changes, which I would like to make, but I simply lack the time. If someone with Python knowledge and a bit of flair for geometry is interested to help, then I would be glad to mentor.

Things to come (see also previous listings):
  • Generate buildings where they lack in OSM. Most of the code is actually there, but the buildings are hard-coded and heuristics for different land-use types are very primitive. However you can fill-up a lot already.
  • Replace all texturing: [A] introduce changes to shader such that the shader repeats the textures and the texturemap can have several columns. [B] Create few facades textures of high quality and make them transparent, such that variation with colour is possible. These textures would be used for all other buildings than detached / terraced houses, because ...
  • ... introduce geometry shader for detached / terraced houses as well as those buildings, which have been generated due to missing OSM data (see also the viewtopic.php?f=5&t=33894 thread). This would decrease the disk size and improve the possibility to have good looking buildings. E.g. the number of different buildings in DCS is quite limited, but it looks plausible.
  • Removal of residuals in roads. Hedges along roads (see thread viewtopic.php?f=5&t=34558) seems not to be that easy.
  • Various issues.
Maintaining osm2city
vanosten
 
Posts: 332
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 saul » Sun Jul 29, 2018 5:10 pm

Hi!

Seems to be working now, at least the last commit jul 28. I just read that there is a new commit. I will test the latest version and upload the whole Stockholm-Uppsala region to github as a first delivery of Sweden OSM.

Many thanks!

Saul
saul
 
Posts: 32
Joined: Tue Nov 26, 2013 9:57 pm

Re: osm2city.py development

Postby saul » Mon Jul 30, 2018 8:41 pm

Hi,
I have tested the latest commit around different places around Stockholm and it is working. I will open a different thread with instructions about how to download the scenery.
Many thanks again!

Saul
saul
 
Posts: 32
Joined: Tue Nov 26, 2013 9:57 pm

Re: osm2city.py development

Postby hamzaalloush » Sat Sep 01, 2018 1:55 am

Hi,

With the latest version I can't seem to generate tiles that inherit from the FGData effect, in params.ini i have FLAG_2018_3 = True, but it doesn't seem to do anything.

The only way i can ever make OSM2City to use effects is to go back to a pre-DB version with the /tex structure and use "copy_data_stuff.py", with the 'master' branch it only generates .ac models but not effect xml's.
hamzaalloush
 
Posts: 631
Joined: Sat Oct 26, 2013 9:31 am
OS: Windows 10

Re: osm2city.py development

Postby vanosten » Sun Sep 02, 2018 6:10 am

hamzaalloush wrote in Sat Sep 01, 2018 1:55 am:Hi,

With the latest version I can't seem to generate tiles that inherit from the FGData effect, in params.ini i have FLAG_2018_3 = True, but it doesn't seem to do anything.

The only way i can ever make OSM2City to use effects is to go back to a pre-DB version with the /tex structure and use "copy_data_stuff.py", with the 'master' branch it only generates .ac models but not effect xml's.


FLAG_2018_3 or any *FLAG* are for development, such that I do not need to do branching. So please do not set to True. Could you please tell a bit more in details, what you want to do?
Maintaining osm2city
vanosten
 
Posts: 332
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 hamzaalloush » Sun Sep 02, 2018 10:55 am

Is it possible to generate this directory structure?

+-- $FG_SCENERY
| +-- Buildings
| | +-- e010n40
| | | +-- e010n47
| | | | +-- 3121728.stg
| | | | +-- e000n40_e009n47_3105347city1304.ac
| | | | +-- e000n40_e009n47_3105347city1304.xml

Where the .xml references <inherits-from>Effects/cityLM</inherits-from> ?

Back in pre-DB 2017.2 when the FLAG was set to False, I could do this but referenced the local effect cityLM in the directory.

But I managed to do what I want with some shell script and xml2-utils.

Code: Select all
#!/bin/bash

## create effect xml's for tiles  ##

for ac in *.ac ; do

    acfile=$(echo $ac)

    xmlfile=`echo "$acfile" | sed 's/\.ac/\.xml/'`

    echo creating $xmlfile

    xmltext=`echo "<PropertyList><path>"$acfile"</path><effect><inherits-from>Effects/cityLM</inherits-from><object-name>LOD_detail</object-name><object-name>LOD_rough</object-name></effect></PropertyList>"`

echo "$xmltext" | xmllint --format - > $xmlfile; done

## convert all *.ac entries in stg to *.xml  ##

for stg in *.stg ; do sed -i 's/\.ac/\.xml/g' $stg; done

hamzaalloush
 
Posts: 631
Joined: Sat Oct 26, 2013 9:31 am
OS: Windows 10

Re: osm2city.py development

Postby vanosten » Sat Oct 13, 2018 5:29 pm

If you wonder, where osm2city currently is heading: I am still working on making it possible to generate buildings at plausible places, where OSM data is missing. I guess most of the land-use modelling is done (see https://my.pcloud.com/publink/show?code=XZvqOn7ZdED4PKDWBq88wvbr4rEjpXTxXW2k. Currently Honolulu looks like https://my.pcloud.com/publink/show?code=XZktOn7ZqTvbURGnm4h9ieV4yIUJL0aADsh7, where the yellow buildings are generated. The challenge right now is to better parametrise the distance between generated buildings based on settlement types.
Maintaining osm2city
vanosten
 
Posts: 332
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 wlbragg » Sat Oct 13, 2018 6:45 pm

I am still working on making it possible to generate buildings at plausible places, where OSM data is missing.

If you don't mind my asking, what happens when you have generated building in a place that someone subsequently adds the buildings?
Will this be optional to include generated buildings?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4116
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: osm2city.py development

Postby vanosten » Sun Oct 14, 2018 8:39 am

The question is, where buildings subsequently get added. If it is in OSM, then there is no harm. The generated buildings are added just to the scenery, not OSM (it would be bad to do so). So a future run of scenery would just pick up the new buildings in OSM and only generate additional plausible buildings around it in the scenery (not OSM).

If buildings are added to the standard scenery, then there would be an overlap until someone generates the scenery again - the scenery generation process tries to detect hand-placed objects in FG scenery.

So your last question: no, right now you either choose in FG to have osm2city buildings displayed - or you leave them out. I guess that the probability of people adding buildings in FG in places, where there are OSM buildings vs. where there are no OSM buildings is the same.
Maintaining osm2city
vanosten
 
Posts: 332
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 28, 2018 11:15 am

As announced in viewtopic.php?f=5&t=32254&p=338046#p338046 there is now a scenery for Hawaii available. Some glitches exist and for some reason some tiles with buildings are not shown in the highly populated area of Honolulu (I am investigating).

To make the generation of buildings in plausible places possible, I have had to change quite a few parameters - so you might see some warnings. The user guide has an updated description about how "missing" buildings are generated. And you might need to read the linked chapters in the manual to understand. Please let me know, if the description needs some specific additional information (or is plain wrong).

Another thing to notice is that the generated buildings look quite generic - because they are hard-coded for the time being with little variance. I will discuss the future of osm2City while attending FSWeekend 2018.
Maintaining osm2city
vanosten
 
Posts: 332
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 » Sat Nov 10, 2018 1:49 pm

I've got osm2city running for the first time today...

I see just power lines and bridges and they are all at sea level (sunk into/below the ground)

my params.ini:
Code: Select all
PREFIX = "GCLP"
PATH_TO_SCENERY = "/games/.fgfa/TerraSync"
PATH_TO_OUTPUT = "/storage/scenery/osm2city/scenery"
PATH_TO_OSM2CITY_DATA = "/storage/scenery/osm2city/osm2city-data"

NO_ELEV = False
FG_ELEV = '/games/fg-linux/install/flightgear/bin/fgelev'

DB_HOST = "localhost"
DB_PORT = 5432
DB_NAME = "gclp"
DB_USER = <user>
DB_USER_PASSWORD = <password>


I've double checked all paths...

Why is everything at sea level and why don't i see roads?
Love at first flight
Checkout Autopush. An improvment to the pushback to make your life easier.
merspieler
 
Posts: 163
Joined: Thu Oct 26, 2017 10:43 am
Location: GCLP
Callsign: LH454, HG3840, LX64
IRC name: merspieler
Version: 2018.3.1
OS: Linux

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 8 guests