You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the mapget-model library is now ready to be used, we can write basic implementations of FeatureLayerStyle and FeatureLayerRenderer classes.
FeatureLayerStyle should use yaml-cpp to parse some style file content. The file should be fetched by JS, and the contents should then be passed into the FeatureLayerStyle constructor. Inside, the initial implementation shall support the following YAML style rule fields:
rules:
- type: [<string>] # (Mandatory, list of feature-type-names)filter: string # (Optional, Additional simfil filter expression)color: string # (Optional [r:float,g:float,b:float] list or color name. Can adopt impl. from AfwColor)geometry: ["line", "point", "mesh"] # (Mandatory, describes which geometry to take from a matching feature)opacity: float # (Optional, defaults to 1.0)
The FeatureLayerStyle class should have a rules(): vector<FeatureStyleRule> const& function, which returns the style-sheet's rules. A rule could then have a match(mapget::Feature const&): bool function, and accessors for color(): Color, opacity(): float, geometryTypes(): GeometryTypeBitmask.
To convert a feature to GLTF, the FeatureLayerRenderer::render-function takes a FeatureLayerStyle const& and a mapget::TileFeatureLayerPtr argument. All features in the layer are aggregated into a single GLB scene. To facilitate the conversion, render tries to match every feature to every rule. For a successful rule-feature match, the renderer should make sure of three things for every geometry type supported by the rule:
A material must already exist or be created for each geometry-type supported by the rule.
A mesh must already exist or be created for each geometry-type supported by the rule.
The feature's vertices for each geometry-type supported by the rule must be added to the mesh.
The mesh should be positioned around the TileFeatureLayer's center, so coordinates in each mesh can be offset to preserve precision. The WGS84 geometry will be converted to euclidian space with a earth surface radius of 6371 km. For 3d vector/matrix math, the glm library shall be used. To emit the GLB data structure, the tinygltf library shall be used.
For initial visualisation, we call FeatureLayerRenderer::render on startup with a fixed style and an on-the-fly-generated TileFeatureLayer. We can simply point the camera at a specific point on the earth's surface where we render the static dummy TileFeatureLayer.
The text was updated successfully, but these errors were encountered:
josephbirkner
changed the title
Basic rendering of a static TileFeatureLayer in FeatureLayerRenderer
Basic FeatureLayerStyle and FeatureLayerRenderer
May 23, 2023
As the
mapget-model
library is now ready to be used, we can write basic implementations ofFeatureLayerStyle
andFeatureLayerRenderer
classes.FeatureLayerStyle
should use yaml-cpp to parse some style file content. The file should be fetched by JS, and the contents should then be passed into the FeatureLayerStyle constructor. Inside, the initial implementation shall support the following YAML style rule fields:The
FeatureLayerStyle
class should have arules(): vector<FeatureStyleRule> const&
function, which returns the style-sheet's rules. A rule could then have amatch(mapget::Feature const&): bool
function, and accessors forcolor(): Color
,opacity(): float
,geometryTypes(): GeometryTypeBitmask
.To convert a feature to GLTF, the
FeatureLayerRenderer::render
-function takes aFeatureLayerStyle const&
and amapget::TileFeatureLayerPtr
argument. All features in the layer are aggregated into a single GLB scene. To facilitate the conversion,render
tries to match every feature to every rule. For a successful rule-feature match, the renderer should make sure of three things for every geometry type supported by the rule:geometry-type
supported by the rule.geometry-type
supported by the rule.geometry-type
supported by the rule must be added to the mesh.The mesh should be positioned around the TileFeatureLayer's center, so coordinates in each mesh can be offset to preserve precision. The WGS84 geometry will be converted to euclidian space with a earth surface radius of
6371 km
. For 3d vector/matrix math, the glm library shall be used. To emit the GLB data structure, the tinygltf library shall be used.For initial visualisation, we call
FeatureLayerRenderer::render
on startup with a fixed style and an on-the-fly-generated TileFeatureLayer. We can simply point the camera at a specific point on the earth's surface where we render the static dummy TileFeatureLayer.The text was updated successfully, but these errors were encountered: