Ejemplo n.º 1
0
 public async Task <Measurement> GetMeasurmentByLocationIdAsync(int locationId, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     ParamsValidator.ThrowIfNegativeNumber(locationId);
     return(await Api.Request <Measurement>(end : "measurements/location", "GET", new
     {
         locationId,
         includeWind,
         type = ResolveIndexType(type)
     }));
 }
Ejemplo n.º 2
0
 public async Task <Measurement> GetMeasurmentNearestAsync(double lat, double lng, double maxDistance = 3, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     return(await Api.Request <Measurement>("measurements/nearest", "GET", new
     {
         lat,
         lng,
         maxDistanceKM = ParamsValidator.InfinityToDouble(maxDistance),
         indexType = ResolveIndexType(type)
     }));
 }
Ejemplo n.º 3
0
 public async Task <Measurement> GetMeasurmentByPointAsync(double lat, double lng, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     return(await Api.Request <Measurement>("measurements/point", "GET", new
     {
         lat,
         lng,
         indexType = ResolveIndexType(type)
     }));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Getting the measurment by the location id from installation. Remember that the location id is nullable property
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Location(Installation installation, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) =>
 installation == null || installation.LocationId == null
         ? null
         : await Location((int)installation.LocationId, includeWind, type);
Ejemplo n.º 5
0
 public async Task <Measurement> GetMeasurmentByInstallationAsync(int id, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI)
 {
     ParamsValidator.ThrowIfNegativeNumber(id);
     return(await Api.Request <Measurement>("measurements/installation", "GET", new
     {
         installationId = id,
         includeWind,
         indexType = ResolveIndexType(type)
     }));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Getting the installation pinned measurment.
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Installation(Installation installation, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) => installation != null ? await Installation(installation.Id, includeWind, type) : null;
Ejemplo n.º 7
0
 /// <summary>
 /// Use this to get the measurment's by the locationId.
 /// </summary>
 /// <param name="locationId">Location ID</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Location(int locationId, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentByLocationIdAsync(locationId, includeWind, type);
Ejemplo n.º 8
0
 private async Task <Measurement> Point(double lat, double lng, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentByPointAsync(lat, lng, type);
Ejemplo n.º 9
0
 /// <summary>
 /// Use this when you need to get the informations about installation by ID
 /// </summary>
 /// <param name="id">ID of installation</param>
 /// <param name="includeWind">Check this if you want to include the wind measurments</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Installation(int id, bool includeWind = false, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentByInstallationAsync(id, includeWind, type);
Ejemplo n.º 10
0
 /// <summary>
 /// Getting the Point() but of the geografic Location.
 /// </summary>
 /// <param name="location">Location object</param>
 /// <param name="type">Index of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Point(Location location, IndexQueryType type       = IndexQueryType.AirlyCAQI) => await Point(location.Lat, location.Lng, type);
Ejemplo n.º 11
0
 /// <summary>
 /// Use Point when you need to get the measurment from the point. Else use Nearest to get the measurment nearest the point.
 /// If no measurment found, this endpoint will return null
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="type">Type of the measurment Index</param>
 /// <returns>Single measurment</returns>
 public async Task <Measurement> Point(Installation installation, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Point(installation.Location, type);
Ejemplo n.º 12
0
 private async Task <Measurement> Nearest(double lat, double lng, double maxDistance = 3, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Api.GetMeasurmentNearestAsync(lat, lng, maxDistance, type);
Ejemplo n.º 13
0
 /// <summary>
 /// Getting the nearest measurment's of the specified location.
 /// </summary>
 /// <param name="location">Location object</param>
 /// <param name="maxDistance">Max distance, deafult to 3, double</param>
 /// <param name="type">Type of the measurment index</param>
 /// <returns></returns>
 public async Task <Measurement> Nearest(Location location, double maxDistance       = 3, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Nearest(location.Lat, location.Lng, maxDistance, type);
Ejemplo n.º 14
0
 /// <summary>
 /// Getting the nearest measurment's of the installation location.
 /// </summary>
 /// <param name="installation">Installation object</param>
 /// <param name="maxDistance">Max distance, deafult to 3, double</param>
 /// <param name="type">Type of the measurment index</param>
 /// <returns></returns>
 public async Task <Measurement> Nearest(Installation installation, double maxDistance = 3, IndexQueryType type = IndexQueryType.AirlyCAQI) => await Nearest(installation.Location, maxDistance, type);