GithubHelp home page GithubHelp logo

isabella232 / geocoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prolificinteractive/geocoder

0.0 0.0 0.0 181 KB

This is a device independent and plugable replacement for Android's builtin Geocoder.

License: MIT License

Java 2.40% Kotlin 97.60%

geocoder's Introduction

Geocoder

This is a device independent and plugable replacement for Android's builtin Geocoder.

A class for handling geocoding and reverse geocoding. Geocoding is the process of transforming a street address or other description of a location into a (latitude, longitude) coordinate. Reverse geocoding is the process of transforming a (latitude, longitude) coordinate into a (partial) address. The amount of detail in a reverse geocoded location description may vary, for example one might contain the full street address of the closest building, while another might contain only a city name and postal code.

Why

Android's implementation of Geocoder requires the a backend service that is not included in the code android framework. On devices where this backend framework is absent, all calls to the Android Geocoder will silently fail. Additionally, the backend implementation of the android Geocoder may vary across manufacturers, devices and android versions. This library was created to provide a consistent experience across all devices and users.

Installation

Step 1. Add the JitPack repository to your build file

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.prolificinteractive.geocoder:geocoder:0.1.0'

    // For Geocoder and Google Maps
    implementation 'com.github.prolificinteractive.geocoder:geocoder-googlemaps:0.1.0'

    // For Geocoder and OkHttp
    implementation 'com.github.prolificinteractive.geocoder:geocoder-okhttp:0.1.0'

    // For Geocoder and Open Street Maps
    implementation 'com.github.prolificinteractive.geocoder:geocoder-openstreetmap:0.1.0'
}

Usage

    geocoder = GeocoderBuilder()
        .addGeocodingApi(GoogleMaps.create())
        .setDownloaderFactory(
            OkHttpFactory(OkHttpClient.Builder().build()))
        .build()


    val addresses: List<Address> = geocoder
                                    .getFromLocation("1600 amphitheatre parkway", 1)
                                    .blockingGet()

Roadmap

The pitfalls of the Android Geocoder do not become evident until bad reviews start pouring in. In order for relieve a pain of having to roll your own solution, this project aim to be a drop in replacement for the built in Android Geocoder.

  • Remove RxJava from API in favor of Kotlin coroutines.

  • Match method signature of Android's Geocoder.

  • Use Android Platform Address object

  • Streaming JSON parsing

Contributing to Geocoder

To report a bug or enhancement request, feel free to file an issue under the respective heading.

If you wish to contribute to the project, fork this repo and submit a pull request. Code contributions should follow the standards specified in the Prolific Android Style Guide.

License

prolific

geocoder is Copyright (c) 2018 Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.

geocoder's People

Contributors

tevjef avatar

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.