LuciadCPillar C# 2026.1.02
Loading...
Searching...
No Matches
Luciad.Models.Features.FeatureModelBuilder Class Referencesealed

Helps create an IFeatureModel given a list of features, model metadata, feature model metadata, and optionally bounds. More...

Inheritance diagram for Luciad.Models.Features.FeatureModelBuilder:

Public Member Functions

 FeatureModelBuilder (Luciad.Models.Features.FeatureModelBuilder other)
 Copy constructor.
Luciad.Models.Features.FeatureModelBuilder Bounds (Luciad.Geometries.Bounds bounds)
 Sets the bounds of the feature model.
Luciad.Models.Features.IFeatureModel Build ()
 Creates a new in-memory IFeatureModel instance, based on the given model metadata, feature model metadata and the list of features.
Luciad.Models.Features.FeatureModelBuilder DataModel (Luciad.Datamodels.DataModel dataModel)
 Sets the data model that describes the features.
void Dispose ()
Luciad.Models.Features.FeatureModelBuilder Editable (bool editable)
 Sets whether the model allows editing or not.
Luciad.Models.Features.FeatureModelBuilder FeatureModelMetadata (Luciad.Models.Features.FeatureModelMetadata featureModelMetadata)
 Sets the FeatureModelMetadata of the feature model.
Luciad.Models.Features.FeatureModelBuilder Features (System.Collections.Generic.IList< Luciad.Models.Features.Feature > features)
 Sets the features of the feature model.
Luciad.Models.Features.FeatureModelBuilder ModelMetadata (Luciad.Models.ModelMetadata modelMetadata)
 Sets the ModelMetadata of the feature model.
Luciad.Models.Features.FeatureModelBuilder Reference (Luciad.Geodesy.CoordinateReference reference)
 Sets the preferred reference of the feature model.
Luciad.Models.Features.FeatureModelBuilder SpatialIndex (bool spatialIndex)
 Sets whether the model spatially indexes its features or not.
Luciad.Models.Features.FeatureModelBuilder Title (string title)
 Sets the title of the feature model.

Static Public Member Functions

static Luciad.Models.Features.FeatureModelBuilder NewBuilder ()
 Returns the builder class for the creation of the IFeatureModel.

Detailed Description

Helps create an IFeatureModel given a list of features, model metadata, feature model metadata, and optionally bounds.

Constructor & Destructor Documentation

◆ FeatureModelBuilder()

Luciad.Models.Features.FeatureModelBuilder.FeatureModelBuilder ( Luciad.Models.Features.FeatureModelBuilder other)
inline

Copy constructor.

Parameters
otherthe builder to copy.

Member Function Documentation

◆ Bounds()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.Bounds ( Luciad.Geometries.Bounds bounds)
inline

Sets the bounds of the feature model.

Calling this function is optional.

If no bounds are provided, the model will attempt to derive the bounds by itself. It does so by calculating the union of the geometries of its features, as specified by Feature#findGeometry.

Parameters
boundsThe model bounds. Cannot be null.
Returns
this
Exceptions
System.ArgumentNullExceptionwhen passing null.

◆ Build()

Luciad.Models.Features.IFeatureModel Luciad.Models.Features.FeatureModelBuilder.Build ( )
inline

Creates a new in-memory IFeatureModel instance, based on the given model metadata, feature model metadata and the list of features.

Depending on the setting of the Editable flag, it is possible to add,remove, or update the features of this model after it has been created.

The metadata can be supplied in two ways. Either pass the metadata objects themselves with modelMetadata() and featureModelMetadata(), or use the title(), reference() and dataModel() shortcuts and let this function assemble the metadata. The two ways cannot be mixed.

Returns
An in-memory IFeatureModel instance.
Exceptions
System.InvalidOperationExceptionIf the metadata is supplied in both ways at once, or if there is not enough information to assemble it. Without featureModelMetadata(), either dataModel() or at least one feature is required, so that the data model can be determined.

◆ DataModel()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.DataModel ( Luciad.Datamodels.DataModel dataModel)
inline

Sets the data model that describes the features.

Calling this function is optional.

This is a shortcut that makes this builder assemble the FeatureModelMetadata, so featureModelMetadata() does not have to be called. It is an alternative to featureModelMetadata(), not an addition: neither wins when both are set, build() throws a System.InvalidOperationException instead.

Without this call the data model is derived from the DataType of the features passed to features(), and is named after the model's title. Set it explicitly for a model that starts out without features, or to control the data model's name.

Parameters
dataModelthe data model that describes the features.
Returns
this
Since
2026.1

◆ Dispose()

void Luciad.Models.Features.FeatureModelBuilder.Dispose ( )
inline

◆ Editable()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.Editable ( bool editable)
inline

Sets whether the model allows editing or not.

An editable model exposes an IFeatureModelUpdater, through which you can add, remove, or update the model's features. Calling this function is optional. By default, this value is false.

Parameters
editablewhether the model allows editing or not.
Returns
this
Since
2020.1

◆ FeatureModelMetadata()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.FeatureModelMetadata ( Luciad.Models.Features.FeatureModelMetadata featureModelMetadata)
inline

Sets the FeatureModelMetadata of the feature model.

Calling this function is optional: reference() and dataModel() are shortcuts that make this builder assemble the FeatureModelMetadata instead. Use this function for metadata that the shortcut cannot express, such as a model of which the feature types are a subset of the data model's types.

Parameters
featureModelMetadataThe model feature model metadata.
Returns
this

◆ Features()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.Features ( System.Collections.Generic.IList< Luciad.Models.Features.Feature > features)
inline

Sets the features of the feature model.

Calling this function is optional.

The given features may or may not have an ID assigned. If the ID is missing, an ID will be assigned to the feature by the resulting model.

When more than one feature has the same ID, the model keeps the first one.

Parameters
featuresThe model features.
Returns
this

◆ ModelMetadata()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.ModelMetadata ( Luciad.Models.ModelMetadata modelMetadata)
inline

Sets the ModelMetadata of the feature model.

Calling this function is optional: title() is a shortcut that makes this builder assemble the ModelMetadata instead.

Parameters
modelMetadataThe model metadata.
Returns
this

◆ NewBuilder()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.NewBuilder ( )
inlinestatic

Returns the builder class for the creation of the IFeatureModel.

Returns
the builder class for the creation of the IFeatureModel.

◆ Reference()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.Reference ( Luciad.Geodesy.CoordinateReference reference)
inline

Sets the preferred reference of the feature model.

Calling this function is optional.

This is a shortcut that makes this builder assemble the FeatureModelMetadata, so featureModelMetadata() does not have to be called. It is an alternative to featureModelMetadata(), not an addition: neither one wins when both are set, build() throws a System.InvalidOperationException instead.

Parameters
referencethe preferred reference of the feature model. Cannot be null.
Returns
this
Exceptions
System.ArgumentNullExceptionwhen passing null.
Since
2026.1

◆ SpatialIndex()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.SpatialIndex ( bool spatialIndex)
inline

Sets whether the model spatially indexes its features or not.

Enabling this flag can improve performance when you are querying a specific area, or when you are using this model in a FeatureLayer with the spatial loading strategy. Spatial indexing may also cause a small performance penalty for feature additions, updates, and removals.

Calling this function is optional. By default, this value is false.

Parameters
spatialIndexwhether the model spatially indexes its features or not.
Returns
this
Since
2025.0.04

◆ Title()

Luciad.Models.Features.FeatureModelBuilder Luciad.Models.Features.FeatureModelBuilder.Title ( string title)
inline

Sets the title of the feature model.

Calling this function is optional.

This is a shortcut that makes this builder assemble the ModelMetadata, with the title as its only content, so modelMetadata() does not have to be called. It is an alternative to modelMetadata(), not an addition: neither wins when both are set, build() throws a System.InvalidOperationException instead.

When neither this function nor modelMetadata() is called, the model gets the title &quot;Feature model&quot;, so that it is never nameless.

Parameters
titlethe title of the feature model.
Returns
this
Since
2026.1