GithubHelp home page GithubHelp logo

qapn / audress Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 640 KB

A RESTful API for searching and validating any Australian address.

License: GNU General Public License v3.0

Ruby 68.07% HTML 29.64% CSS 2.28%

audress's Introduction

Audress

Audress Demo

About

Audress is a RESTful API for searching and validating any Australian address. It's designed to work with a flat table Geocoded National Address File (G-NAF) database stored on PostgreSQL, which you can generate with the G-NAF Importer.

The main search endpoint will builds a wildcard query or a recursive common table expression (CTE) query as appropriate, allowing for quick querying against over 13 million addresses.

The underlying raw G-NAF data is licensed CC BY 4.0, and is provided by the Australian government.

Setup

  1. Build and configure a G-NAF flat table database with the G-NAF Importer.
  2. Clone this repository.
  3. Start a local Redis instance in Docker:
    docker run --name redis -d --restart always -p 6379:6379 redis
    
  4. Install all required gems:
    bundle install
    
  5. Start the server:
    rails s
    
    You will then be able to see a demo implementation at http://localhost:3000.

Usage

Autocomplete

Returns up to 10 matching address records from a search term.

  • URL

    /addresses/autocomplete

  • Method:

    POST or GET

  • URL Params

    query=[space separated search terms]

  • Success Response:

    • Input:
      • 182 church street parramatta
    • Response:
      • Status: 200 OK
      • { "results": [ { "address_detail_pid": "GANSW711121522", "street_locality_pid": "NSW2810040", "locality_pid": "NSW3184", "building_name": null, "lot_number_prefix": null, "lot_number": null, "lot_number_suffix": null, "flat_type": null, "flat_number_prefix": null, "flat_number": null, "flat_number_suffix": null, "level_type": null, "level_number_prefix": null, "level_number": null, "level_number_suffix": null, "number_first_prefix": null, "number_first": 182, "number_first_suffix": null, "number_last_prefix": null, "number_last": 184, "number_last_suffix": null, "street_name": "CHURCH", "street_class_code": "C", "street_class_type": "CONFIRMED", "street_type_code": "STREET", "street_suffix_code": null, "street_suffix_type": null, "locality_name": "PARRAMATTA", "state_abbreviation": "NSW", "postcode": "2150", "latitude": "-33.81618626", "longitude": "151.004568", "geocode_type": "PROPERTY CENTROID", "confidence": 0, "alias_principal": "P", "primary_secondary": null, "legal_parcel_id": null, "date_created": "2007-10-23", "autocomplete": "182-184 CHURCH STREET, PARRAMATTA NSW 2150" } ] }
  • No Results Response:

    • Input:
      • 1600 pennsylvania avenue washington
    • Response:
      • Status: 204 No Content

G-NAF ID Lookup

Returns the record matching a G-NAF ID.

  • URL

    /addresses/:id

  • Method:

    GET

  • Response:

    • Identical to the autocomplete endpoint.

FAQ

  • I searched for X address/business and the result was incorrect/missing!

    The data is put together by a combination of every Australian state and territory government along with the federal government. You can contact the relevant state/territory and get them to fix it in a subsequent G-NAF release.

  • I got an error/I'm unable to get this running!

    It could be something simple! Please open an issue on this repository with some details about your problem, and I'd be happy to help you.

audress's People

Contributors

qapn avatar

Stargazers

Paul Colusso avatar sunny avatar  avatar

Watchers

 avatar

Forkers

pcolusso dt-in

audress's Issues

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.