Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
GeoSpatialObjectReference.cs
1using System.Threading.Tasks;
2
3namespace Waher.Runtime.Geo
4{
10 {
16 {
17 }
18
25 {
26 this.GeoId = Object.GeoId;
27 this.Location = Object.Location;
28 this.EphemeralLocation = Object.EphemeralLocation;
29 }
30
36 public static async Task<GeoSpatialObjectReference> Create(IGeoSpatialObject Object)
37 {
38 return new GeoSpatialObjectReference()
39 {
40 GeoId = Object.GeoId,
42 Location = await Object.GetLocation()
43 };
44 }
45
49 public string GeoId { get; set; }
50
55 public GeoPosition Location { get; set; }
56
60 public bool EphemeralLocation { get; set; }
61
63 public override bool Equals(object obj)
64 {
65 if (!(obj is GeoSpatialObjectReference Reference))
66 return false;
67
68 return
69 this.GeoId.Equals(Reference.GeoId) &&
70 this.EphemeralLocation.Equals(Reference.EphemeralLocation) &&
71 (this.Location?.Equals(Reference.Location) ?? (Reference.Location is null));
72 }
73
75 public override int GetHashCode()
76 {
77 int Result = this.GeoId.GetHashCode();
78 Result ^= Result << 5 ^ this.EphemeralLocation.GetHashCode();
79 Result ^= Result << 5 ^ (this.Location?.GetHashCode() ?? 0);
80
81 return Result;
82 }
83 }
84}
Contains information about a position in a geo-spatial coordinate system.
Definition: GeoPosition.cs:17
override bool Equals(object obj)
Definition: GeoPosition.cs:475
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
string GeoId
The ID of the geo-spatial object.
GeoPosition Location
Location of object.
bool EphemeralLocation
If the location of the geo-spatial object is ephemeral.
A base class for geo-spatial object references, implementing the basic members of the IGeoSpatialObje...
GeoSpatialObjectReference(GeoSpatialObject Object)
A base class for geo-spatial object references, implementing the basic members of the IGeoSpatialObje...
string GeoId
The ID of the geo-spatial object.
GeoPosition Location
Gets the geo-spatial location of the object.
bool EphemeralLocation
If the location of the geo-spatial object is ephemeral.
GeoSpatialObjectReference()
A base class for geo-spatial object references, implementing the basic members of the IGeoSpatialObje...
static async Task< GeoSpatialObjectReference > Create(IGeoSpatialObject Object)
Create a geo-spatial object reference from a geo-spatial object.
Interface for objects with a geo-spatial location
bool EphemeralLocation
If the location of the geo-spatial object is ephemeral.
Task< GeoPosition > GetLocation()
Gets the geo-spatial location of the object.
string GeoId
The ID of the geo-spatial object.
Reference to an object with a geo-spatial location