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

Clarify details about featureCount and nullFeatureId #756

Open
javagl opened this issue Jan 16, 2024 · 4 comments
Open

Clarify details about featureCount and nullFeatureId #756

javagl opened this issue Jan 16, 2024 · 4 comments

Comments

@javagl
Copy link
Contributor

javagl commented Jan 16, 2024

This refers to the EXT_mesh_features extension:

The specification currently says

The definition of the feature ID set may include a nullFeatureId, which is a value that indicates that a certain part is not considered to be an identifiable object. The definition also includes a featureCount value, which is the number of unique features that are identified.

This actually caused some confusion for me (while implementing the validation of the extensions), and came up again recently in CesiumGS/3d-tiles-validator#294 (comment)

We could clarify this, maybe only as an "Implementation Note" with examples, to emphasize...

  • The featureCount does not say how many features are present in the specific instance of the extension (on a specific mesh primitive). It says how many features there are as a whole. So there may be an instance of the extension on a specific mesh primitive, and this may have the feature ID values [12, 34, 56], and the featureCount may still be 10 or so.
  • The nullFeatureId does not contribute to the featureCount. So there may be feature ID values like [12, 34, 56, 9999], and the featureCount may still be 3, namely when one of these values (like the 9999) is the nullFeatureId
@bertt
Copy link

bertt commented Jan 16, 2024

Is the FeatureCount used in CesiumJS (or another client)? Didn't have the impression it is. If not used, maybe it's an option to deprecate it?

@javagl
Copy link
Contributor Author

javagl commented Jan 16, 2024

From a quick full-text search, it does not seem to be used (it is read and stored in some property, but I don't see where it is actually used). Some questions about the featureCount had already been raised in #624 , and that (and the linked issues) contain some justifications, but I couldn't immediately "map" this to the CesiumJS code right now.

So this issue may indeed be a clarification that goes beyond what it means - it may raise the question of whether it is required (or still required in CesiumJS), or whether it should or could be deprecated.

@lilleyse
Copy link
Contributor

featureCount would be relevant to CesiumJS as part of fixing CesiumGS/cesium#9884 to know how many Cesium3DTileFeature objects to allocate.

@javagl
Copy link
Contributor Author

javagl commented Feb 27, 2024

I had a short look at the relevant parts of the codes - yes, a bit naive, by just doing a GitHub search for featureCount in the whole CesiumGS organization and browsing through some parts of the respective (code) search results.

It looks like the featureCount is rarely used. It is read, maintained, forwarded, updated, but cannot point my finger at a place where it is actually, technically, and strictly required. It's hard to be sure here, because ... it's a pretty generic term, there are some parts of the code where a "translation" from legacy versions of the extensions is going on, and it might be that the featureCount is assigned from some count value of a legacy extension, or vice versa.

A few places caught my attention:

If the goal was to remove the featureCount from the specification, then these parts may have to be investigated in more detail. But it looks like for the case of feature ID textures, the featureCount actually is required for some implementations.

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