Data

Wimmera CMA Search API

data.gov.au
Wimmera CMA (Owned by)
Viewed: [[ro.stat.viewed]] Cited: [[ro.stat.cited]] Accessed: [[ro.stat.accessed]]
ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&rfr_id=info%3Asid%2FANDS&rft_id=http://data.gov.au/data/dataset/07b8a89d-c5d0-45b9-a86d-eb9c96570c6f&rft.title=Wimmera CMA Search API&rft.identifier=wimmera-cma-search-api&rft.publisher=data.gov.au&rft.description=API Data - Wimmera CMA Search API Docs - Search API for looking up addresses and roads within the catchment. The api can search for both address and road, or either. This dataset is updated weekly from VicMap Roads and Addresses, sourced via www.data.vic.gov.au.\r\n\r\n# Use\r\n\r\nThe Search API uses a data.gov.au datastore and allows a user to take full advantage of full test search functionality.\r\n\r\nAn sql attribute is passed to the URL to define the query against the API. Please note that the attribute must be URL encoded. The sql statement takes for form as below:\r\n\r\n```\r\nSELECT distinct display, x, y\r\nFROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a\r\nWHERE _full_text @@ to_tsquery(replace('[term]', ' ', ' %26 '))\r\nLIMIT 10\r\n```\r\n\r\nThe above will select the top 10 results from the API matching the input 'term', and return the display name as well as an x and y coordinate. \r\n\r\nThe full URL for the above query would be:\r\n\r\n```\r\nhttps://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT display, x, y FROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a WHERE _full_text @@ to_tsquery(replace('[term]', ' ', ' %26 ')) LIMIT 10)\r\n```\r\n\r\n# Fields\r\nAny field in the source dataset can be returned via the API. Display, x and y are used in the example above, but any other field can be returned by altering the select component of the sql statement. See examples below.\r\n\r\n# Filters\r\nSearch data sources and LGA can also be used to filter results. When not using a filter, the API defaults to using all records. See examples below.\r\n\r\n## Source Dataset\r\nA filter can be applied to select for a particular source dataset using the 'src' field. The currently available datasets are as follows:\r\n\r\n - **1** for Roads\r\n - **2** for Address\r\n - **3** for Localities\r\n - **4** for Parcels (CREF and SPI)\r\n - **5** for Localities (Propnum)\r\n\r\n## Local Government Area\r\nFilters can be applied to select for a specific local government area using the 'lga_code' field. LGA codes are derrived from Vicmap LGA datasets. Wimmeras LGAs include:\r\n\r\n - **332** Horsham Rural City Council\r\n - **330** Hindmarsh Shire Council\r\n - **357** Northern Grampians Shire Council\r\n - **371** West Wimmera Shire Council\r\n - **378** Yarriambiack Shire Council\r\n\r\n# Examples\r\n**Search for the top 10 addresses and roads with the word 'darlot' in their names:**\r\n\r\n```\r\nSELECT distinct display, x, y FROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a WHERE _full_text @@ to_tsquery(replace('darlot', ' ', ' & ')) LIMIT 10)\r\n```\r\n[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replace\\(%27darlot%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20LIMIT%2010)\r\n\r\n**Search for all roads with the word 'perkins' in their names:**\r\n\r\n```\r\nSELECT distinct display, x, y FROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a WHERE _full_text @@ to_tsquery(replace('perkins', ' ', ' %26 ')) AND src=1\r\n```\r\n[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replacE\\(%27perkins%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20AND%20src=1)\r\n\r\n**Search for all addresses with the word 'kalimna' in their names, within Horsham Rural City Council:**\r\n\r\n```\r\nSELECT distinct display, x, y FROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a WHERE _full_text @@ to_tsquery(replace('kalimna', ' ', ' %26 ')) AND src=2 and lga_code=332\r\n```\r\n[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replace\\(%27kalimna%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20AND%20src=2%20and%20lga_code=332)\r\n\r\n**Search for the top 10 addresses and roads with the word 'green' in their names, returning just their display name, locality, x and y:**\r\n\r\n```\r\nSELECT distinct display, locality, x, y FROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a WHERE _full_text @@ to_tsquery(replace('green', ' ', ' %26 ')) LIMIT 10\r\n```\r\n[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20locality,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replace\\(%27green%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20LIMIT%2010)\r\n\r\n**Search all addresses in Hindmarsh Shire:**\r\n\r\n```\r\nSELECT distinct display, locality, x, y FROM 4bf30358-6dc6-412c-91ee-a6f15aaee62a WHERE lga_code=330\r\n```\r\n[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20locality,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20lga_code=330)&rft.creator=Wimmera CMA&rft.date=2023&rft.coverage=http://services.land.vic.gov.au/catalogue/publicproxy/guest/dv_geoserver/datavic/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=datavic:CATCHMENTS_CMA100&SRSNAME=EPSG:4283&cql_filter=CMA_NO=2&rft_rights=Creative Commons Attribution 2.5 Australia http://creativecommons.org/licenses/by/2.5/au/&rft_subject=api&rft_subject=road&rft_subject=search&rft.type=dataset&rft.language=English Access the data

Licence & Rights:

Open Licence view details
CC-BY

Creative Commons Attribution 2.5 Australia
http://creativecommons.org/licenses/by/2.5/au/

Access:

Open

Brief description

Search API for looking up addresses and roads within the catchment. The api can search for both address and road, or either. This dataset is updated weekly from VicMap Roads and Addresses, sourced via www.data.vic.gov.au.

# Use

The Search API uses a data.gov.au datastore and allows a user to take full advantage of full test search functionality.

An sql attribute is passed to the URL to define the query against the API. Please note that the attribute must be URL encoded. The sql statement takes for form as below:

```
SELECT distinct display, x, y
FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a"
WHERE _full_text @@ to_tsquery(replace('[term]', ' ', ' %26 '))
LIMIT 10
```

The above will select the top 10 results from the API matching the input 'term', and return the display name as well as an x and y coordinate.

The full URL for the above query would be:

```
https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT display, x, y FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a" WHERE _full_text @@ to_tsquery(replace('[term]', ' ', ' %26 ')) LIMIT 10)
```

# Fields
Any field in the source dataset can be returned via the API. Display, x and y are used in the example above, but any other field can be returned by altering the select component of the sql statement. See examples below.

# Filters
Search data sources and LGA can also be used to filter results. When not using a filter, the API defaults to using all records. See examples below.

## Source Dataset
A filter can be applied to select for a particular source dataset using the 'src' field. The currently available datasets are as follows:

- **1** for Roads
- **2** for Address
- **3** for Localities
- **4** for Parcels (CREF and SPI)
- **5** for Localities (Propnum)

## Local Government Area
Filters can be applied to select for a specific local government area using the 'lga_code' field. LGA codes are derrived from Vicmap LGA datasets. Wimmeras LGAs include:

- **332** Horsham Rural City Council
- **330** Hindmarsh Shire Council
- **357** Northern Grampians Shire Council
- **371** West Wimmera Shire Council
- **378** Yarriambiack Shire Council

# Examples
**Search for the top 10 addresses and roads with the word 'darlot' in their names:**

```
SELECT distinct display, x, y FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a" WHERE _full_text @@ to_tsquery(replace('darlot', ' ', ' & ')) LIMIT 10)
```
[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replace\\(%27darlot%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20LIMIT%2010)

**Search for all roads with the word 'perkins' in their names:**

```
SELECT distinct display, x, y FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a" WHERE _full_text @@ to_tsquery(replace('perkins', ' ', ' %26 ')) AND src=1
```
[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replacE\\(%27perkins%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20AND%20src=1)

**Search for all addresses with the word 'kalimna' in their names, within Horsham Rural City Council:**

```
SELECT distinct display, x, y FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a" WHERE _full_text @@ to_tsquery(replace('kalimna', ' ', ' %26 ')) AND src=2 and lga_code=332
```
[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replace\\(%27kalimna%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20AND%20src=2%20and%20lga_code=332)

**Search for the top 10 addresses and roads with the word 'green' in their names, returning just their display name, locality, x and y:**

```
SELECT distinct display, locality, x, y FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a" WHERE _full_text @@ to_tsquery(replace('green', ' ', ' %26 ')) LIMIT 10
```
[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20locality,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20_full_text%20@@%20to_tsquery\\(replace\\(%27green%27,%20%27%20%27,%20%27%20%26%20%27\\)\\)%20LIMIT%2010)

**Search all addresses in Hindmarsh Shire:**

```
SELECT distinct display, locality, x, y FROM "4bf30358-6dc6-412c-91ee-a6f15aaee62a" WHERE lga_code=330
```
[example](https://data.gov.au/api/3/action/datastore_search_sql?sql=SELECT%20distinct%20display,%20locality,%20x,%20y%20FROM%20%224bf30358-6dc6-412c-91ee-a6f15aaee62a%22%20WHERE%20lga_code=330)

Full description

API Data -
Wimmera CMA Search API Docs -

This dataset is part of a larger collection

Click to explore relationships graph

Spatial Coverage And Location

text: http://services.land.vic.gov.au/catalogue/publicproxy/guest/dv_geoserver/datavic/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=datavic:CATCHMENTS_CMA100&SRSNAME=EPSG:4283&cql_filter=CMA_NO=2

Subjects
api | road | search |

User Contributed Tags    

Login to tag this record with meaningful keywords to make it easier to discover

Identifiers