All Projects → KoddiDev → geocoder

KoddiDev / geocoder

Licence: MIT License
Google Maps geocoding library for Scala

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to geocoder

Bblocationmanager
A Location Manager for easily implementing location services & geofencing in iOS. Ready for iOS 11.
Stars: ✭ 107 (+723.08%)
Mutual labels:  location, geocoder
Fccurrentlocationgeocoder
iOS Geocoder for forward geocode and reverse geocode user's current location using a block-based syntax. 📍🌍
Stars: ✭ 268 (+1961.54%)
Mutual labels:  location, geocoder
Geolocation
Flutter geolocation plugin for Android and iOS.
Stars: ✭ 205 (+1476.92%)
Mutual labels:  location, geocoder
Pelias Android Sdk
Android sdk for pelias
Stars: ✭ 20 (+53.85%)
Mutual labels:  location, geocoder
Fcipaddressgeocoder
iOS Geocoder for geocode device IP Address location using GeoIP service(s) and a block-based syntax. 💻🌍
Stars: ✭ 114 (+776.92%)
Mutual labels:  location, geocoder
Placepicker
Free Android Map Place Picker alternative using Geocoder instead of Google APIs
Stars: ✭ 126 (+869.23%)
Mutual labels:  location, geocoder
pinpoint
🌎 A python script for finding your Mac.
Stars: ✭ 56 (+330.77%)
Mutual labels:  location, geocoder
HerePy
A library that provides a Python interface to the HERE APIs.
Stars: ✭ 73 (+461.54%)
Mutual labels:  geocoder
discourse-locations
Tools for handling locations in Discourse
Stars: ✭ 31 (+138.46%)
Mutual labels:  location
gps-share
Utility to share your GPS device on local network
Stars: ✭ 49 (+276.92%)
Mutual labels:  location
InstagramLocationScraper
No description or website provided.
Stars: ✭ 13 (+0%)
Mutual labels:  location
RxLocation
Use with rxjava,No memory leak,Simple
Stars: ✭ 52 (+300%)
Mutual labels:  location
map-with-me
🌍 Create collaborative maps with your friends (and enemies)
Stars: ✭ 23 (+76.92%)
Mutual labels:  location
TimeZoneLocate
Time zone for locations offline in Swift (iOS).
Stars: ✭ 30 (+130.77%)
Mutual labels:  location
rafagas
Daily geospatial links curated by Raf Roset
Stars: ✭ 17 (+30.77%)
Mutual labels:  location
NominatimGeocoderBackend
UnifiedNlp geocoder backend that uses the OSM Nominatim service
Stars: ✭ 49 (+276.92%)
Mutual labels:  geocoder
react-native-device-country
Get device location by telephony (SIM card) or settings without using GPS tracker.
Stars: ✭ 33 (+153.85%)
Mutual labels:  location
arboles
Mapa de Arbolado Urbano
Stars: ✭ 13 (+0%)
Mutual labels:  location
Geodesy
Geodesy functions in Swift 🌎
Stars: ✭ 17 (+30.77%)
Mutual labels:  location
telegram-nearby-map
Discover the location of nearby Telegram users 📡🌍
Stars: ✭ 329 (+2430.77%)
Mutual labels:  location

Build Status

Geocoder

A Google Maps geocoding library for Scala. The goal of the library is provide lightweight, easy to use geocoding functions that are thoroughly tested.

Goals

  • No 3rd-party dependencies (scala-xml is required for projects building on 2.11.x+)
  • Fully unit tested
  • API Compliant
  • Easy to use and integrate

Including

Include the following in your build.sbt

libraryDependencies += "com.koddi" %% "geocoder" % "1.1.0"

And then import the classes into your code

import com.koddi.geocoder.Geocoder

val geo = Geocoder.create

Building

To build simply run the following sbt commands.

$ sbt clean compile test doc assembly

API Documentation will be generated in target/scala-2.{version}/api/

Usage

To create a Geocoder simply call the Geocoder.create function. Refer to the test/ directory for more in depth examples, below is a high level overview on how to use the library.

// Bring the Geocoder into scope
import com.koddi.geocoder.{Geocoder, ResponseParser}

// The factory object can be used to lazily create Geocoders
val geo = Geocoder.create

// If you need to use an API key because of limiting
val geoWithKey = Geocoder.create(MY_KEY)

// Geocoders can be created with parameters that will be passed at every lookup
val geoWithParams = Geocoder.create(Parameters(region = Some("us")))

// And lastly if you need to manually create the Geocoder
// that's supported as well.
val customGeo = new Geocoder(API_URL, Some(API_KEY), None, new ResponseParser)

To perform latitude/longitude lookups simply provide a formatted address.

// Lookup a location with a formatted address string
// Returns a Seq[Result]
val results = geo.lookup("2821 W 7th St, Fort Worth, TX")

// Access the MapComponents geometry data to get the location
val location = results.head.geometry.location

println(s"Latitude: ${location.latitude}, Longitude: ${location.longitude}")

Performing reverse lookups is just as easy.

// Lookup an address by latitude/longitude
// Reverse lookups also produce Seq[Result] objects
val results = geo.lookup(32.857, -96.748)

// Lookups can also be done with Component objects
// See com.koddi.geocoder.Component for more examples
val results = geo.lookup(Seq(CountryComponent("fr")))

// Place IDs are also supported
val results = geo.lookupPlace("ChIJk4x9peBzToYRBYLucCG-eGY")

Asynchronous calls are also supported.

// Can also be created with a key
val geo = Geocoder.createAsync

// Returns a Future[Seq[Result]]
val query = geo.lookup("2821 W 7th St, Fort Worth, TX")

// Process the Seq[Result]
query onComplete {
    case Success(results) => {
        for (result <- results) {
            // do something...
        }
    }
    case Failure(error) => println(error.getMessage)
}

Other Related Projects

These projects acheive the same purpose as this library and provide alternative options if this library is unsuitable.

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].