1470.0 - ABS Geospatial Web Services User Guide, 2015  
Latest ISSUE Released at 11:30 AM (CANBERRA TIME) 15/04/2015  First Issue
   Page tools: Print Print Page Print all pages in this productPrint All RSS Feed RSS Bookmark and Share Search this Product

HOW TO USE ABS GEOSPATIAL WEB SERVICES


The ABS geospatial web services are provided as ESRI RESTful services. This technical guide provides examples of the use of these services using the ESRI JavaScript API.


DEVELOPMENT ENVIRONMENT SET UP

Set up your development environment by following this guide:

https://developers.arcgis.com/javascript/jsapi/api_devenv.html


Using ABS Geospatial Web Services

This section provides a simple example of the computer code required to create a basic visualisation of ASGS boundaries using the ESRI JavaScript API and the ABS geospatial web services.

Creating a Basic Geospatial Web Application

Create an ArcGIS API for JavaScript Web application by following the tutorial found here:

https://developers.arcgis.com/javascript/jshelp/intro_firstmap_amd.html

When developing an Australian focused application it is useful to know the centre of Australia so that the application starts with the Australian continent in the view at an appropriate scale.

The ABS uses the following point as the centre of Australia and a zoom value of 4

To change the map to focus on Australia, change this line:

      center: [-56.049, 38.485],
      zoom: 4,
    to:
      center: [133.25, -24.15],
Note the US spelling.

Here is some example code showing how to do this:


<!DOCTYPE html>
<html>
<head>
<title>Statistical Area Level 4</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.13/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
<style>
html, body, #mapDiv{
padding: 0;
margin: 0;
height: 100%;
}
</style>

<script src="http://js.arcgis.com/3.13/"></script>
<script>
var map;
require([
"esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ArcGISTiledMapServiceLayer",
"dojo/domReady!"
], function(Map, ArcGISDynamicMapServiceLayer, Tiled) {
map = new Map("mapDiv", {
center: [133.25, -24.15],
zoom: 4,
basemap: "streets"
});

var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("http://www.censusdata.abs.gov.au/arcgis/rest/services/2011_SA4/MapServer");
dynamicMapServiceLayer.setMinScale(36112);
map.addLayer(dynamicMapServiceLayer);

var tiledMapServiceLayer = new Tiled("http://www.censusdata.abs.gov.au/arcgis/rest/services/2011_SA4/MapServer");
tiledMapServiceLayer.setMaxScale(7223);
map.addLayer(tiledMapServiceLayer);
});
</script>

</head>
<body class="claro">
<div id="mapDiv"></div>
</body>
</html>


Creating a Dynamic Map Service Layer

To view ABS boundaries on the map, you can load an ABS geospatial web service as a dynamic map service layer. In this example:

https://developers.arcgis.com/javascript/jssamples/map_dynamic.html

you would replace

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer

with the URL of the Geospatial Web Service that you want to load. A list of the web service URLs are provide here Geospatial Web Services provided by the ABS.


Creating a Cached Tiled Map Service Layer

To improve the performance of the ABS geospatial web services they have been cached between zoom levels 0 and 13. Here is an example of loading the cached version of a ABS geospatial web service:
https://developers.arcgis.com/javascript/jssamples/layers_ags_tiled.html

To change the map so that it only shows the cached map service layer at zoom levels 0-13 and the dynamic map service layer at zoom levels 14-19, use:

setMaxScale(7223); on the cached map service layer and
setMinScale(36112); on the dynamic map service layer.

This limits the zoom levels that they are displayed at. The scales for each of the zoom levels are listed under 'Levels of Detail in the Web service' in the 'Services Directory'.

To display information about individual regions in the Web service you can configure an InfoTemplate so that when a user clicks on a region, information about that region is displayed. Here is an example showing how to configure InfoTemplates on dynamic map service layers:

https://developers.arcgis.com/javascript/jssamples/map_twodynamic.html

Within the Web service in the 'Services Directory', if you click on the layer and scroll to the bottom, you can see what fields that layer has so that you can configure them in the InfoTemplate.


Useful References

The ArcGIS API for JavaScript documentation. [https://developers.arcgis.com/javascript/jsapi/]

If you have any questions about the ArcGIS API for JavaScript, check ESRI's GeoNet site for answers. [https://geonet.esri.com/welcome]