The Features API
What is Features
Features HTTP API performs a spacial query on a dataset using a RESTful interface.
URI Template
Requests for the Features HTTP API must include the base and request formats.
Base
The base format is made up of two parts, the base service location and the request:
https://data.nowwhere.com.au/features/features.svc/REQUEST
Request
The request format is made up of three parts, as follows:
FEATURE_CODE.RESPONSE_TYPE?PARAMETERS
Feature Code
FEATURE_CODE can be one of two values, either “all” to query on all accessible feature types or a particular feature code, for example “POI_FastFoodAu0909” to query over fast food restaurants only.
Response Type
RESPONSE_TYPE refers to how the service response will be formatted. Options here are “xml”, and “json”.
Parameters
PARAMETERS are query string parameters in the structure “key=value”. The following table describes the available parameters.
| Parameter | Type | Description |
|---|---|---|
| Pts | String | A collection of points to search around. Each point should be in the format “<longitude> <latitude>”. Points are separated with a comma. You cannot use this option with bbox. |
| Bbox | String | A bounding box which restricts results to items within its bounds. The query uses the left bottom and top right points in the format “<longitude> <latitude> , <longitude> <latitude>”. You cannot use this option with buffer or pts. |
| Buffer | Integer | The distance, in metres, from the defined points in which to search for features. Default= 1 metre. You cannot use this option with bbox. |
| Items | Integer | Maximum number of items to return. If not defined returns maximum. |
| Sortby | String | Tells the service to sort results by the chosen criteria, the default is to sort by “Feature_ID”. Any field name defined for the feature type can be specified. If this parameter is set to “distance” then the results are sorted according to radial distance from the first point in the pts parameter. Distance and Field sorting are mutually exclusive. |
| Filter | String | Allows for selection of records by filtering based on columns and values. This parameter is similar to the WHERE CLAUSE in SQLs. |
Example JSON
Finds the nearest 10 items to a point sorted by distance.
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.json?items=10&sortby=distance,pts=150.82 -34.016&buffer=5000
Finds 10 items within a bounding box
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.json?bbox=150.82 -34.016, 151.348 -33.724&items=10
Finds all items within a buffer to multiple points
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.json?pts=132 -50,132.1 -50.1, 132.2 -50.5&buffer=5000
Finds up to 100 items within a bounding box where the company name field contains "Subway" or "KFC"
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.json?items=100&filter=[(company Like "%Subway%" or company Like "%KFC%")]&bbox=151.07688598853%20-33.842355494582%20151.31412201147%20-33.804136234948
Example JSON response
{"type":"FeatureCollection",
"features":[ {"type":"Feature",
"geometry":{
"type":"Point",
"coordinates":[144.999235,-37.818291]},
"properties":{
"State":"VIC",
"Phone1":"0394277767",
"Fax":"",
"ExternalUri":"",
"Postcode":"3121",
"distance":"77",
"DisplayName":"McDonald's",
"FeatureId":"742aa26a-5412-4879-b30b-2a8798f7c61d",
"Street":"227 Church Street",
"Suburb":"Richmond",
"LastUpdated":"11/10/2010 3:00:13 PM",
"FeatureTypeId":"3f19c279-19de-4353-80c3-e0c16c644dca",
"Company":"McDonald's",
"GeocodeResult":"1"}},
{"type":"Feature",
"geometry":{
"type":"Point",
"coordinates":[144.998142,-37.818485]},
"properties":{
"State":"VIC",
"Phone1":"0394284048",
"Fax":"",
"ExternalUri":"",
"Postcode":"3121",
"distance":"154",
"DisplayName":"Subway",
"FeatureId":"c872b9c8-3723-48d9-96da-ff55995bf569",
"Street":"222 Bridge Road","Suburb":"Richmond",
"LastUpdated":"11/10/2010 3:00:13 PM",
"FeatureTypeId":"3f19c279-19de-4353-80c3-e0c16c644dca",
"Company":"Subway",
"GeocodeResult":"1"}},
{"type":"Feature",
"geometry":{
"type":"Point",
"coordinates":[144.99311,-37.8179]},
"properties":{
"State":"VIC",
"Phone1":"0394290160",
"Fax":"",
"ExternalUri":"http://www.hudsonscoffee.com.au",
"Postcode":"3121",
"distance":"602",
"DisplayName":"Hudsons Coffee Stores",
"FeatureId":"d34bbce7-755c-48bd-913d-1fd901cec983",
"Street":"89 Bridge Road",
"Suburb":"Richmond",
"LastUpdated":"11/10/2010 3:00:13 PM",
"FeatureTypeId":"3f19c279-19de-4353-80c3-e0c16c644dca",
"Company":"Hudsons Coffee Stores",
"GeocodeResult":"1"}}],
"properties":{"total":"3","items":"3"}
}
Example XML
Finds the nearest 10 items to a point sorted by distance.
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.xml?items=10&sortby=distance,pts=150.82 -34.016&buffer=5000
Finds 10 items within a bounding box
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.xml?bbox=150.82 -34.016, 151.348 -33.724&items=10
Finds all items within a buffer to multiple points
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.xml?pts=132 -50,132.1 -50.1, 132.2 -50.5&buffer=5000
Finds up to 100 items within a bounding box where the company name field contains "Subway" or "KFC"
https://data.nowwhere.com.au/features/features.svc/POI_FastFoodAu0909.xml?items=100&filter=[(company Like "%Subway%" or company Like "%KFC%")]&bbox=151.07688598853%20-33.842355494582%20151.31412201147%20-33.804136234948
Example XML response
<type>FeatureCollection</type>
<features>
<type>Feature</type>
<geometry>
<type>Point</type>
<coordinates>144.999235</coordinates>
<coordinates>-37.818291</coordinates>
</geometry>
<properties>
<State>VIC</State>
<Phone1>0394277767</Phone1>
<Fax/>
<ExternalUri/>
<Postcode>3121</Postcode>
<distance>77</distance>
<DisplayName>McDonald's</DisplayName>
<FeatureId>742aa26a-5412-4879-b30b-2a8798f7c61d</FeatureId>
<Street>227 Church Street</Street>
<Suburb>Richmond</Suburb>
<LastUpdated>11/10/2010 3:00:13 PM</LastUpdated>
<FeatureTypeId>3f19c279-19de-4353-80c3-e0c16c644dca</FeatureTypeId>
<Company>McDonald's</Company>
<GeocodeResult>1</GeocodeResult>
</properties>
</features>
<features>
<type>Feature</type>
<geometry>
<type>Point</type>
<coordinates>144.998142</coordinates>
<coordinates>-37.818485</coordinates>
</geometry>
<properties>
<State>VIC</State>
<Phone1>0394284048</Phone1>
<Fax/>
<ExternalUri/>
<Postcode>3121</Postcode>
<distance>154</distance>
<DisplayName>Subway</DisplayName>
<FeatureId>c872b9c8-3723-48d9-96da-ff55995bf569</FeatureId>
<Street>222 Bridge Road</Street>
<Suburb>Richmond</Suburb>
<LastUpdated>11/10/2010 3:00:13 PM</LastUpdated>
<FeatureTypeId>3f19c279-19de-4353-80c3-e0c16c644dca</FeatureTypeId>
<Company>Subway</Company>
<GeocodeResult>1</GeocodeResult>
</properties>
</features>
<features>
<type>Feature</type>
<geometry>
<type>Point</type>
<coordinates>144.99311</coordinates>
<coordinates>-37.8179</coordinates>
</geometry>
<properties>
<State>VIC</State>
<Phone1>0394290160</Phone1>
<Fax/>
<ExternalUri>http://www.hudsonscoffee.com.au</ExternalUri>
<Postcode>3121</Postcode>
<distance>602</distance>
<DisplayName>Hudsons Coffee Stores</DisplayName>
<FeatureId>d34bbce7-755c-48bd-913d-1fd901cec983</FeatureId>
<Street>89 Bridge Road</Street>
<Suburb>Richmond</Suburb>
<LastUpdated>11/10/2010 3:00:13 PM</LastUpdated>
<FeatureTypeId>3f19c279-19de-4353-80c3-e0c16c644dca</FeatureTypeId>
<Company>Hudsons Coffee Stores</Company>
<GeocodeResult>1</GeocodeResult>
</properties>
</features>
<properties>
<total>3</total>
<items>3</items>
</properties>
MapData Services API Suite