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

dumping as jsonl file gives error #4

Open
ger08061959 opened this issue May 18, 2024 · 1 comment
Open

dumping as jsonl file gives error #4

ger08061959 opened this issue May 18, 2024 · 1 comment

Comments

@ger08061959
Copy link

When metadata is written it enters empty Objects. Those clash with the added feature(s), ignore duplicated does not remove empty fields
{
"CityObjects": {}, // duplicate field in next record
"metadata": {
"referenceSystem": "https://www.opengis.net/def/crs/EPSG/0/7415"
},
"transform": {
"scale": [
0.001,
0.001,
0.001
],
"translate": [
157560.28575,
571353.4415,
0.9310000534057608
]
},
"type": "CityJSON", duplicated field at end as type: CityJSONFeatures
"version": "2.0",
"vertices": [] duplicated field
} next record ignored as faulty
{
"CityObjects": { Duplicate
"NL.IMBAG.Pand.0710100000152165": {

Adaption of code to write either feature or features but not both

        with urllib.request.urlopen(jcUrl) as response:
            if response.code == 200:
                j = json.loads(response.read().decode('utf-8'))
                with open(self.IFCModelDict, "w") as my_file:
                    my_file.write(json.dumps(j["metadata"], indent=4) + "\n")
                    if "feature" in j:
                        my_file.write(json.dumps(j["feature"], indent=4) + "\n")
                    elif "features" in j:
                        for f in j["features"]:
                            my_file.write(json.dumps(f, indent=4) + "\n")
@balazsdukai
Copy link
Contributor

balazsdukai commented May 24, 2024

Hi, could explain your workflow in more detail?
Also, please provide the full command and a small amount of your input data to reproduce the issue.

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

2 participants