Tutorials

Here are some examples of how data can be discovered and extracted from the AURIN OpenAPI once you have your username and password. Please click on the headings to expand content:

[expand title=”Accessing via QGIS” tag=”h2″] QGIS is a free and open Desktop GIS. To connect to AURIN OpenAPI data from QGIS, please follow these steps:

  1. Go to Layer > Add Layer > Add WFS Layer
    Screenshot 2016-04-29 16.14.21
  2. Create a new connection like ‘AURIN API’, set URL to http://openapi.aurin.org.au/wfs?version=1.1.0& and enter your credentials
  3. Once connected, you can see a list of available datasets:
    image005.jpg
  4. Select a dataset you want to open. You will need to enter your credentials again.
[/expand] [expand title=”CSW: getting the capabilities of the metadata service” tag=”h2″]
curl -X GET "http://openapi.aurin.org.au/csw?request=GetCapabilities&service=CSW" --user "username:password"

The result is an XML document listing the operation that can be executed on the CSW service to query metadata and discover datasets of interest.
[/expand] [expand title=”CSW: filtering metadata” tag=”h2″] The following request selects all the datasets that have a the “environment” keyword:

curl -X GET "http://openapi.aurin.org.au/csw?request=GetRecords&service=CSW&version=2.0.2&typeNames=csw:Record&elementSetName=summary&resultType=results&constraintLanguage=CQL_TEXT&constraint_language_version=1.1.0&constraint=subject+LIKE+%27environment%27" --user "username:password"

The result is an XML document that describe the datasets that satisfy the filter constraints:

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://oa-1-computing:8081/geoserver/schemas/csw/2.0.2/record.xsd">
 <csw:SearchStatus timestamp="2016-07-29T06:10:59.897Z"/>
 <csw:SearchResults numberOfRecordsMatched="1" numberOfRecordsReturned="1" nextRecord="0" elementSet="summary">
 <csw:SummaryRecord>
 <dc:identifier>aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2</dc:identifier>
 <dc:title>datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2</dc:title>
 <dc:type>http://purl.org/dc/dcmitype/Dataset</dc:type>
 <dc:subject>census</dc:subject>
 <dc:subject>regional profile</dc:subject>
 <dc:subject>nrp</dc:subject>
 <dc:subject>environment</dc:subject>
 <dc:subject>water</dc:subject>
 <dc:subject>farms</dc:subject>
 <dc:subject>protected areas</dc:subject>
 <dc:subject>energy</dc:subject>
 <dct:abstract>Abstract: The National Regional Profile (NRP) presents, for all Australia, a range of data for various types of small regions. Data are available for Local Government Areas, Statistical Areas Levels 2 and other larger geographies. The NRP is intended for users interested in the characteristics of regions and in comparing regions across Australia. Data are in time series, where available. Data sourced from: &lt;a href='http://stat.abs.gov.au/' target="_blank"&gt;http://stat.abs.gov.au/&lt;/a&gt;. Refer to the source data for further information: &lt;a href='http://www.abs.gov.au/AUSSTATS/abs@.nsf/exnote/1379.0.55.001' target="_blank"&gt;http://www.abs.gov.au/AUSSTATS/abs@.nsf/exnote/1379.0.55.001&lt;/a&gt;. For further information about these and related statistics, contact the National Information and Referral Services on 1300 135 070. Data current as of 29/06/2015. Temporal extent start: 2009-01-01T00:00:00 Temporal extent end: 2013-12-31T00:00:00 Australian Bureau of Statistics Locked Bag 10 Belconnen 2616 ACT Australia Attributes: gid ( Unique Identifier. Unique Identifier ) : java.lang.Integer [ ], sa2_main11 ( Statistical Area Level 2 (SA2) Code. SA2 Code ) : java.lang.String [ ], sa2_name11 ( Statistical Area Level 2 (SA2) Name. SA2 Name ) : java.lang.String [ ], year_ ( Year. Year ) : java.lang.Integer [ ], land_area ( LAND: Land Area (Ha). Year ended 30 June. LAND AREA (ha) (Hectares) ) : java.lang.Double [ ], water_2 ( WATER_2: Water Use on Australian Farms - Area of agricultural land (ha '000). Year ended 30 June. WATER USE ON AUSTRALIAN FARMS - Area of agricultural land (ha) (Hectares) ) : java.lang.Integer [ ], water_3 ( WATER_3: Water Use on Australian Farms - Area irrigated (ha '000). Year ended 30 June. WATER USE ON AUSTRALIAN FARMS - Area irrigated (ha) (Hectares) ) : java.lang.Double [ ], water_4 ( WATER_4: Water Use on Australian Farms - Volume of water applied (ML). Year ended 30 June. WATER USE ON AUSTRALIAN FARMS - Volume of water applied (ML) (Megalitres) ) : java.lang.Double [ ], water_5 ( WATER_5: Water Use on Australian Farms - Water for other agricultural uses (ML). Year ended 30 June. WATER USE ON AUSTRALIAN FARMS - Water for other agri uses (ML) (Megalitres) ) : java.lang.Double [ ], water_6 ( WATER_6: Water Use on Australian Farms - Total water use (ML). Year ended 30 June. WATER USE ON AUSTRALIAN FARMS - Total water use (ML) (Megalitres) ) : java.lang.Double [ ], water_7 ( WATER_7: Water Use on Australian Farms - Application rate - Total area watered and used (ML/ha). Year ended 30 June. WATER USE ON AUSTRALIAN FARMS - Application rate - area watered and used (ML/ha) (Megalitres per hectare) ) : java.lang.Double [ ], prot_ae_2 ( PROTECTED_AREA_2: Protected Areas - Indigenous Protected Area (no.). PROTECTED AREAS - Indigenous Protected Area (no) (Number) ) : java.lang.Integer [ ], prot_ae_3 ( PROTECTED_AREA_3: Protected Areas - National Parks (no.). PROTECTED AREAS - National Parks (no) (Number) ) : java.lang.Integer [ ], prot_ae_4 ( PROTECTED_AREA_4: Protected Areas - Nature Reserves (no.). PROTECTED AREAS - Nature Reserves (no) (Number) ) : java.lang.Integer [ ], prot_ae_5 ( PROTECTED_AREA_5: Protected Areas - All Other Protected Areas (no.). PROTECTED AREAS - All Other Protected Areas (no) (Number) ) : java.lang.Integer [ ], prot_ae_6 ( PROTECTED_AREA_6: Protected Areas - Total (no.). PROTECTED AREAS - Total (no) (Number) ) : java.lang.Integer [ ], prot_ae_7 ( PROTECTED_AREA_7: Protected Areas - Indigenous Protected Area (ha). PROTECTED AREAS - Indigenous Protected Area (ha) (Hectares) ) : java.lang.Integer [ ], prot_ae_8 ( PROTECTED_AREA_8: Protected Areas - National Parks (ha). PROTECTED AREAS - National Parks (ha) (Hectares) ) : java.lang.Integer [ ], prot_ae_9 ( PROTECTED_AREA_9: Protected Areas - Nature Reserves (ha). PROTECTED AREAS - Nature Reserves (ha) (Hectares) ) : java.lang.Integer [ ], prot_ae_10 ( PROTECTED_AREA_10: Protected Areas - All Other Protected Areas (ha). PROTECTED AREAS - All Other Protected Areas (ha) (Hectares) ) : java.lang.Integer [ ], prot_ae_11 ( PROTECTED_AREA_11: Protected Areas - Total (ha). PROTECTED AREAS - Total (ha) (Hectares) ) : java.lang.Integer [ ], prot_ae_12 ( PROTECTED_AREA_12: Protected Areas - Indigenous Protected Area (%). PROTECTED AREAS - Indigenous Protected Area (%) (Percent) ) : java.lang.Double [ ], prot_ae_13 ( PROTECTED_AREA_13: Protected Areas - National Parks (%). PROTECTED AREAS - National Parks (%) (Percent) ) : java.lang.Double [ ], prot_ae_14 ( PROTECTED_AREA_14: Protected Areas - Nature Reserves (%). PROTECTED AREAS - Nature Reserves (%) (Percent) ) : java.lang.Double [ ], prot_ae_15 ( PROTECTED_AREA_15: Protected Areas - All Other Protected Areas (%). PROTECTED AREAS - All Other Protected Areas (%) (Percent) ) : java.lang.Double [ ], prot_ae_16 ( PROTECTED_AREA_16: Protected Areas - Total (%). PROTECTED AREAS - Total (%) (Percent) ) : java.lang.Double [ ], energy_2 ( ENERGY_2: Energy Supply and Generation - Residential dwellings - Generating meters (no.). Year ended 31 December. ENERGY SUPPLY &amp; GENERATION - RESIDENTIAL DWELLINGS - Generating meters (no.) (Number) ) : java.lang.Integer [ ], energy_3 ( ENERGY_3: Energy Supply and Generation - Residential dwellings - Non-generating meters (no.). Year ended 31 December. ENERGY SUPPLY &amp; GENERATION - RESIDENTIAL DWELLINGS - Non-generating meters (no.) (Number) ) : java.lang.Integer [ ], energy_4 ( ENERGY_4: Energy Supply and Generation - Residential dwellings - Total (no.). Year ended 31 December. ENERGY SUPPLY &amp; GENERATION - RESIDENTIAL DWELLINGS - Total meters (no.) (Number) ) : java.lang.Integer [ ], energy_5 ( ENERGY_5: Energy Supply and Generation - Residential dwellings - Percentage of metered dwellings that generate electricity (%). Year ended 31 December. ENERGY SUPPLY &amp; GENERATION - RESIDENTIAL DWELLINGS - % of metered dwellings that generate elec. (%) (Percent) ) : java.lang.Double [ ], energy_7 ( ENERGY_7: Median Kilowatt Hours Supplied from Grid - Net meters (no.). Year ended 31 December. MEDIAN KILOWATT HOURS SUPPLIED FROM GRID - Net meters (KWH) (Kilowatt Hours) ) : java.lang.Integer [ ], energy_8 ( ENERGY_8: Median Kilowatt Hours Supplied from Grid - Gross meters (no.). Year ended 31 December. MEDIAN KILOWATT HOURS SUPPLIED FROM GRID - Gross meters (KWH) (Kilowatt Hours) ) : java.lang.Integer [ ], energy_9 ( ENERGY_9: Median Kilowatt Hours Supplied from Grid - Non-generating meters (no.). Year ended 31 December. MEDIAN KILOWATT HOURS SUPPLIED FROM GRID - Non-Generating meters (KWH) (Kilowatt Hours) ) : java.lang.Integer [ ], shape_leng ( Shape Length ) : java.lang.Double [ ], shape_area ( Shape Area ) : java.lang.Double [ ], geom ( Geometry ) : java.lang.com.vividsolutions.jts.geom.MultiPolygon [ ]</dct:abstract>
 <ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326">
 <ows:LowerCorner>-43.90438465387395 112.69017028808601</ows:LowerCorner>
 <ows:UpperCorner>-10.802041055505518 159.34016418457</ows:UpperCorner>
 </ows:BoundingBox>
 </csw:SummaryRecord>
 </csw:SearchResults>
</csw:GetRecordsResponse>
[/expand] [expand title=”WFS: describing a dataset” tag=”h2″] The following request returns the attributes of a given dataset (the dataset name can be inferred from the result for the preceding request):

curl -X GET "http://openapi.aurin.org.au/wfs?request=DescribeFeatureType&service=WFS&version=1.1.0&typeName=aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2" --user "username:password"

Which returns:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:aurin="http://www.aurin.org.au" xmlns:gml="http://www.opengis.net/gml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.aurin.org.au">
 <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://oa-1-computing:8081/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
 <xsd:complexType name="datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2Type">
 <xsd:complexContent>
 <xsd:extension base="gml:AbstractFeatureType">
 <xsd:sequence>
 <xsd:element maxOccurs="1" minOccurs="1" name="gid" nillable="false" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="sa2_main11" nillable="true" type="xsd:string"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="sa2_name11" nillable="true" type="xsd:string"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="year_" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="land_area" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="water_2" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="water_3" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="water_4" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="water_5" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="water_6" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="water_7" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_2" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_3" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_4" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_5" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_6" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_7" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_8" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_9" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_10" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_11" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_12" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_13" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_14" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_15" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="prot_ae_16" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_2" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_3" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_4" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_5" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_7" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_8" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="energy_9" nillable="true" type="xsd:int"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="shape_leng" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="shape_area" nillable="true" type="xsd:decimal"/>
 <xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:MultiSurfacePropertyType"/>
 </xsd:sequence>
 </xsd:extension>
 </xsd:complexContent>
 </xsd:complexType>
 <xsd:element name="datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2" substitutionGroup="gml:_Feature" type="aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2Type"/>
</xsd:schema>
[/expand] [expand title=”WFS: extracting the actual data” tag=”h2″] The following request selects the first 2 rows of the selected dataset, selecting only the land_area and energy_2 attributes:

curl -X GET "http://openapi.aurin.org.au/wfs?request=GetFeature&service=WFS&version=1.1.0&TypeName=aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2&MaxFeatures=2&PropertyName=land_area,energy_2" --user "username:password"

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:aurin="http://www.aurin.org.au" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfFeatures="2" timeStamp="2016-07-29T06:22:23.867Z" xsi:schemaLocation="http://www.opengis.net/wfs http://oa-2-computing:8081/geoserver/schemas/wfs/1.1.0/wfs.xsd http://www.aurin.org.au http://oa-2-computing:8081/geoserver/aurin/wfs?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typeName=aurin%3Adatasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2">
 <gml:boundedBy>
 <gml:Envelope srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4283">
 <gml:lowerCorner>-35.11278100499999 149.00284016000012</gml:lowerCorner>
 <gml:upperCorner>-33.88782838749995 150.33353008000006</gml:upperCorner>
 </gml:Envelope>
 </gml:boundedBy>
 <gml:featureMembers>
 <aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2 gml:id="datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2.1">
 <gml:boundedBy>
 <gml:Envelope srsName="urn:x-ogc:def:crs:EPSG:4283" srsDimension="2">
 <gml:lowerCorner>-34.7938 149.6543</gml:lowerCorner>
 <gml:upperCorner>-34.6956 149.7759</gml:upperCorner>
 </gml:Envelope>
 </gml:boundedBy>
 <aurin:gid>1</aurin:gid>
 <aurin:land_area>6464.40000000</aurin:land_area>
 <aurin:energy_2>164</aurin:energy_2>
 </aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2>
 <aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2 gml:id="datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2.2">
 <gml:boundedBy>
 <gml:Envelope srsName="urn:x-ogc:def:crs:EPSG:4283" srsDimension="2">
 <gml:lowerCorner>-35.1128 149.0028</gml:lowerCorner>
 <gml:upperCorner>-33.8878 150.3335</gml:upperCorner>
 </gml:Envelope>
 </gml:boundedBy>
 <aurin:gid>2</aurin:gid>
 <aurin:land_area>903511.500000</aurin:land_area>
 <aurin:energy_2>158</aurin:energy_2>
 </aurin:datasource-AU_Govt_ABS-UoM_AURIN_DB_1_nrp_env_aust_sa2>
 </gml:featureMembers>
</wfs:FeatureCollection>
[/expand] [expand title=”GitHub Repository” tag=”H2″] This github repository contains additional examples and programming languages: https://github.com/AURIN/openapi-examples.
[/expand]