All Projects → SocialHarvest → Geobed

SocialHarvest / Geobed

Licence: bsd-3-clause
A simple, lightweight, embedded geocoder for Golang with city level accuracy

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Geobed

HerePy
A library that provides a Python interface to the HERE APIs.
Stars: ✭ 73 (+21.67%)
Mutual labels:  geocoder
Geocoder
The most featured Geocoder library written in PHP.
Stars: ✭ 3,774 (+6190%)
Mutual labels:  geocoder
Ziptastic Php
Official Ziptastic PHP Library
Stars: ✭ 9 (-85%)
Mutual labels:  geocoder
geocoder
Google Maps geocoding library for Scala
Stars: ✭ 13 (-78.33%)
Mutual labels:  geocoder
Gisgraphy
geocoding and geolocalisation webservices for Geonames, Openstreetmap, Openaddresses, Tiger and quattroshapes data
Stars: ✭ 275 (+358.33%)
Mutual labels:  geocoder
Geocoder
Geocode addresses to coordinates
Stars: ✭ 566 (+843.33%)
Mutual labels:  geocoder
opencage
🌐 R package for the OpenCage API -- both forward and reverse geocoding 🌐
Stars: ✭ 82 (+36.67%)
Mutual labels:  geocoder
Cj Google Geocoder
Stars: ✭ 49 (-18.33%)
Mutual labels:  geocoder
Geopy
Geocoding library for Python.
Stars: ✭ 3,512 (+5753.33%)
Mutual labels:  geocoder
Geocoder
🌎 GoLang package that provides an easy way to use the Google Geocoding API
Stars: ✭ 23 (-61.67%)
Mutual labels:  geocoder
Track-Stargazers
Have fun tracking your project's stargazers
Stars: ✭ 38 (-36.67%)
Mutual labels:  geocoder
Fccurrentlocationgeocoder
iOS Geocoder for forward geocode and reverse geocode user's current location using a block-based syntax. 📍🌍
Stars: ✭ 268 (+346.67%)
Mutual labels:  geocoder
Places
🌐 Turn any <input> into an address autocomplete
Stars: ✭ 5,322 (+8770%)
Mutual labels:  geocoder
yelp-camp
A Node.js web application project from the Udemy course - The Web Developer Bootcamp by Colt Steele
Stars: ✭ 36 (-40%)
Mutual labels:  geocoder
Geocode
Geocode - A simple location code mapping latitude,longitude to a single alphanumeric string, or three locality names
Stars: ✭ 12 (-80%)
Mutual labels:  geocoder
NominatimGeocoderBackend
UnifiedNlp geocoder backend that uses the OSM Nominatim service
Stars: ✭ 49 (-18.33%)
Mutual labels:  geocoder
Geo Golang
Go library to access geocoding and reverse geocoding APIs
Stars: ✭ 394 (+556.67%)
Mutual labels:  geocoder
Cordova Plugin Nativegeocoder
Cordova plugin for native forward and reverse geocoding
Stars: ✭ 58 (-3.33%)
Mutual labels:  geocoder
Pelias Android Sdk
Android sdk for pelias
Stars: ✭ 20 (-66.67%)
Mutual labels:  geocoder
Node Geocoder
nodejs geocoding library
Stars: ✭ 800 (+1233.33%)
Mutual labels:  geocoder

Geobed

Build Status Coverage Status

This Golang package contains an embedded geocoder. There are no major external dependendies other than some downloaded data files. Once downloaded, those data files are stored in memory. So after the initial load there truly are no outside dependencies. It geocodes and reverse geocodes to a city level detail. It approximates and takes educated guesses when not enough detail is provided. See test cases for more examples.

Why?

To keep it short and simple, the reason this package was built was because geocoding services are really expensive. If city level detail is enough and you don't need street addresses, then this should be completely fine. It's also nice that there are no HTTP requests being made to do this (after initial load - and the data files can be copied to other places).

Performance is pretty good, but that is one of the goals. Overtime it should improve, but for now it geocodes a string to lat/lng in about 0.0125 - 0.0135 seconds (on a Macbook Pro).

Usage

You should re-use the GeoBed struct as it contains a LOT of data (2.7+ million items). On this struct are the functions to geocode and reverse geocode. Be aware that this also means your machine will need a good bit of RAM since this is all data held in memory (which is also what makes it fast too).

g := NewGeobed()
c := g.Geocode("london")

In the above case, c should end up being:

{London london City of London,Gorad Londan,ILondon,LON,Lakana,Landen,Ljondan,Llundain,Londain,Londan,Londar,Londe,Londen,Londinium,Londino,Londn,London,London City,Londona,Londonas,Londoni,Londono,Londonu,Londra,Londres,Londrez,Londri,Londye,Londyn,Londýn,Lonn,Lontoo,Loundres,Luan GJon,Lunden,Lundra,Lundun,Lundunir,Lundúnir,Lung-dung,Lunnainn,Lunnin,Lunnon,Luân Đôn,Lùng-dŭng,Lākana,Lůndůn,Lọndọnu,Ranana,Rānana,The City,ilantan,landan,landana,leondeon,lndn,london,londoni,lun dui,lun dun,lwndwn,lxndxn,rondon,Łondra,Λονδίνο,Горад Лондан,Лондан,Лондон,Лондонъ,Лёндан,Լոնդոն,לאנדאן,לונדון,لندن,لوندون,لەندەن,ܠܘܢܕܘܢ,लंडन,लंदन,लण्डन,लन्डन्,লন্ডন,લંડન,ଲଣ୍ଡନ,இலண்டன்,లండన్,ಲಂಡನ್,ലണ്ടൻ,ලන්ඩන්,ลอนดอน,ລອນດອນ,ལོན་ཊོན།,လန်ဒန်မြို့,ლონდონი,ለንደን,ᎫᎴ ᏗᏍᎪᏂᎯᏱ,ロンドン,伦敦,倫敦,런던 GB ENG 51.50853 -0.12574 7556900 gcpvj0u6yjcm}

So you can get lat/lng from the GeobedCity struct real easily with: c.Latitude and c.Longitude.

You'll notice some records are larger and contain many alternate names for the city. The free data sets come from Geonames and MaxMind. MaxMind has more but less details. Geonames has more details, but it only contains cities with populations of 1,000 people or greater (about 143,000 records).

If you looked up a major city, you'll likely have information such as population (c.Population).

You can reverse geocode as well.

c := g.ReverseGeocode(30.26715, -97.74306)

This would give you Austin, TX for example.

Data Sets

The data sets are provided by Geonames and MaxMind. These are open source data sets. See their web sites for additional information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].