Можно получить координаты GPS от названия улицы, названия места или названия города? Моя проблема в том, что я знаю свой текущий GPS в Lat/Lon, но я не знаю GPS Lat/Lon названия улицы, которую я хотел пойти. Как мне использовать сервис Bing Map для этого? Ваша помощь очень ценится.Как получить координаты GPS от имени улицы, названия места или города
ответ
Добавить: - http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc
public void Obtainresult()
{
try
{
if (location == null)
return;
ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();
// Set the credentials using a valid Bing Maps key
reverseGeocodeRequest.Credentials = new GeocodeService.Credentials();
reverseGeocodeRequest.Credentials.ApplicationId = "Your Bing Map Key"
// Set the point to use to find a matching address
GeocodeService.Location point1 = new GeocodeService.Location();
point1.Latitude = location.Latitude;
point1.Longitude = location.Longitude;
reverseGeocodeRequest.Location = point1;
// Make the reverse geocode request
GeocodeServiceClient geocodeService = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService");
geocodeService.ReverseGeocodeCompleted += new EventHandler<ReverseGeocodeCompletedEventArgs>(geocodeService_ReverseGeocodeCompleted);
geocodeService.ReverseGeocodeAsync(reverseGeocodeRequest);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
void geocodeService_ReverseGeocodeCompleted(object sender, ReverseGeocodeCompletedEventArgs e)
{
try
{
// The result is a GeocodeResponse object
GeocodeResponse geocodeResponse = e.Result;
if (geocodeResponse.Results != null)
{
var yourresult = geocodeResponse.Results;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Позвольте мне знать, если у вас есть проблемы :)
ура :)
Существует образец с помощью Yahoo API здесь: http://www.devfish.net/fullblogitemview.aspx?blogid=826
Могли выглядите как то, что вы могли бы использовать.
был бы признателен, если вы сможете помочь в использовании BingMap. Мне нужно GeoCode адрес для GPS Lat/Lon. Например, с именем placename, например new york, usa. Мне нужно знать его Gps Lat/lon. Спасибо – MilkBottle
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Net;
using System.Web.UI;
namespace GoogleGeocoder
{
public interface ISpatialCoordinate
{
decimal Latitude {get; set; }
decimal Longitude {get; set; }
}
/// <summary>
/// Coordiate structure. Holds Latitude and Longitude.
/// </summary>
public struct Coordinate : ISpatialCoordinate
{
private decimal _latitude;
private decimal _longitude;
public Coordinate(decimal latitude, decimal longitude)
{
_latitude = latitude;
_longitude = longitude;
}
#region ISpatialCoordinate Members
public decimal Latitude
{
get
{
return _latitude;
}
set
{
this._latitude = value;
}
}
public decimal Longitude
{
get
{
return _longitude;
}
set
{
this._longitude = value;
}
}
#endregion
}
public class Geocode
{
private const string _googleUri = "http://maps.google.com/maps/geo?q=";
private const string _googleKey = "yourkey"; // Get your key from: http://www.google.com/apis/maps/signup.html
private const string _outputType = "csv"; // Available options: csv, xml, kml, json
private static Uri GetGeocodeUri(string address)
{
address = HttpUtility.UrlEncode(address);
return new Uri(String.Format("{0}{1}&output={2}&key={3}", _googleUri, address, _outputType, _googleKey));
}
/// <summary>
/// Gets a Coordinate from a address.
/// </summary>
/// <param name="address">An address.
/// <remarks>
/// <example>1600 Amphitheatre Parkway Mountain View, CA 94043</example>
/// </remarks>
/// </param>
/// <returns>A spatial coordinate that contains the latitude and longitude of the address.</returns>
public static Coordinate GetCoordinates(string address)
{
WebClient client = new WebClient();
Uri uri = GetGeocodeUri(address);
/* The first number is the status code,
* the second is the accuracy,
* the third is the latitude,
* the fourth one is the longitude.
*/
string[] geocodeInfo = client.DownloadString(uri).Split(',');
return new Coordinate(Convert.ToDecimal(geocodeInfo[2]), Convert.ToDecimal(geocodeInfo[3]));
}
}
}
Где бы вы могли найти значения кода состояния? – Rodney
- 1. GPS с улицы + города + страны
- 2. получить широту и долготу от имени города
- 3. Как получить GPS-координаты определенного места от ЗДЕСЬ map
- 4. Как получить страну от названия города
- 5. Локатор и долгота Android с отсутствием GPS или названия города
- 6. Адрес Информация от названия улицы
- 7. Локатор и долгота для названия места или города в .NET
- 8. Как найти длинный лат от названия города
- 9. Лучший способ поиска в MapKit для названия улицы, города ...?
- 10. Как получить координаты от GPS в Android?
- 11. Получить название города от GPS-координат
- 12. GPS-координаты от NE Координаты
- 13. Получить координаты от почтового индекса (почтовый индекс) или города/штата
- 14. Код географической координаты, чтобы получить города поблизости
- 15. Вычислить координаты ГПС сторон улицы на карте
- 16. Получить от Draggrable Маркер новой улицы и города
- 17. Создание JSON для названия места и координаты
- 18. Как получить координаты улицы от google map api?
- 19. Как получить GPS-координаты polygon
- 20. Получить название города и улицы для ссылки из PDE
- 21. Autocomplete название улицы в зависимости от текущего города
- 22. Получить широту и долготу на основе города, почтового индекса или улицы
- 23. Как получить долготу, широту от названия города Код андроида
- 24. Как получить пользовательские GPS-координаты?
- 25. Получить GPS-координаты?
- 26. Координаты/Регион от имени страны
- 27. Как получить координаты от имени местоположения
- 28. название города андроида от местоположения GPS
- 29. Получить координаты из оборудования GPS
- 30. Windows Phone 8 Получение названия города из местоположения GPS
Спасибо. Нужна ваша помощь. Как передать название улицы, например, Нью-Йорк, США и получить результат GPS в формате чисел, который мне нужно сделать для расчета расстояния? Благодарю. – MilkBottle