Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
GeoSpatialObject.cs
1using System;
2using System.Threading.Tasks;
3
4namespace Waher.Runtime.Geo
5{
11 {
17 : this(Guid.NewGuid().ToString(), null, true)
18 {
19 }
20
27 : this(Guid.NewGuid().ToString(), Location, true)
28 {
29 }
30
36 public GeoSpatialObject(string GeoId)
37 : this(GeoId, null, true)
38 {
39 }
40
48 : this(GeoId, Location, true)
49 {
50 }
51
60 public GeoSpatialObject(string Location, bool Ephemeral)
61 : this(Location, GeoPosition.Parse(Location), Ephemeral)
62 {
63 }
64
72 public GeoSpatialObject(string GeoId, GeoPosition Location, bool Ephemeral)
73 {
74 this.GeoId = GeoId;
75 this.Location = Location;
76 this.EphemeralLocation = Ephemeral;
77 }
78
82 public GeoPosition Location { get; set; }
83
87 public bool HasGeoLocation => !(this.Location is null);
88
92 public string GeoId { get; }
93
98 public virtual Task<GeoPosition> GetLocation() => Task.FromResult(this.Location);
99
103 public bool EphemeralLocation { get; }
104
110 public static implicit operator GeoSpatialObjectReference(GeoSpatialObject Object)
111 {
112 if (Object is null)
113 return null;
114 else
115 return new GeoSpatialObjectReference(Object);
116 }
117 }
118}
Contains information about a position in a geo-spatial coordinate system.
Definition: GeoPosition.cs:17
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
GeoSpatialObject(string Location, bool Ephemeral)
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
GeoSpatialObject()
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
GeoSpatialObject(string GeoId, GeoPosition Location, bool Ephemeral)
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
GeoSpatialObject(string GeoId, GeoPosition Location)
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
GeoSpatialObject(string GeoId)
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.
GeoSpatialObject(GeoPosition Location)
A base class for geo-spatial objects, implementing the basic members of the IGeoSpatialObject interfa...
virtual Task< GeoPosition > GetLocation()
Gets the geo-spatial location of the object.
bool HasGeoLocation
If the object has a geo-spatial location.
A base class for geo-spatial object references, implementing the basic members of the IGeoSpatialObje...
Interface for objects with a geo-spatial location