Jon.Shoberg.Net

Archive for March, 2009

Google Latitude

by admin on Mar.11, 2009, under Misc Items

Recently Google released a new service named Latitude. Very simly it takes your location from mobile device or online using iGoogle and Gears and plots it on a map.  From there you can share your current location with friends and contacts who also use google latitude.  There are a number of privacy options on the service; set who and how you want to share location or the option to set a specific location too.

Google Latitude

Not sure how much I’ll be using this or a service like Latitude but its interesting to discover and see how it works.

Leave a Comment more...

Haversine Distance in Miles with TSQL Latitude Longitude

by admin on Mar.05, 2009, under Misc Items

A little non-multimedia post coming your way … a little bit of TSQL goodness for calculating the distance between two latitude and longitude coordinates.


SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE FUNCTION [dbo].[HaversineDistanceMiles] (
@lat1 float,
@lon1 float,
@lat2 float,
@lon2 float
)
RETURNS float AS
BEGIN

declare @dlon float
declare @dlat float
declare @a float
declare @c float
declare @d float

select @dlon=radians(@lon2)-radians(@lon1)
select @dlat=radians(@lat2)-radians(@lat1)

select @a =square(sin(@dlat/2.0)) + (cos(radians(@lat1)) * cos(radians(@lat2)) * square(sin(@dlon/2.0)))
select @c = 2.0 * atn2(sqrt(@a), sqrt(1.0-@a))
select @d = 3956 * @c

return @d

 

END

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!