vvoovv / blosm

Blosm addon for Blender. A few clicks import of Google 3D cities, OpenStreetMap, terrain. Global coverage. Source code is in the branch 'release'.
1.55k stars 183 forks source link

Python error while importing certain coordinates #514

Open WispBart opened 1 month ago

WispBart commented 1 month ago

While trying to import building data from Berlin I encountered the error below.

I've tracked the problematic data to the following coordinates: Min Lat: 52.5563 Max Lat: 52.5625 Min Long: 13.455 Max Long: 13.4675

I've exported the region and added it as an attachment. berlinpasedagplatz.zip


Error: Python: Traceback (most recent call last):
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\__init__.py", line 250, in execute
    return self.importOsm(context)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\__init__.py", line 351, in importOsm
    a.render()
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\app\blender.py", line 464, in render
    m.render()

  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\manager.py", line 81, in render
    self.renderer.render(building, self.data)
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\renderer.py", line 135, in render
    self.renderElement(outline, building, osm)
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\renderer.py", line 164, in renderElement
    self._renderElement(element, building, roof, data, osm)
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\renderer.py", line 175, in _renderElement
    if roof.make(osm):
       ^^^^^^^^^^^^^^
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\roof\profile.py", line 620, in make
    slotR.trackUp(roofIndices)
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\roof\profile.py", line 465, in trackUp
    index = self.trackUp(roofIndices, index, part[-1])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WispBart\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blosm\building\roof\profile.py", line 456, in trackUp
    elif part[-1] != parts[index+1][1][0]:
                     ~~~~~^^^^^^^^^
IndexError: list index out of range```
vvoovv commented 1 month ago

Hi @WispBart

It is this building that causes the error.

image

A think that a more appropriate roof tag for this building is roof:shape=hipped. It's also a quick way to fix this problem.