public LocationInfoResponse GetLocationInfo( LocationInfoRequest request )
Public Function GetLocationInfo ( request As LocationInfoRequest ) As LocationInfoResponse
|LocationException||The request failed because of problems relating to the specified Location.|
|ServiceException||The request failed because of a problem with the API service (sorry!).|
|RateLimitException||You hit the RateLimit for your account's plan, and need to wait a little while before it's reset.|
|InvalidRequestException||The request that is sent to the API servers is invalid (e.g. if it is authenticated with invalid API access keys).|
|TransportException||A problem sending the request to the API servers, or a problem getting the API's response back.|
|DegreeDaysApiException||The superclass of all the exceptions listed above.|
|ArgumentNullException||request is null.|
This can be useful if you have a database of data stored by station ID, but are using geographic locations (postal/zip codes or longitude/latitude positions) to determine which station ID to use for each of your real-world locations. A LocationInfoRequest only requires one request unit, whilst a large LocationDataRequest requires considerably more, so it often makes sense to use this to avoid the overhead of re-fetching data that you already have stored. We call this "two-stage data fetching", and you can read more about it in the remarks for the GeographicLocation class.
Note, however, that this returns nothing that isn't also returned by a call to GetLocationData(LocationDataRequest). So, if you know you'll be fetching data anyway, you might as well use GetLocationData(LocationDataRequest) from the start.
Exceptions and data availability:
The exceptions thrown by this method are the same as those thrown by GetLocationData(LocationDataRequest), and they are thrown under exactly the same circumstances.
However, because this doesn't return any data (i.e. no DataSets), there's no way to tell from this whether an equivalent LocationDataResponse would actually contain any or all of the data you want. So, although you can use this to determine what station ID the API would use for an equivalent call to GetLocationData(LocationDataRequest), you would have to actually make that call to be sure that you could get all the data you wanted.