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

Query batch table recursively #407

Closed
FreakTheMighty opened this issue Mar 16, 2020 · 9 comments
Closed

Query batch table recursively #407

FreakTheMighty opened this issue Mar 16, 2020 · 9 comments

Comments

@FreakTheMighty
Copy link

Say I wanted to find a small feature, one not displayed at the root of the tile, then zoom into it. Is there a clever way search for that feature in a tileset's batch table? All I can think of at the moment is that you would need to download and query each individual b3dm until you find that specific feature.

Any advice or thoughts will be greatly appreciated.

@OmarShehata
Copy link

The styling language allows for visually highlighting features by property/name etc without needing to search through everything (since you can do this in the shader) but that only works on what is visible.

For actually finding the location of a feature, @lilleyse can correct me if I'm wrong, but I believe the recommended approach here is to run this type of query elsewhere (say a database with the feature names and locations) and then fly to that location in the client where you know the feature exists.

@FreakTheMighty
Copy link
Author

@OmarShehata @lilleyse what do you think about the hierarchical extension for this use? It supports referring to "features" that are no geometric. I could place this batch table in the root tile.

What I don't like about this solution, seems potentially like a lot of duplicate data.

@lilleyse
Copy link
Contributor

@FreakTheMighty the hierarchy extension still requires a base layer of geometric features so it might not be the right solution here.

This could be a good use case for global batch ids and features. #265 is possibly relevant here.

@FreakTheMighty
Copy link
Author

@lilleyse what do you mean a "base layer"? For example, in the hierarchy below, what's to prevent you from adding a wall that doesn't have any vertexes in the current b3dm?

{
  "extensions" : {
    "3DTILES_batch_table_hierarchy" : {
      "classes" : [
        {
          "name" : "Wall",
          "length" : 6,
          "instances" : {
            "color" : ["white", "red", "yellow", "gray", "brown", "black"],
          }
        },
        {
          "name" : "Building",
          "length" : 3,
          "instances" : {
            "name" : ["unit29", "unit20", "unit93"],
            "address" : ["100 Main St", "102 Main St", "104 Main St"]
          }
        },
        {
          "name" : "Owner",
          "length" : 3,
          "instances" : {
            "type" : ["city", "resident", "commercial"],
            "id" : [1120, 1250, 6445]
          }
        }
      ],
      "instancesLength" : 12,
      "classIds" : [0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2],
      "parentCounts" : [1, 3, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0],
      "parentIds" : [6, 6, 10, 11, 7, 11, 7, 8, 8, 10, 10, 9]
    }
  }
}

@lilleyse
Copy link
Contributor

classIds and parentCounts are initially indexed using the tile's batch ids and then go up the chain to grab properties from parent instances, but ultimately it's all in the service of adding more metadata to physical parts of the model. It isn't really in the spirit of the extension to have an instance that isn't referenced by a geometry feature. For example, I don't think CesiumJS lets you access instances on their own, it's always going through Cesium3DTileFeature.getProperty, which are the geometry features.

@FreakTheMighty
Copy link
Author

Got it. Would you mind sharing more of your thoughts about the global batch ID?

@lilleyse
Copy link
Contributor

@FreakTheMighty we're not quite sure what it's going to look like yet but we're considering it for 3D Tiles Next. I don't have much more details besides what's in #265.

@FreakTheMighty
Copy link
Author

@lilleyse thanks for the update. I'm leaning towards building an extension for our needs.

@lilleyse
Copy link
Contributor

Closing for now - we can revisit this in #265.

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