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

Root concat #1270

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Root concat #1270

wants to merge 9 commits into from

Conversation

azahnen
Copy link
Collaborator

@azahnen azahnen commented Sep 5, 2024

Pull request checklist

  • Added/updated unit tests
  • Updated documentation
  • All checks are passing

Changes introduced by this PR

Closes #1269.

Depends on interactive-instruments/xtraplatform-spatial#285

Todo

  • docs

Example

administrativeunit:
  type: OBJECT
  concat:
  - sourcePath: "/o73005{sortKey=sch}"
    type: OBJECT
    properties:
      id:
        sourcePath: sch
        type: STRING
        role: ID
  - sourcePath: "/o73004{sortKey=sch}"
    type: OBJECT
    properties:
      id:
        sourcePath: sch
        type: STRING
        role: ID

@azahnen
Copy link
Collaborator Author

azahnen commented Sep 5, 2024

Deployment of preview was successful: https://interactive-instruments-ldproxy-pr-1270.surge.sh

@cportele
Copy link
Member

cportele commented Sep 10, 2024

I created a new type Aeronautic in the daraa configuration as a concat of AeronauticCrv and AeronauticSrf. I then accessed various resources of the API with the following observations:

  • Accessing feature resources was successful in formats HTML, GeoJSON and JSON-FG.
  • In FlatGeobuf (and other formats that require a fixed schema), features that do not fully fit in the schema of the first option result in errors. My guess is that these encodings must be disabled for collections that use a root concat type (unless the options have exactly the same schema).
  • The schema resource of the collection only represents the first option.
  • The list of queryables for the collection was empty although three queryables were defined in the service configuration.
  • Using such a type in a tile provider failed with the following error when accessing a tile: "Filter is invalid. Unknown property: 0_geometry."
  • The schema in the tileset metadata only represents the first option.

If there is a constraint that all concat options must always have exactly the same schema, some of these issues are no longer an issue, but in that case, this probably should be checked.

@azahnen azahnen marked this pull request as ready for review October 2, 2024 08:35
@azahnen azahnen requested a review from cportele as a code owner October 2, 2024 08:35
@azahnen
Copy link
Collaborator Author

azahnen commented Oct 2, 2024

@cportele
The issues should be fixed.
For feature formats I introduced supportsRootConcat, which is currently only set to true for JSON-based formats and HTML. It would most likely be enough to use the union of all properties for the other formats, but for now they are disabled with a warning.

@cportele
Copy link
Member

cportele commented Oct 2, 2024

@azahnen
There is still at least one issue with tiles. The tileset metadata states that all geometries are lines. This is incorrect as some features have polygons. This has the side-effect that the default wireframe style only shows the line string features, the polygon features are not rendered.

The cause is that geometry type / dimension is determined from the first primary geometry property. This was correct when there could only be one, but with concat there can now be multiple.

It is easy to fix in this case, but we probably need to review all cases where a similar schema constraint is assumed, which no longer applies. Should I work on this?

@azahnen
Copy link
Collaborator Author

azahnen commented Oct 2, 2024

@cportele
Maybe it would make sense to adjust the MappingOperationResolver so that the types of the primary geometries are already aligned when used by any downstream cases?
If all primary geometries have the same type, nothing would be changed, otherwise all geometries would get the type ANY.

@cportele
Copy link
Member

cportele commented Oct 2, 2024

@azahnen
We would loose information that might be relevant in other places (e.g., the returnables schema). And it is not only the geometry type of the primary geometry, similar issues may surface with other aspects, too (e.g., primary temporal information, id properties, etc.).

As long as the feature schema in the root concat case is an any-of of the concatenated parts, we can no longer assume that at most a single property has a certain characteristic.

@azahnen
Copy link
Collaborator Author

azahnen commented Oct 2, 2024

@cportele
True. I think then it is best if you work on this.

@cportele
Copy link
Member

cportele commented Oct 2, 2024

@azahnen
OK, will do.

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.

support concat on root level
2 participants