Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using LOD subversion numbers problem in CityJSON output #16

Open
sambaas opened this issue Jan 6, 2022 · 5 comments
Open

Using LOD subversion numbers problem in CityJSON output #16

sambaas opened this issue Jan 6, 2022 · 5 comments

Comments

@sambaas
Copy link

sambaas commented Jan 6, 2022

Using LOD subversions gives a problem in the json output.
It looks like the part of the name is not stripped out properly (The two extra characters for the decimal character seem to be ignored when removing the '[LOD2.1]' part of the name.

{
    "type": "CityJSON",
    "version": "1.0",
    "metadata": {
        "geographicalExtent": [121578.775, 486020.60199999996, -4.7540000000000004, 121966.761, 486232.568, 309.487]
    },
    "CityObjects": {
        "] Cube": {
            "geometry": [{
                    "type": "MultiSurface",
                    "boundaries": [[[0, 1, 2, 3]], [[3, 2, 4, 5]], [[5, 4, 6, 7]], [[7, 6, 1, 0]], [[3, 5, 7, 0]], [[4, 2, 1, 6]]],
                    "lod": 2
                }
            ]
        },
        "Cube": {
            "geometry": [],
            "type": "Building"
        }
    },
    "vertices": [[236940.0, 60919.0, 163194.0], [236940.0, 60919.0, 314241.0], [236940.0, 211966.0, 314241.0], [236940.0, 211966.0, 163194.0], [387986.0, 211966.0, 314241.0], [387986.0, 211966.0, 163194.0], [387986.0, 60919.0, 314241.0], [387986.0, 60919.0, 163194.0]],
    "transform": {
        "scale": [0.001, 0.001, 0.001],
        "translate": [121578.775, 486020.60199999996, -4.7540000000000004]
    }
}
@sambaas
Copy link
Author

sambaas commented Jan 6, 2022

It appears to be line 260 in objects.py, because a hardcoded length is stripped off to get the ID:
CityObject_id = objid[10:]

Getting the part after the second space should fix this. I'll see if that works and make a pull request.

@sambaas
Copy link
Author

sambaas commented Jan 6, 2022

Made a pull request #17

@liberostelios
Copy link
Collaborator

Thanks a lot for raising the issue and submitting the PR! I'll review the fix and let you know.

@konmast3r
Copy link
Collaborator

konmast3r commented Jan 6, 2022

That is indeed an improvement. Back in the day when developing the add-on I never thought of decimal point LODs :-). Thanks Sam!

@liberostelios
Copy link
Collaborator

Tbf, at that point extended LoDs weren't really supported that well in the CityJSON specs. Thankfully, this is fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants