Database 使用什么样的DB Foursquare?
正在使用什么样的db foursquare?Database 使用什么样的DB Foursquare?,database,google-maps,maps,foursquare,Database,Google Maps,Maps,Foursquare,正在使用什么样的db foursquare? 我不是说:MySQL、Oracle或其他什么,我是说: 他们从哪里获得场地? 从谷歌地图上看?据我所知,4SQ正在使用和 我不知道你们在技术上使用了什么,但我已经编写了一个非常可爱的“lat/lon”定位器,可以与谷歌地图和必应地图一起使用。它位于VB.NET中,并以JSON格式输出纬度和经度 Imports System.Runtime.Serialization Imports System.Web Imports System.Net Impo
我不是说:MySQL、Oracle或其他什么,我是说:
他们从哪里获得场地?
从谷歌地图上看?据我所知,4SQ正在使用和 我不知道你们在技术上使用了什么,但我已经编写了一个非常可爱的“lat/lon”定位器,可以与谷歌地图和必应地图一起使用。它位于VB.NET中,并以JSON格式输出纬度和经度
Imports System.Runtime.Serialization
Imports System.Web
Imports System.Net
Imports System.Runtime.Serialization.Json
Imports System.Web.Script.Serialization
Namespace Utilities.Apis
Public NotInheritable Class Geolocation
''# This is the object that we are going to store the latitude and
''# longitude contained in the API response.
Private coordinates As Coordinates
Public Sub New()
coordinates = New Coordinates
End Sub
Private Const googleUrl As String = "http://maps.googleapis.com/maps/api/geocode/json?address={0}&sensor=false"
Private Const bingUrl As String = "http://dev.virtualearth.net/REST/v1/Locations?addressLine={0}&key={1}&CountryRegion={2}"
Private Const bingKey As String = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Public Enum apiProvider
Google = 1
Bing = 2
End Enum
''''# <summary>
''''# Gets the Latitude and Longitude of an address using either Bing or Google Geolocation
''''# </summary>
''''# <param name="Provider">ENUM apiProvider [Bing] or [Google]</param>
''''# <param name="Address">The address of the coordinates you'd like to locate</param>
''''# <param name="countryCode">Bing doesn't play nice outside the US without this. use "CA" for Canada</param>
''''# <returns>A JSON string using "Latitude" and "Longitude" from the Coordinates class</returns>
Public Function GetLatLon(ByVal Provider As Integer,
ByVal Address As String,
Optional ByVal CountryCode As String = "CA") As String
''# If there happens to be some strange behavior with the placeholder,
''# we want to ensure that the "demo" content is not submitted to the
''# api.
If Address = "6789 university drive" Then
Return Nothing
End If
Address = HttpUtility.UrlEncode(Address)
Dim url As String
Dim responseType As Type
If Provider = apiProvider.Bing Then
url = String.Format(bingUrl, Address, bingKey, CountryCode)
responseType = GetType(BingResponse)
ElseIf Provider = apiProvider.Google Then
url = String.Format(googleUrl, Address)
responseType = GetType(GoogleResponse)
Else
''# If for some reason, the apiResponse is NOT Google or Bing,
''# then we want to return Google anyways.
url = String.Format(googleUrl, Address)
End If
''# Initiate the Http Web Request to the respective provider
Dim request = DirectCast(HttpWebRequest.Create(url), HttpWebRequest)
''# Deflate the compressed (gzip'd) response
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate")
request.AutomaticDecompression = DecompressionMethods.GZip Or DecompressionMethods.Deflate
''# Serialize the response into it's respective Data Contract
Dim serializer As New DataContractJsonSerializer(responseType)
''# Because the JSON Response from Google and Bing are drastically
''# different, we need to consume the response a little differently
''# for each API. I'd like to figure out a way to shrink this a
''# little more, but at the same time, it's working. So I'm going to
''# leave it alone for now [Nov 28,2010]
''# Here we're handling the Bing Provider
If Provider = apiProvider.Bing Then
Dim res = DirectCast(serializer.ReadObject(request.GetResponse().GetResponseStream()), BingResponse)
Dim resources As BingResponse.ResourceSet.Resource = res.resourceSets(0).resources(0)
Dim point = resources.point
With coordinates
.latitude = point.coordinates(0)
.longitude = point.coordinates(1)
End With
''# Here we're handling the Google Provider
ElseIf Provider = apiProvider.Google Then
Dim res = DirectCast(serializer.ReadObject(request.GetResponse().GetResponseStream()), GoogleResponse)
Dim resources As GoogleResponse.Result = res.results(0)
Dim point = resources.geometry.location
With coordinates
.latitude = point.lat
.longitude = point.lng
End With
End If
''# Serialize the coordinates and return the string
Dim jsonSerializer = New JavaScriptSerializer
Return jsonSerializer.Serialize(coordinates)
End Function
End Class
<DataContract()>
Public Class BingResponse
<DataMember()>
Public Property resourceSets() As ResourceSet()
<DataContract()>
Public Class ResourceSet
<DataMember()>
Public Property resources() As Resource()
<DataContract([Namespace]:="http://schemas.microsoft.com/search/local/ws/rest/v1", name:="Location")>
Public Class Resource
<DataMember()>
Public Property point() As m_Point
<DataContract()>
Public Class m_Point
<DataMember()>
Public Property coordinates() As String()
End Class
End Class
End Class
End Class
<DataContract()>
Public Class GoogleResponse
<DataMember()>
Public Property results() As Result()
<DataContract()>
Public Class Result
<DataMember()>
Public Property geometry As m_Geometry
<DataContract()>
Public Class m_Geometry
<DataMember()>
Public Property location As m_location
<DataContract()>
Public Class m_location
<DataMember()>
Public Property lat As String
<DataMember()>
Public Property lng As String
End Class
End Class
End Class
End Class
End Namespace
因此,最终,他们将自己的地理定位与推特或终端用户移动设备“可以”提交的信息结合起来使用(例如,iPhone会询问您是否允许它发送位置信息)。他们依靠用户输入新的位置。他们可能在某个时候通过导入植入了该技术。关于特定公司在任何给定时间使用的技术的问题过于本地化,除非你想讨论如何在自己的应用程序中实现类似的技术。我需要在我的应用程序中实现类似的东西。我能做什么?我不确定这是否是你想要的,因为你的问题很模糊。但我试了一下。你可以在你喜欢的任何语言中使用相同的概念。
Geolocate.GetLatLon(Utilities.Apis.Geolocation.apiProvider.Google, "1234 Some Funky Street, Home Town, MI", "US")