GithubHelp home page GithubHelp logo

madhuv-sharma / nearest-postcodes-calculator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 10 MB

It gives the list of 10 nearest Indian and Canadian Pin Codes from the given value, for which, the knowledge of Haversine formula and the databases containing geocoordinates of over 11,000 (only the first 100 rows have been uploaded) Indian postcodes/ 40,000 Canadian postal codes.

Python 100.00%
beautifulsoup4 canada haversine-formula india postal-codes python urllib3 web-scraping

nearest-postcodes-calculator's Introduction

Nearest Postal Codes Calculator

Using a variety of modules namely- bs4, csv, json, pandas and urllib, I had created a Database of over 11,000 Indian Pin Codes with their respective Geocoordinates, from 3 different sources, using web scraping. Initially, I downloaded a raw Database containing a list of Indian Pin Codes along with highly erroneous geocoordinates (with frequent repetition) from Github[1] (Source #1) I had scraped Nominatam's OpenStreetMap[2] (Source #2), which yielded correct[3] geo coordinates of more than 50% values. This wasn't satisfactory so I went ahead and designed a program which surfed Google[4] (Source #3) for geo coordinates and returned the result of Google's Featured Snippet. Using this method, I was able to get a separate database which was about 76% correct*. Finally, I had edited the "Featured Snippet Database" by replacing the 24% incorrect values by the respective ones from the "OSM Database". All in all, I could achieve an overall correct values' percentage of 94%, which can still be improved further, but manually.

Upon completion of the database, I had executed a code in Python, which gave the list of 10 nearest Pin Codes from the value entered, for which, I had used the Haversine formula and the knowledge of the database that I had created earlier.

Did the same for Canadian postal codes Database [5].

[1]	https://github.com/sanand0/pincode/blob/master/data/IN.csv

[2]	https://nominatim.openstreetmap.org/ui/search.html

[3] 	The number of correct geo coordinates were found out by checking two main conditions:
	i 	If the geo coordinates were of a location within the range of India, ie. within 8°4'N - 37°6'N latitude and 68°7'E - 97°25'E longitude (to simply eliminate 			    such values and replace them)
	ii 	If condition i is satisfied, coordinates were rechecked to find whether they lie within their respective state boundaries (for such values, their 				counterparts were compared and action was taken accordingly)

[4]	www.google.com

[5]	https://www.serviceobjects.com/blog/free-zip-code-and-postal-code-database-with-geocoordinates/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.