Click here to Skip to main content
11,720,785 members (64,529 online)
Click here to Skip to main content

Online Geocoder with interactive Map

, 29 Jun 2015 CPOL 22.1K 12
Rate this:
Please Sign up or sign in to vote.
Web app to find geographical coordinates and apply them to the Bing Map

Introduction

Geographic coordinates provide the unified way to identify any place on Earth. City streets could change their names and numbers, but the universal coordinate system, free of daily vanities and challenges of time, presents perpetual time-invariant values on a planetary level. Geographic coordinates system in general includes longitude, latitude and elevation (height), but the most used are the first and the second ones, namely longitude/latitude. They could be presented either in degrees:minutes:seconds (so-called DMS) format or decimal degrees (DD) format (used in the application).

Geographic coordinates could be obtained via global positioning system (GPS) devices, but this technique requires the physical presence at the point of interest. As an alternative, the geocoding software applications (or simply geocoder, or geo-locator) could be used to convert the postal addresses to the corresponding longitude/latitude pairs. Such geocoder has been built in conjunction with interactive online Map powered by Microsoft Bing™ technology, allowing different views, panorama and zooming; it is available online totally free at [1], serving both practical and didactic purposes (no registration is needed).

Usage

The usage is rather straightforward and intuitive: in order to obtain the longitude/latitude information and the map of the geographic point of interest, either in the US, or worldwide follow the steps described below:

  1. Open web browser and navigate it to the Geocoder
  2. Enter the postal address into the search box and click on the "Find" screen button. Note: places in the US could be identified just by their ZIP (postal) code
  3. Upon the completion of screen reload, which could take up to several seconds, you should be able to see the longitude/latitude of the point of interest and corresponding Bing map. You could select the preferred map view modes (road, aerial or bird’s eyes), adjust zoom level (from 1 to 19) and perform the panoramic function

Multilingual support

Online geocoder has multi-lingual capabilities, accepting search queries in many foreign languages: Spanish, German, Italian, French, Russian, Greek, etc. Below are sample test results, corresponding to the world landmarks, entered in a search query in the language of origin:

  • Metropolitan Museum, New York |  Lat: 40.779437/Lon: -73.963244
  • Grand Central Terminal, NY | Lat: 40.752726/Lon: -73.977229
  • Colosseo, Roma | Lat: 41.89021/Lon: 12.492231
  • Ακρόπολη Αθηνών | Lat: 37.971532 /Lon: 23.725749
  • Brandenburger Tor, Unter Der Linden | Lat: 52.516275 /Lon: 13.377704
  • Champs-Elysées, Paris | Lat: 48.869576/Lon: 2.30825
  • Eiffel Tour, Champs De Mars | Lat: 48.85837/Lon: 2.294481
  • Museo del Prado, Madrid | Lat: 40.413782/Lon: -3.692127
  • Cappella Sistina, Rome |  Lat: 41.902947/Longitude: 12.454484
  • Музей Эрмитаж, Санкт Петербург | Lat: 59.939832/Lon: 30.31456

Demo

The following screenshots demonstrate the usage of Multilingual Geocoder with interactive Bing Map (see Fig 1-4):

Fig.1 Columbus Circle NY, Geo Coordinates (the distances from NY City are calculated from this point)

 

Fig.2 Columbus Circle NY on the Bing Map, sample screenshot (Aerial view mode)

 

Fig.3 Coordinates of the Brandenburg Gate, Berlin, Germany

 

Fig.4 Brandenburg Gate on Bing Map (Bird's eye view mode)

Points of Interest

Calculation of the great-circle (orthodromic) distance between two geo-points on the Earth surface is the general GIS task. It can be acomplished by using Spherical Earth projection algorithm listed below [2]:

/*****************************************************************************************
Module           :  GIS.cs
Description      :  Calculate distance between two geo-points on surface
*****************************************************************************************
Author           :  Alexander Bell
Copyright        :  2011-2015 Infosoft International Inc
*****************************************************************************************
DISCLAIMER       :  This Module is provided on AS IS basis without any warranty
*****************************************************************************************
TERMS OF USE     :  This module is copyrighted. Please keep the Copyright notice intact.
*****************************************************************************************/
using System;

namespace BusNY
{
    internal enum UnitSystem { SI = 0, US = 1 }
    
    internal static class GIS
    {
        #region internal: properties (read-only)
        internal static double EarthRadiusKm { get {return _radiusEarthKM;} }
        internal static double EarthRadiusMiles { get { return _radiusEarthMiles; } }
        internal static double m2km { get { return _m2km; } }
        internal static double Deg2rad { get { return _toRad; } }
        #endregion

        #region private: const
        private const double _radiusEarthMiles = 3959;
        private const double _radiusEarthKM = 6371;
        private const double _m2km = 1.60934;
        private const double _toRad = Math.PI / 180;
        #endregion

        #region public Method: Spherical Earth projection
        public static double DistanceSEP(double Lat1,
                                        double Lon1,
                                        double Lat2,
                                        double Lon2,
                                        UnitSystem UnitSys ){
            try
            {
                double _radLat1 = Lat1 * _toRad;
                double _radLat2 = Lat2 * _toRad;
                double _dLat = (_radLat2 - _radLat1);
                double _dLon = (Lon2 - Lon1) * _toRad;

                double _a = (_dLon) * Math.Cos((_radLat1 + _radLat2) / 2);

                // central angle, aka arc segment angular distance
                double _centralAngle = Math.Sqrt(_a * _a + _dLat * _dLat);

                // great-circle (orthodromic) distance on Earth between 2 points
                if (UnitSys == UnitSystem.SI) { return _radiusEarthKM * _centralAngle; }
                else { return _radiusEarthMiles * _centralAngle; }
            }
            catch { throw; }
        }
        #endregion
    }
}

References

  1. Online Geocoder with Bing Map and Multilingual support
  2. The Orthodromic Distance Between Two Geo-points

License

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

Share

About the Author

DrABELL
President Infosoft International Inc
United States United States
Dr. A. Bell has 20+ years of Software and Electrical Engineering experience: Win/Web veteran, published 300+ articles and authored 37 inventions, credited for 10+ Enterprise level projects (>250k code lines); currently focused on .NET/WPF/C#, Javascript/jQuery, 'Big Data', AI, IoT and Mobile apps. Participated in App Innovation Contest (AIC 2102/2013) with several winning submissions. Sample projects/pubs follow:
  1. WebTV Project: Embedded YouTube Player (Goog #1 YouTube API for ASP.NET)
  2. Edumatter M12: School Math Calculators and Equation Solvers (contest winner)
  3. Engineering Calculator VOLTA-2013 (contest winner)
  4. Online 3 Fractions Calculator (#1 on Goog)
  5. Engineering Calculator VOLTA-814 for Windows
  6. Real-time NY Bus monitoring app
  7. Inflation Calculator
  8. PaydayNY-2015 Payroll Tax Calculator (Win)
  9. Multilingual Geocoder with Interactive Map
  10. Semantic Analyzer (Concordance Calculator)
  11. Prime Factoring Calculator

You may also be interested in...

Comments and Discussions

 
QuestionWanted a webservice to reference. Pin
Member 1149819230-Jun-15 7:53
memberMember 1149819230-Jun-15 7:53 
GeneralMy vote of 1 Pin
Sebastiaan Lubbers29-Jun-15 22:01
memberSebastiaan Lubbers29-Jun-15 22:01 
GeneralBing Maps are FUBAR because the marker(s) disappear everytim... Pin
clintonG6-Jun-11 14:37
memberclintonG6-Jun-11 14:37 
Generalunique!! Pin
GPUToaster30-May-11 1:54
memberGPUToaster30-May-11 1:54 
GeneralRe: Thank you! Pin
DrABELL30-May-11 2:33
memberDrABELL30-May-11 2:33 
Generalcool,my 5 Pin
Monjurul Habib29-May-11 6:47
memberMonjurul Habib29-May-11 6:47 
GeneralRe: Thanks a bunch! Pin
DrABELL29-May-11 7:04
memberDrABELL29-May-11 7:04 
GeneralNice one Alex. 5! Pin
thatraja27-May-11 16:52
mvpthatraja27-May-11 16:52 
GeneralRe: Many thanks! Pin
DrABELL28-May-11 1:28
memberDrABELL28-May-11 1:28 
GeneralRe: ccccccccc Pin
thienthanit31-May-11 15:53
memberthienthanit31-May-11 15:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150901.1 | Last Updated 29 Jun 2015
Article Copyright 2011 by DrABELL
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid