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

Changes to geometry properties #6

Merged
merged 3 commits into from
Dec 4, 2023
Merged

Conversation

clausnagel
Copy link
Member

This PR proposes minor changes to the JSON object structure for geometry properties:

  1. The "hierarchy" array has been renamed to "children". The array now only contains the children of the root geometry. A redundant representation of the root geometry in the array as with the previous "hierarchy" is not required anymore. Consequently, the "parent" property is not required for direct children of the root geometry anymore but only for nested children. This makes the entire JSON object a bit more compact.

  2. Since the root geometry is not contained in "children" anymore, its geometry "type" must now be defined as property of the JSON object. This has the advantage that both "type" and "objectId" of the root geometry are now available from the JSON object without having to iterate over "hierarchy" as in the previous representation.

  3. There is no implicit assumption about the ordering of the "children" array anymore. Previously, parents were assumed to be stored before their children.

  4. The "type" property is now mandatory for both the root geometry and all children.

Examples:

General content of the JSON object:

{
  "type": 9,  // mandatory geometry type of the root geometry
  "objectId": "my-geometry",  // optional object ID of the root geometry
  "is2D": false, // optional, default is false
  "children": [  // optional
    ...
  ]
}

A point geometry:

{
  "type": 1,
  "objectId": "point"
}

A solid geometry:

{
  "type": 9,
  "objectId": "solid",
  "children": [
    {
      "type": 6,
      "objectId": "shell"
    },
    {
      "type": 5,
      "objectId": "polygon1",
      "parent": 0,
      "geometryIndex": 0
    },
    {
      "type": 5,
      "objectId": "polygon2",
      "parent": 0,
      "geometryIndex": 1
    },
   ...
  ]
}

@clausnagel clausnagel requested a review from yaozhihang December 2, 2023 12:33
"objectId": {
"type": "string"
},
"is2D": {
"type": "boolean",
"default": false
},
"hierarchy": {
"children": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we have to first update the geoemtryProperties.schema.json in the 3dcitydb repo, and do the reflected changes here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, true. But pure JSON schema changes are hard to test if there is no way to load and inspect JSON instances based on real data. I have added the schema changes to this PR. Once approved, we can first implement them in the 3DCityDB repo before merging this PR.

clausnagel added a commit to 3dcitydb/3dcitydb that referenced this pull request Dec 4, 2023
@clausnagel
Copy link
Member Author

Implemented JSON schema changes in the 3DCityDB repo with 3dcitydb/3dcitydb@a18440d

@clausnagel clausnagel merged commit 4561de9 into main Dec 4, 2023
4 checks passed
@clausnagel clausnagel deleted the feature-geometry-properties branch December 4, 2023 09:15
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

Successfully merging this pull request may close these issues.

2 participants