getPositionEstimate method

Future<GetPositionEstimateResponse> getPositionEstimate({
  1. AdvancedConfiguration? advancedConfiguration,
  2. CellTowers? cellTowers,
  3. Gnss? gnss,
  4. Ip? ip,
  5. DateTime? timestamp,
  6. List<WiFiAccessPoint>? wiFiAccessPoints,
})

Get estimated position information as a payload in GeoJSON format. The payload measurement data is resolved using solvers that are provided by third-party vendors.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter advancedConfiguration : Optional configuration to customize position estimates. If not provided, defaults are applied.

Parameter cellTowers : Retrieves an estimated device position by resolving measurement data from cellular radio towers. The position is resolved using HERE's cellular-based solver.

Parameter gnss : Retrieves an estimated device position by resolving the global navigation satellite system (GNSS) scan data. The position is resolved using the GNSS solver powered by LoRa Cloud.

Parameter ip : Retrieves an estimated device position by resolving the IP address information from the device. The position is resolved using MaxMind's IP-based solver.

Parameter timestamp : Optional information that specifies the time when the position information will be resolved. It uses the Unix timestamp format. If not specified, the time at which the request was received will be used.

Parameter wiFiAccessPoints : Retrieves an estimated device position by resolving WLAN measurement data. The position is resolved using HERE's Wi-Fi based solver.

Implementation

Future<GetPositionEstimateResponse> getPositionEstimate({
  AdvancedConfiguration? advancedConfiguration,
  CellTowers? cellTowers,
  Gnss? gnss,
  Ip? ip,
  DateTime? timestamp,
  List<WiFiAccessPoint>? wiFiAccessPoints,
}) async {
  final $payload = <String, dynamic>{
    if (advancedConfiguration != null)
      'AdvancedConfiguration': advancedConfiguration,
    if (cellTowers != null) 'CellTowers': cellTowers,
    if (gnss != null) 'Gnss': gnss,
    if (ip != null) 'Ip': ip,
    if (timestamp != null) 'Timestamp': unixTimestampToJson(timestamp),
    if (wiFiAccessPoints != null) 'WiFiAccessPoints': wiFiAccessPoints,
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'POST',
    requestUri: '/position-estimate',
    exceptionFnMap: _exceptionFns,
  );
  return GetPositionEstimateResponse(
    geoJsonPayload: await response.stream.toBytes(),
  );
}