Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / SQL

GeoLocation by Radius Using Google Maps and .NET

Rate me:
Please Sign up or sign in to vote.
4.75/5 (14 votes)
23 Jan 2009CPOL8 min read 102.6K   2.4K   62  
This article shows you how to geocode existing addresses, then run distance calculations for geolocation within a given radius.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="xsdProviderSearch" targetNamespace="http://tempuri.org/xsdProviderSearch.xsd" xmlns:mstns="http://tempuri.org/xsdProviderSearch.xsd" xmlns="http://tempuri.org/xsdProviderSearch.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="2" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="cnnCMMC" IsAppSettingsProperty="True" Modifier="Assembly" Name="cnnCMMC (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.cnnCMMC.ConnectionString" Provider="System.Data.SqlClient">
          </Connection>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="cnnNavigator" IsAppSettingsProperty="True" Modifier="Assembly" Name="cnnNavigator (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.cnnNavigator.ConnectionString" Provider="System.Data.SqlClient">
          </Connection>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="FirstTestDBConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="FirstTestDBConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.FirstTestDBConnectionString.ConnectionString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="sproc_ReturnGeoProvidersTableAdapter" GeneratorDataComponentClassName="sproc_ReturnGeoProvidersTableAdapter" Name="sproc_ReturnGeoProviders" UserDataComponentName="sproc_ReturnGeoProvidersTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="FirstTestDBConnectionString (Web.config)" DbObjectName="FirstTestDB.dbo.sproc_ReturnGeoProviders" DbObjectType="StoredProcedure" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="False">
                    <CommandText>dbo.sproc_ReturnGeoProviders</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@clientLat" Precision="53" ProviderType="Float" Scale="0" Size="8" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@clientLong" Precision="53" ProviderType="Float" Scale="0" Size="8" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@maxRadius" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="xsdProviderSearch" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="xsdProviderSearch" msprop:Generator_DataSetName="xsdProviderSearch">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="sproc_ReturnGeoProviders" msprop:Generator_UserTableName="sproc_ReturnGeoProviders" msprop:Generator_RowDeletedName="sproc_ReturnGeoProvidersRowDeleted" msprop:Generator_RowChangedName="sproc_ReturnGeoProvidersRowChanged" msprop:Generator_RowClassName="sproc_ReturnGeoProvidersRow" msprop:Generator_RowChangingName="sproc_ReturnGeoProvidersRowChanging" msprop:Generator_RowEvArgName="sproc_ReturnGeoProvidersRowChangeEvent" msprop:Generator_RowEvHandlerName="sproc_ReturnGeoProvidersRowChangeEventHandler" msprop:Generator_TableClassName="sproc_ReturnGeoProvidersDataTable" msprop:Generator_TableVarName="tablesproc_ReturnGeoProviders" msprop:Generator_RowDeletingName="sproc_ReturnGeoProvidersRowDeleting" msprop:Generator_TablePropName="sproc_ReturnGeoProviders">
          <xs:complexType>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer
United States United States
I am a technical architect/senior software engineer, technical trainer, entrepreneur.

I have worked in several sectors from healthcare, to entertainment and global intelligent traffic systems, using .Net, SQL, NoSQL and some of the latest technologies to deliver quality software systems for clients.

Past tech flavors include C#, WCF, SOA, MVC, MVVM, Silverlight, Assembler, Pascal, VB, Java/J2EE/EJB/JDBC, Perl, NLTK, TSQL, NoSQL, KendoUI, NodeJS, SignalR, Backbone JS, Angular JS, Latest .Net technologies, Amazon AWS...

Comments and Discussions