-
Notifications
You must be signed in to change notification settings - Fork 19
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.
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
There are no API changes in v2.0.1
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/
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
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:
- 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
- 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:
- Geocode 456 Gorge Rd E, Victoria, BC
http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?addressString=456%20Gorge%20Rd%20e%20victoria%20bc
- Geocode 7-955 13th Ave, Valemount, BC
http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?addressString=7-955%2013th%20ave,%20Valemount,bc
- Geocode the intersection at Johnson and Government
http://apps.gov.bc.ca/pub/geocoder/addresses.xhtml?addressString=johnson%20and%20government
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
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.
Attribute Name | Type |
---|---|
searchTimestamp | Datetime |
executionTime | Real |
version | String |
minScore | Integer |
maxResults | Integer |
echo | Boolean |
interpolation | String |
outputSRS | Integer |
setBack | Real |
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 |
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 |
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.
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 |