Cesium for Unity 1.23.0
Loading...
Searching...
No Matches
CesiumForUnity.CesiumGeoJsonFeature Class Reference

Represents a Feature in a GeoJSON document. More...

Public Member Functions

partial CesiumGeoJsonFeatureIdType GetIdType ()
 Gets the type of ID on this feature.
 
partial string GetIdAsString ()
 Gets the feature ID as a string.
 
partial long GetIdAsInteger ()
 Gets the feature ID as an integer.
 
partial string GetPropertiesAsJson ()
 Gets the properties of this feature as a JSON string.
 
partial string GetStringProperty (string propertyName)
 Gets a string property value from this feature.
 
partial double GetNumericProperty (string propertyName)
 Gets a numeric property value from this feature.
 
partial bool HasProperty (string propertyName)
 Checks whether a property exists on this feature.
 
partial CesiumGeoJsonObject GetGeometry ()
 Gets the geometry associated with this feature.
 

Detailed Description

Represents a Feature in a GeoJSON document.

A GeoJSON Feature has an optional ID, a set of properties, and an associated geometry. Use CesiumGeoJsonObject.GetObjectAsFeature or CesiumGeoJsonObject.GetObjectAsFeatureCollection to obtain instances of this class.

Definition at line 18 of file CesiumGeoJsonFeature.cs.

Member Function Documentation

◆ GetGeometry()

partial CesiumGeoJsonObject CesiumForUnity.CesiumGeoJsonFeature.GetGeometry ( )

Gets the geometry associated with this feature.

Returns
The geometry as a CesiumGeoJsonObject, or null if this feature has no geometry.

◆ GetIdAsInteger()

partial long CesiumForUnity.CesiumGeoJsonFeature.GetIdAsInteger ( )

Gets the feature ID as an integer.

Returns
The feature ID as a long, or -1 if the feature has no ID or the ID is not an integer.

◆ GetIdAsString()

partial string CesiumForUnity.CesiumGeoJsonFeature.GetIdAsString ( )

Gets the feature ID as a string.

Returns
The feature ID as a string, or an empty string if the feature has no ID. If the ID is an integer, it will be converted to a string.

◆ GetIdType()

partial CesiumGeoJsonFeatureIdType CesiumForUnity.CesiumGeoJsonFeature.GetIdType ( )

Gets the type of ID on this feature.

Returns
The ID type: None, Integer, or String.

◆ GetNumericProperty()

partial double CesiumForUnity.CesiumGeoJsonFeature.GetNumericProperty ( string propertyName)

Gets a numeric property value from this feature.

Parameters
propertyNameThe name of the property.
Returns
The property value as a double, or 0 if not found or not a numeric type.

◆ GetPropertiesAsJson()

partial string CesiumForUnity.CesiumGeoJsonFeature.GetPropertiesAsJson ( )

Gets the properties of this feature as a JSON string.

Returns
A JSON string containing the properties, or "{}" if the feature has no properties.

◆ GetStringProperty()

partial string CesiumForUnity.CesiumGeoJsonFeature.GetStringProperty ( string propertyName)

Gets a string property value from this feature.

Parameters
propertyNameThe name of the property.
Returns
The property value as a string, or an empty string if not found or not a string type.

◆ HasProperty()

partial bool CesiumForUnity.CesiumGeoJsonFeature.HasProperty ( string propertyName)

Checks whether a property exists on this feature.

Parameters
propertyNameThe name of the property.
Returns
True if the property exists; false otherwise.

The documentation for this class was generated from the following file: