Skip to content

Postcode Geolocation

import groundwork.geo.territories.uk.postcodes

GeolocatedPostcode

Metadata about a geolocated postcode.

Properties

All properties are valid as keyword-args to the constructor. They are required unless marked optional below.

admin_county

Optional[str]

admin_district

str

admin_ward

str

ccg

str

ced

Optional[str]

codes

OnsCodes

country

str

eastings

int

incode

str

latitude

float

longitude

float

lsoa

str

msoa

str

nhs_ha

str

northings

int

nuts

str

outcode

str

parish

str

parliamentary_constituency

str

postcode

str

primary_care_trust

str

quality

int

region

str

Methods

to_point

to_point(
self)

Representation of this postcode's geolocation as a Django GIS-compatible point.

Returns
A Django-GIS Point representing the postcode

OnsCodes

ONS Codes for UK governmental boundaries a postcode falls within.

Properties

All properties are valid as keyword-args to the constructor. They are required unless marked optional below.

admin_county

str

admin_district

str

admin_ward

str

ccg

str

ccg_id

str

ced

str

lau2

str

lsoa

str

msoa

str

nuts

str

parish

str

parliamentary_constituency

str

postcode

RestDatasource[GeolocatedPostcode]

Geolocated postcode API resource.

Only GET requests are supported.

get(postcode):

Geocodes `postcode` and returns a `GeolocatedPostcode` instance.