Draft: Resolve "Feature request: draped feature collection"
Draped features on terrain
Summary
This MR introduces the DrapedFeatureCollection entity, as well a a new data source: FeatureSource.
The objective is to circumvent limitations in the FeatureCollection entity:
- the 2D tiling scheme does not work well in a truly 3D environment (with terrain),
- out of the box draping features on terrain
- working directly with OpenLayers
VectorSourceis very limited as we cannot optimize data loading for our needs
How it works
DrapedFeatureCollection listens to tile creation/deletion events from its attached Map. Whenever a tile is created, and if its LOD is greater or equal to the minLod property, we ask the FeatureSource to load features that overlap the tile's extent. Features are deduplicated at the entity level (provided they have a unique ID), so that we don't have to care about duplicated features coming from the FeatureSource.
When a Map tile is deleted, we delete all features that do not overlap with at least one map tile.
This way, features are not associated with map tiles at all.
FeatureSource
This source loads OpenLayers Features from a given source:
-
FileFeatureSourceloads feature from a single remote file (in any format supported by OpenLayers) -
StreamableFeatureSourceloads features in a streamable way (such as OGC API Features), in any format supported by OpenLayers -
StaticFeatureSourceis a simple feature container that can be changed by the user, without loading anything from a source. -
AggregateFeatureSourceallows combining several feature sources into one (much like theAggregatePointCloudSourcefor point cloud data andAggregateImageSourcefor image data, see !836 (merged))
TODO
-
Feature sources -
Refactor common code -
Implement updateevent to signal that the content of the source has changed and must be reloaded -
FeatureSource/FeatureSourceBase-
Add unit tests -
Add documentation -
API re-exports
-
-
StaticFeatureSource-
Add unit tests -
Add documentation -
API re-exports
-
-
FileFeatureSource-
Add unit tests -
Add documentation -
API re-exports
-
-
AggregateFeatureSource-
Add unit tests -
Add documentation -
API re-exports
-
-
StreamableFeatureSource-
Add unit tests -
Add documentation -
API re-exports
-
-
-
DrapedFeatureCollection-
Add unit tests -
Add documentation -
API re-exports -
Implement picking -
Implement dynamic updates of styles (see FeatureCollection.updateStyle())
-
-
FeatureCollection-
Remove entity ? (We would like to avoid having to maintain the two entities) -
How to handle loading 3D vectors that are not really draped on a map ? (see the undraped_vectorsexample)
-
-
Testing and examples -
migrate the ign_datato the new entity -
migrate the undraped_vectorsexample to the new entity ? -
migrate the geojson_3dexample to the new entity ? -
migrate the wfs_meshexample to the new entity -
Create an example with draped points -
Create an example with draped polygons (not extruded polygons)
-
Note
A single example can combine several use cases, but we have to be careful not to have too complicated examples
Closes #624