Wimmera CMA Search API
收藏Research Data Australia2024-12-21 收录
下载链接:
https://researchdata.edu.au/wimmera-cma-search-api/2996509
下载链接
链接失效反馈官方服务:
资源简介:
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)
提供机构:
data.gov.au



