cityjson / cjio

CityJSON/io: Python CLI to process and manipulate CityJSON files
MIT License
119 stars 31 forks source link

TypeError: unsupported operand type(s) for +=: 'dict' and 'list' #8

Closed tcommandeur closed 5 years ago

tcommandeur commented 5 years ago

When running cjio no_bld.json merge buildings.json save LOD2.json I get the following error;

Parsing no_bld.json v0.6 is not the latest version, and not everything will work. Upgrade the file with 'upgrade_version' command: 'cjio input.json upgrade_version save out.json' Merging files { "cityjson_version": "0.6", "epsg": null, "extensions": false, "cityobjects_total": 214, "cityobjects_present": [ "Building" ], "vertices_total": 13766, "transform/compressed": true, "geom_primitives_present": [ "MultiSurface" ], "materials": false, "textures": true } Traceback (most recent call last): File "C:\OSGeo4W64\apps\Python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\OSGeo4W64\apps\Python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\OSGeo4W64\apps\Python36\Scripts\cjio.exe__main.py", line 9, in File "C:\OSGeo4W64\apps\Python36\lib\site-packages\click\core.py", line 764, in call__ return self.main(args, kwargs) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\click\core.py", line 1164, in invoke return _process_result(rv) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\click\core.py", line 1102, in _process_result ctx.params) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\click\core.py", line 555, in invoke return callback(args, **kwargs) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\cjio\cjio.py", line 96, in process_pipeline cm = processor(cm) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\cjio\cjio.py", line 265, in processor cm.merge(lsCMs) File "C:\OSGeo4W64\apps\Python36\lib\site-packages\cjio\cityjson.py", line 997, in merge self.j["appearance"]["vertices-texture"] += cm.j["appearance"]["vertices-texture"] TypeError: unsupported operand type(s) for +=: 'dict' and 'list'

tcommandeur commented 5 years ago

Running cjio buildings.json merge no_bld.json save LOD2.json does work. The buildings.json file contains appearance textures where no_bld.json doesn't

hugoledoux commented 5 years ago

first could you please run what was first printed in red:

v0.6 is not the latest version, and not everything will work.
Upgrade the file with 'upgrade_version' command: 'cjio input.json upgrade_version save out.json'

and then see if the error is still there

tcommandeur commented 5 years ago

Same result after upgrading both input files

hugoledoux commented 5 years ago

fixed in 6a6eed420ce5fb44864a2ce76e4965938a7cc1ae