Giter Site home page Giter Site logo

geosharp's Introduction

GeoSharp

An offline Geocoding library for .Net coded in C#. Based on the awesome Java lib by AReallyGoodName: https://github.com/AReallyGoodName/OfflineReverseGeocode You may also be interested in https://github.com/RobThree/NGeoNames (also under MIT).

Requirements

  • This library is built for .Net 4, however it should work fine with 3.5 and Mono.
  • The data that is fed in needs to be in the geoname format as described here.
  • Here you'll find various sets of formatted data to use for the reverse geocoding.

Performance

The look ups are very fast, O(logn), however building the initial KD-Tree is not so fast, O(kn * logn), so pre-selecting your datasets and filtering out places or areas that are not of interest (like water bodies) can be used to improve load speed and reduce memory usage.

Filtering of data can be done offline using the GeoDBOptimize class to create tailored geoname tables.

Usage

Load a database from a file

GeoSharp.ReverseGeoCode geocode = new GeoSharp.ReverseGeoCode(@"C:\allCountries.txt", true);
Console.WriteLine(geocode.NearestPlaceName(40.730885, -73.997383));

Load a database from a Stream

using (MemoryStream ms = new MemoryStream(MemoryDB))
{
	GeoSharp.ReverseGeoCode geocode = new GeoSharp.ReverseGeoCode(ms, true);
	Console.WriteLine(geocode.NearestPlaceName(40.730885, -73.997383));
}

License

Licensed under The MIT License.

geosharp's People

Contributors

necrolis avatar

Watchers

James Cloos avatar Jason Rai avatar  avatar

Forkers

gdegeneve

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.