Skip to content

A micro-service for looking up addresses in the Ordnance Survey service using a postcode or a UPRN. Requires purchasing an API key from Ordnance Survey

License

Notifications You must be signed in to change notification settings

dvla/os-address-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DVLA Ordnance Survey Service

ordnance-survey is a microservice façade for the Ordnance Survey API, encapsulating organisation-wide configuration such as authentication and licensing.

The codebase is predominantly Scala and is implemented against Spray: a lightweight HTTP framework for the JVM.

The application is calling the ordnancesurvey.co.uk service to retrieve addresses from a postcode.

Running the application

The application is running as part of an exemplar by executing the following command on the exemplar:

	sbt sandbox

To run this microservice on its own, you have to create a fat jar and then run this jar. To do so:

	sbt assembly
	java -jar target/scala-2.11/os-address-lookup-XXX.jar

	where XXX is the current version

The listening port is defined in src/main/resources/application.conf, under the `port` property 

Usage

Get all addresses in a postcode

To see the raw json returned by the ordnance-survey service, go to this url with a web browser:

https://api.ordnancesurvey.co.uk/places/v1/addresses/postcode?postcode=<INSERT POSTCODE WITHOUT SPACES>&dataset=dpa&key=<INSERT API KEY>

To see how this micro-service will re-format that json to a view model, you can send a curl command the micro-service:

curl http://localhost:8083/postcode-to-address?postcode=<INSERT POSTCODE WITHOUT SPACES>

Get one address for a UPRN

To see the raw json returned by the ordnance-survey service, go to this url with a web browser:

https://api.ordnancesurvey.co.uk/places/v1/addresses/uprn?uprn=<INSERT UPRN>&dataset=dpa&key=<INSERT API KEY>

To see how this micro-service will re-format that json to a view model, you can send a curl command the micro-service:

curl http://localhost:8083/uprn-to-address?uprn=<INSERT UPRN>

Useful Links

Postcode Address File specification

Some interesting false assumptions about addresses

OS Datasets

OS REST API test page

Glossary

DPA Delivery Point Address (dataset)

LPI Local Property Identifier (dataset)

About

A micro-service for looking up addresses in the Ordnance Survey service using a postcode or a UPRN. Requires purchasing an API key from Ordnance Survey

Resources

License

Stars

Watchers

Forks

Packages

No packages published