oscarpilote / Ortho4XP

A scenery generator for the X-Plane flight simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MultiPolygon' object is not iterable

jlempis opened this issue · comments

Hi There,

I try to use Ortho4XP 1.3 and it generates a error in a python Script
Could you help me ?

Thanks a lot

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/Users/me/Downloads/Ortho4XP/./src/O4_Tile_Utils.py", line 130, in build_all
VMAP.build_poly_file(tile)
File "/Users/me/Downloads/Ortho4XP/./src/O4_Vector_Map.py", line 42, in build_poly_file
(apt_array,apt_area)=include_airports(vector_map,tile)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/me/Downloads/Ortho4XP/./src/O4_Vector_Map.py", line 138, in include_airports
APT.smooth_raster_over_airports(tile,dico_airports)
File "/Users/me/Downloads/Ortho4XP/./src/O4_Airport_Utils.py", line 430, in smooth_raster_over_airports
for polygon in full_area:
TypeError: 'MultiPolygon' object is not iterable

My config :

MacBook Pro M1

Pyton 3.11.1

/usr/local/bin/python3
verbosity=1
cleaning_level=1
overpass_server_choice=random
skip_downloads=False
skip_converts=False
max_convert_slots=4
check_tms_response=True
http_timeout=10.0
max_connect_retries=5
max_baddata_retries=5
ovl_exclude_pol=[0]
ovl_exclude_net=[]
custom_scenery_dir=/Users/me/X-Plane12/Custom Scenery
custom_overlay_src=/Users/me/X-Plane12/Global Scenery/X-Plane 12 Global Scenery
apt_smoothing_pix=32
road_level=1
road_banking_limit=0.5
lane_width=5.0
max_levelled_segs=100000
water_simplification=0.0
min_area=0.001
max_area=200.0
clean_bad_geometries=True
mesh_zl=19
curvature_tol=1.5
apt_curv_tol=0.5
apt_curv_ext=0.5
coast_curv_tol=1.0
coast_curv_ext=0.5
limit_tris=0
hmin=0.0
min_angle=10.0
sea_smoothing_mode=zero
water_smoothing=10
iterate=0
mask_zl=15
masks_width=100
masking_mode=sand
use_masks_for_inland=True
imprint_masks_to_dds=False
masks_use_DEM_too=False
masks_custom_extent=
cover_airports_with_highres=False
cover_extent=1.0
cover_zl=18
ratio_water=1.0
overlay_lod=25000.0
sea_texture_blur=0.0
add_low_res_sea_ovl=False
experimental_water=0
normal_map_strength=1.0
terrain_casts_shadows=True
use_decal_on_terrain=True

To give more details :
I'm trying to build 1 tile (+50+002)
Imagery: BI, ZoomLevel 18

commented

This is caused by an incompatible shapely version (2.0.x). A possible workaround is to downgrade it. Details see here .

Thank you !
I've just downgrade to Ortho4XP 1.20 and i could generate tiles without any error.
But i can't have Xplane 12 working.
In log.txt i found
1447660 for file Custom Scenery/zOrtho4XP_+50+001/Earth nav data/+50+000/+50+001.dsf (235996 tris, 20 skipped for -217.5 m^2)
And nothing has changed in Xplane
Could you help me ?
Thanks in advance
John

commented

I'm putting together a fix for shapely 2.0 and some other soon to be deprecated stuff for numpy. So far it works for me. What imagery provider are you using?

commented

@ekaats That sounds great! Started an hour ago to wrap my head around python - now fighting with
unsupported operand type(s) for *: 'LineString' and 'float'" after having a fight with numpy...
It would be awesome if someone could fix it who is more familiar with python...
I am working on Fedora 37.
THX in advance!

commented

You could try my branch where I proposed fixes to this: https://github.com/ekaats/Ortho4XP

But I've changed a couple more things as well, for example, I proposed to use Imagemagick instead of the Nvidia library. On Gentoo, that last one isn't available (anymore?). Apart from that, I've tested it in a virtualenv with the latest packages and Python 3.10.

If you'd like, I could generate a requirements.txt of the packages and versions I used.

commented

@ekaats is this repo really maintained? There are open pull requests from 2019...
They are neither accepted nor rejected.
And there are 172 forks.
@oscarpilote do you need help maintaining the codebase and/or the repo?

Solved this issue by downgrading shapely and numpy:

pip install shapely==1.8.5
pip install numpy==1.23.5