Code Monkey home page Code Monkey logo

geodatasource's Introduction

GeoDataSource

GeoDataSource is a .NET Class Library based off of the data from http://www.geonames.org. We only capture the Country and Province level of information, which ends up taking a 1.2GB file down to 1.7MB. Useful and practical for most web based input forms.

It has two methods of operation:

  1. To automatically download, parse and convert the geonames.org data into a binary serialized data stream on disk. This file will be used in subsequent calls for queries. Keep in mind that this will download close to 400MB of data, and will require about 1.2GB of disk space during the conversion process. It will check to make sure it has read and write access to the disk first, if it does it will update otherwise it will skip the update. It will also delete all files after it is done, other than two: The updated GeoDataSource.dat file, and a GeoDataSource-LastModified.txt file which simply contains a timestamp of when the data was updated.

Also during the update process, we will issue a HEAD request to the remote server and make sure that it is in fact new before performing any update; based on what the server returns in its Last-Modified header.

  1. To consume the binary serialized stream for queries.

See unit tests for usage.

Building

When building, make sure you run the update process first, to get a fresh copy of the GeoDataSource.dat file. Replace the file in the project, and then build. This is the default set of data that the DLL will use for queries. This also makes the forced update unnecessary until you really want it.

Data Available

  • Countries
  • Provinces
  • TimeZone Information
  • Feature Codes (detailed descriptions about each item)

geodatasource's People

Stargazers

Sheharyar Shahid avatar Artyom Shalkhakov avatar Marcelito Costa avatar Matthew McLeod avatar Andrew Basarab avatar Huy Q. Nguyen avatar Florian avatar Andreas Oldeskog avatar

Watchers

Rob Chartier avatar James Cloos avatar

Forkers

chinasio ronin1

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.