Ejemplo n.º 1
0
        /// <summary>
        /// Method used to reverse geo-code a single lat-long string in deciaml degress format i.e. "48.434325, -76.434543"
        /// </summary>
        /// <param name="latLong">Our point to reverse geo-code.  String in deciaml degress format i.e. "48.434325, -76.434543"</param>
        /// <param name="fieldSettings">Our field settings object used to determine which additional data fields we want to query.</param>
        /// <returns>The results from Geocodio.</returns>
        public async Task <BatchReverseGeoCodingResult> ReverseGeocodeAsync(string latLong, GeocodioDataFieldSettings fieldSettings)
        {
            string fieldQueryString = this.PrepareDataFieldsQueryString(fieldSettings);

            string json = await SingleReverseGeocodeWebRequest(latLong, fieldQueryString);

            ReverseGeoCodeResult result = JsonConvert.DeserializeObject <ReverseGeoCodeResult>(json);

            BatchReverseGeoCodeResponse response = new BatchReverseGeoCodeResponse(latLong, result);

            return(new BatchReverseGeoCodingResult(new BatchReverseGeoCodeResponse[] { response }));
        }
 public BatchReverseGeoCodeResponse(string query, ReverseGeoCodeResult response)
 {
     Query    = query;
     Response = response;
 }