Skip to content

geocoder developer guide

leo edited this page May 11, 2017 · 1 revision

BC Physical Address Geocoder

Developer Guide

This guide is aimed at developers and web masters that would like to incorporate the Physical Address Geocoder into their applications and websites.

Introduction

The BC Physical Address Online Geocoder REST API lets you integrate real-time standardization, validation, and geocoding of physical addresses into your own applications. This document defines aspects of the REST API that are not covered in the Swagger definition of the public geocoder or the gated geocoder. You can explore the API in the API console for the public geocoder or the gated geocoder. To simplify integration of the online geocoder into your client web application, you can use the Javascript API

API Changes in v2.0.1

There are no API changes in v2.0.1

Resource Overview

The Online Geocoder offers resources for validating and geocoding an address (including public and related business occupants); finding a given site, intersection, and occupant; and finding sites, intersections, and occupants near a point or within an area. The current baseUrl for the public online geocoder is:
http://apps.gov.bc.ca/pub/geocoder

The baseUrl for the public online geocoder under the HTTP Secure protocol is:
https://apps.gov.bc.ca/pub/geocoder

The baseUrl for the gated online geocoder is:
https://geocoder.api.gov.bc.ca/

Cross-Origin Resource Sharing (CORS)

CORS for the public geocoder is only enabled for gov.bc.ca. CORS for the gated geocoder is enabled for any domain. To request an apikey for the gated geocoder, please contact the DataBC Help Desk

Addresses Resource

The addresses resource represents all addresses in the geocoder. A request on this resource to find a query address will return one or more matching addresses that are standardized and geocoded (i.e., given a point location on the earth).

A query address can be specified in two different ways:

  1. A single address string containing all elements of an address as in:
    http://apps.gov.bc.ca/pub/geocoder/addresses.geojson?addressString=525%20superior%20st,%20victoria,%20bc

  2. Individual address elements as in:
    http://apps.gov.bc.ca/pub/geocoder/addresses.geojson?civicNumber=525&streetName=superior&streetType=st&localityName=victoria&provinceCode=BC

Here are some more example geocoder requests:

  1. Geocode 456 Gorge Rd E, Victoria, BC
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?addressString=456%20Gorge%20Rd%20e%20victoria%20bc

  2. Geocode 7-955 13th Ave, Valemount, BC
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?addressString=7-955%2013th%20ave,%20Valemount,bc

  3. Geocode the intersection at Johnson and Government
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?addressString=johnson%20and%20government

  4. Geocode 5671 Malibu Terrace, Nanaimo, BC and return results in GEOJSON and BC Albers projection
    http://apps.gov.bc.ca/pub/geocoder/addresses.geojson?outputSRS=3005&addressString=5671%20malibu%20terrace%20nanaimo%20bc

  5. Geocode 5670 Malibu Terrace, Nanaimo and return the location along the road centreline for using in routing
    http://apps.gov.bc.ca/pub/geocoder/addresses.kml?locationDescriptor=routingPoint&addressString=5670%20malibu%20terrace%20nanaimo%20bc

  6. Geocode 5670 Malibu Terrace, Nanaimo and return accessPoint set back four metres from the curb towards the inside of the property. Note that only accessPoints can be set back
    http://apps.gov.bc.ca/pub/geocoder/addresses.kml?locationDescriptor=accessPoint&setBack=4&addressString=5670%20malibu%20terrace%20nanaimo%20bc

  7. Geocode 5671 Malibu Terrace, Nanaimo, BC without interpolation. In other words, if the geocoder doesn’t have a site with a civic number of 5671, it will fail instead of looking for an address range that contains 5671
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?interpolation=none&addressString=5671%20malibu%20terrace%20nanaimo%20bc

  8. Geocode 200 Gorge Rd W, Saanich, BC and limit results to Victoria. It will return 200 Gorge Rd E, Victoria, BC since Gorge Rd E is in Victoria
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?localities=victoria&addressString=200%20gorge%20rd%20w%20saanich%20bc

  9. Geocode 1434 Graham St, Kelowna, BC and limit results to ten matches within the greater Kelowna area
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?&bbox=-119.8965522070019%2C49.70546831817266%2C-119.2157397287486%2C50.06954472056336&addressString=1434%20Graham%20St%2C%20Kelowna%2C%20BC&maxResults=10

  10. Geocode 1434 Graham St, Kelowna, BC and limit results to ten street-level matches
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?&addressString=1434%20Graham%20St%2C%20Kelowna%2C%20BC%20&matchPrecision=street&maxResults=10

  11. Extrapolate the known location of 12 Bushby St from a parcelPoint to get an accessPoint
    http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?setBack=0&minScore=1&maxResults=1&maxDistance=0&interpolation=adaptive&echo=true&outputSRS=4326&addressString=12%20bushby%20st%20victoria%20bc&locationDescriptor=any&extrapolate=true&parcelPoint=-123.349174,2048.407134

  12. Find the nearest courthouse to a given point
    http://apps.gov.bc.ca/pub/geocoder/occupants/nearest.geojson?point=-123.7064038,48.8498537&tags=courts


Resource representations in HTTP Responses

The addresses resource will return a document in the requested format and spatial reference system. Documents in formats that support a header record (e.g., XHTML, KML, GEOJSON, GEOJSONP, GML) will contain a single About Query representation describing the query and its execution, and one or more site address or intersection address representations. Documents in formats that don’t support a header record (e.g., CSV, SHPZ), will contain one or more site/intersection address representations.

About Query Representation

Attribute Name Type
searchTimestamp Datetime
executionTime Real
version String
minScore Integer
maxResults Integer
echo Boolean
interpolation String
outputSRS Integer
setBack Real

Site Address Representation

Attribute Name Type
fullAddress String
score integer
matchPrecision String
precisionPoints integer
faults String
siteName String
unitDesignator String
unitNumber String
unitNumberSuffix String
civicNumber String
civicNumberSuffix String
streetName String
streetType String
isStreetTypePrefix Boolean
streetDirection String
isStreetDirectionPrefix Boolean
streetQualifier String
localityName String
provinceCode String
locationPositionalAccuracy String
locationDescriptor String
siteID string
blockID String
fullSiteDescriptor String
narrativeLocation String
accessNotes String
siteStatus String
siteRetireDate Date
changeDate string
isPrimary string

Intersection Address Representation

Attribute Name Type
fullAddress String
intersectionName String
localityName String
provinceCode String
score Integer
matchPrecision String
precisionPoints Integer
provinceCode String
matchPrecision String
precisionPoints Integer
faults String
intersectionID String
degree String

Occupant/addresses Resource

The occupants/addresses resource is similar to the addresses resource. Its response will include an About Query representation plus one site representation and occupant representation for each address matched.

Occupant Representation

Attribute Name Type
occupantName string
occupantID string
occupantAliasAddress string
occupantDescription string
contactEmail string
contactPhone string
contactFax string
websiteUrl string
imageUrl string
keywords string
businessCategoryClass string
businessCategoryDescription string
naicsCode string
dateOccupantUpdated string
dateOccupantAdded string
custodianId string
sourceDataId string

Geocoder

glossary

Clone this wiki locally