ThinkSpatial’s ThinkMap

ThinkSpatial has built a project management solution using a blend of CAD and GIS. It allows users to review and share spatial information (drawings, photos, documents, etc.) with other users.

As we’ve have spent our time coding, rather than being creative, we’ve called it ThinkMap. You can check it out here.

The application is designed to give engineers access to the latest survey and design information and aerial imagery over any construction project. It has been optimised for both desktop and mobile devices and can be configured and deployed within minutes.

We are now using ThinkMap for all our medium-to-large projects, as are some of Australia’s largest construction and mining companies. It has streamlined workflows dramatically, with the ability to search, review and inform our clients and staff.

Announcing ThinkMap



We’ve been working with Google Earth KML files for a while, and while I’m sure there are plenty of articles detailing working with XML documents in SQL, I haven’t seen one that discusses KML and KML documents. Since KML is just structured XML, constructing Google Earth documents is just a matter of aggregating xmlelements into the KML schema.

In this post, we’re discussing using SQL XMLTypes to generate KML documents. The scripts created perform examples based on Oracle (10.2g) and PostgreSQL (9.3). For sample XML data we’ll be converting a GPX file to a KML document.


First, a couple of tricks when requesting the our GPX data from a URI.

For Oracle we’re selecting from a straight HTTPURITYPE request, so this will be easiest to test with.

In PostgreSQL we’ll need to create a foreign data wrapper with an XML callback (www_fdw). The script to load from our foreign table www_fdw_server_gpx can be found here, and the www_fdw extension can be found here (Windows build).

Oracle Example

 (SELECT EXTRACTVALUE (VALUE (tp), '*/@lon') x1,
         EXTRACTVALUE (VALUE (tp), '*/@lat') y1,
         EXTRACTVALUE (VALUE (tp), '*/ele', 'xmlns=""') z,
         TO_DATE (EXTRACTVALUE (VALUE (tp), '*/time', 'xmlns=""'),'YYYY-MM-DD"T"HH24:MI:SS"Z"') d,
         EXTRACTVALUE (VALUE (tp), '*/speed', 'xmlns=""') speed
      EXTRACT (
        HTTPURITYPE ('').getxml (),'//trkpt',
) tp)
   XMLATTRIBUTES ('' AS "xmlns",
  '' AS "xmlns:gx",
  '' AS "xmlns:kml",
  '' AS "xmlns:atom"
   XMLELEMENT ("Document",
     XMLELEMENT ("name", 'GPX Conversion'),
     XMLELEMENT ("open", 1),
     XMLELEMENT ("Folder",
       XMLELEMENT ("name", 'Waypoints'),
       XMLAGG (
         XMLELEMENT ("Placemark",
           XMLELEMENT ("Point",
             XMLELEMENT ("coordinates", x1 || ',' || y1)
       ) -- end xmlagg
     )  -- end folder
 ).getclobval() doc

PostgreSQL Example

    select lat,lng,ele,time,speed from www_fdw_server_gpx
SELECT  xmlelement(name "kml",
        xmlattributes ('' AS "xmlns",
              '' AS "xmlns:gx",
              ''AS "xmlns:kml",
              '' AS "xmlns:atom"),
        xmlelement(name "Document",
            xmlelement(name "name",'GPX Conversion'),
            xmlelement(name "open",1),
            xmlelement(name "Folder",
                xmlelement(name "name", 'Waypoints'),
                    xmlelement(name "Placemark",
                        xmlelement(name "Point",
                            xmlelement(name "coordinates", lng||', '||lat)
            ) -- end of folder
) To 'C:\Temp\gpx.kml'; -- or an appropriate location

So to generate ordinary KML documents, the SQL is pretty straight forward.

Of course, with a little more effort you can get some dynamic and useful KML documents. Check out this KML document that was created with this SQL code (Oracle version only). Click on the “Double Click me!” video tour in the left-hand panel. Enjoy the drive!

How to start Google Earth Tour


Over the last few years we’ve successfully delivered more asset capture and assessment projects than we care to remember! Many of these projects have been to capture and assess stormwater drainage assets (pits and pipes), which are usually owned by your local Council. We think the solution we’ve implemented is efficient, cost-effective, and can be used by just about anyone. Furthermore, it’s been rigorously tested and refined by our field crews on tens of thousands of pits and pipes. Read on to learn more about the system and its benefits.

Drainage Assets

Urban drainage assets are one of the most significant items on a Council’s balance sheet, yet there is often only limited (and inaccurate) information available on the number, condition, and value of these assets. In many cases, the number of assets can be underestimated by 30-40%. Furthermore, Council’s often base their decision making on a multitude of datasets, of wildly varying accuracies, which makes the task of managing drainage assets an impossible one.

These issues have a negative impact on the Council’s financial position, decision making, and ability to respond to events such as flooding. To address these issues ThinkSpatial has worked with Councils to develop an accurate and affordable asset capture system for stormwater drainage assets.

In the Field…

We employ a hybrid approach to asset capture that consists of survey-grade GNSS technology (positional accuracy of ±30mm) in conjunction with consumer-grade mobile devices (to capture asset attributes and photos).

Our approach minimises costs, as a professional surveyor with high-end equipment is only required for a brief period of time. The majority of the work (lifting, attribute collection, etc.) is performed using cheaper resources.

The drainage attributing software, which we developed, operates on a wide range of consumer-grade mobile devices and facilitates the entry of attributes such as pit and pipe sizes, materials, invert levels, condition, comments, and pipe connections. Once collected, attributes are automatically validated (in the field) before being stored in a centralised database. Attribute collection and validation is based on the D-SPEC standard.

Hello World

In the Office…

The collected data is processed on a desktop computer, linking pipes not linked in the field, and performing a variety of Quality Assurance procedures to ensure the drainage network is complete, logical, and accurate. Any queries are sent to the field crew to resolve.

The final products delivered to clients are:

  • Points feature layer for pits, with numerous attributes including: type, material, size, depth, condition, photo, and location details such as street and locality.
  • Lines feature layer representing pipes, containing attributes such as: diameter, length, material, upstream and downstream inverts, upstream and downstream pit ids, and location details such as street and locality.
  • Excel spreadsheet of the above attribute tables.

Hello World

Real-Time Project Tracking!

Throughout the survey and data collection stages, clients are given access to a project specific webmap to track progress in real-time. This has proven invaluable for demonstrating progress and even locating survey teams should there be community concerns. This is especially important on large-scale projects with staged invoicing and milestones to keep on top of. Clients are also able to download a snapshot of the data for reporting purposes.

Hello World

The Benefits…

The benefits derived from engaging ThinkSpatial to perform your Drainage Assessment Surveys include:

  • Accurately determine the number, condition, and capital value of drainage assets.
  • Confidently calculate depreciation, written down value, and remaining useful life of drainage assets.
  • Consistent, authoritative, and up-to-date drainage network dataset.
  • Make informed, evidence-based, decisions about future maintenance programmes.
  • Easily identify problematic “hotspots” in the drainage network.
  • Perform flood studies and/or hydraulic analysis to identify deficiencies in the drainage network.
  • Track project progress in real-time.

EC2 Scheduler

In this post I am going to talk a little bit about EC2 scaling and pricing then follow up talking about a solution I have implemented to try to minimise the costs associated with running EC2 using as little hands on management as possible.

The “Cloud”

Amazon Web Services (AWS) has been a goto solution for many of ThinkSpatial’s projects over the last few years. We have used the Elastic Compute Cloud (EC2) platform for a wide variety of applications and areas, including everything from hosting and development to deployment and testing. If you don’t know about EC2 or AWS in general, see Amazon Web Services to learn how it can help you. Amazon provides what’s called the “Free Usage Tier” where you can try out certain services that belong to the AWS package (to a limited extent) for free. Read the Free Usage Tier page to find out more information:

AWS is scalable, so the pricing changes depending on what level of scaling you use. You have to be careful, because if you don’t know exactly what you are doing you can get caught out by this and end up with a nasty bill from Amazon at the end of the month.

Pricing & Scalability

EC2 instances are costed per full hour, and that cost is based on the following factors:
- Scale
- Type (On-Demand, Reserved, Spot)
- Operating system
- Region

Linux/UNIX is cheaper than Windows and instances based in the USA are cheaper than instances in Sydney. A full guide by Amazon of the current instance pricing is found at the EC2 Pricing Guide and the particulars of the different factors is out of the scope of this post.

As an example of the difference in scalability throughout the EC2 range, the cheapest On-Demand instance available to users (prices in USD), is:
Scale: t1.micro
Operating System: Linux/UNIX
Region: US-East (N.Virginia)
Price per hour: $0.02 ($0.48 per day)

The micro instance is good for only minimal use. Micro instances typically throttle CPU time whenever CPU usage crosses a certain threshold so processing is completely out.

A mid range example based in Sydney would be:
Scale: m1.large
Operating System: Windows
Region: Asia Pacific (Sydney)
Price per hour: $0.460 ($11.04 per day)

The Problem

There is a huge difference in scale and pricing of these two instances. Running the larger instances is expensive, and can quickly send your AWS bill at the end of the month spiralling out of control if you don’t keep a close eye on it. The ability to stop your instances when you aren’t using them can be a big help with pricing. General administration of EC2 instances is done through the AWS dashboard and attempting to control potentially dozens or more instances through there can quickly eat up your time.

We have many instances that we use for hosted applications, many did not need to be running outside of business hours, so we decided that stopping the instances when they weren’t required would save some money. We needed to be able to automatically start and stop each instance based on a schedule that would be unique to each individual instance. AWS does not provide an easy solution for instance scheduling that we could apply to our current setup and requirements. We looked for instance scheduling solutions but were not happy with what was readily available on the market. Pre-existing solutions were either costly (some even went as far as charging you per instance stop and start), or did not meet our requirements. So we developed our own.

The ThinkSpatial EC2 Scheduler

The ThinkSpatial EC2 Scheduler is a lightweight command-line based utility for scheduling individual EC2 instances. A JavaScript application built on Node.js, it uses the Amazon Web Services Command Line Interface to query, start, stop and assign Elastic IP addresses.

It uses a configuration file where users can specify instances to act upon, along with their schedules. It sends emails out to instance subscribed users whenever there is an issue scheduling an instance.

As the configuration file is independant of the application, it can be stored anywhere and modified in an unlimited number of ways. We currently have the configuration file stored inside a Dropbox directory that instance administrators have access to. This allows each person with authorization to update the configuration file on the fly from their own computer without requiring users to access the application host server directly just to make the smallest schedule changes.

The EC2 Scheduler source is currently hosted on GitHub at and is available with the Apache 2.0 license. You can read more about it, download it and see documentation on how to install and use it at GitHub.

If you discover any issues with it, please either email me or post an issue to the GitHub issue tracker.

First Post!

We’ve been around too long without a blog. So here it is. Welcome to ThinkSpatial’s very own blog. We’ll be posting here every now and then with updates from the company, the awesome stuff we’re making, and any other cool things we find. Since this is the first real post it’s a good opportunity to show you what powers this site and how we made it.

There might be some bugs we’ve yet to squash, so bear with us while we get everything in its place.

Second Crack

This site is powered by a modified version of Marco Arment’s Second Crack, a simple blogging engine that creates posts from Markdown files stored in Dropbox. The changes we made are little things that make things easier for us to forget PHP and focus on our JavaScript.

Every bit of content is delivered from Markdown files in dropbox. This allows us to quickly update content without having to mess with any clunky content management systems.


As you can see on our shiny new home page, the background of our hero is a map. We chose Leaflet to power our maps because…

  • It works great on mobile devices
  • It’s fast
  • It’s awesome

There’s a little magic thrown in to handle transitioning between hero pages and displaying content, but Leaflet’s simplicity allowed us to quickly build a cool looking map we can fill with whatever spatial data we want.

The Rest

HTML5, JavaScript, CSS3, and the other usual suspects like jQuery, Underscore, and Typekit also help to power this site. Using these technologies has allowed us to create a modern and unique website that works well on all devices. We will dive into more of our technology stack in future posts, so don’t forget to check back soon as new posts go up every fortnight.

Baw Baw Shire Drainage Survey

ThinkSpatial was recently engaged by the Baw Baw Shire Council to undertake a comprehensive survey of the Council’s drainage assets. ThinkSpatial will survey approximately 10,000 pits and associated pipes throughout the Council, in both urban and rural areas. In addition, attribute and condition data (including photos) will be collected to assist the Council in the valuation of their asset base.

To assist the Council with tracking the progess of the survey works (and associated condition assesment) ThinkSpatial provided an interactive webmap for use by the Council’s engineers. The webmap provided a visual indication of progress (in real-time) and useful statistics such as the pits lifted/surveyed per day.

Greening the West

In May-June 2012 ThinkSpatial undertook the Mobile Laser Scanning of 7kms of Geelong Rd for the Greening the West Alliance (City West Water, VicRoads, three councils, and other participants). The data collection component took a single day (compared to weeks of on-foot feature survey) and the data processing (for engineering purposes) a few weeks.

In addition to the extensive feature data collected, the location, height, and diameter of every tree along the 7km route was mapped. This data was then uploaded to mobile devices (iPad) and a field assessment of the tree species and health was performed. The resulting information was provided to the Greening the West program as digital data and via an interactive webmap.

Borehole Surveys

Over the past 10 years ThinkSpatial has provided Cardno Lane Piper (previously Lane Piper) with borehole surveys at various sites throughout Victoria. These surveys have involved determining AHD heights on borehole casings and standpipes using a combination of digital levelling and GNSS.

Urban Design Feature Surveys

For a number of years ThinkSpatial has provided the Maribyrnong City Council with feature and detail surveys for urban design and civil engineering purposes. The surveys of local roads, reserves, parks, and precincts have often been completed in short timeframes and to a tight budget. In addition to the feature surveys ThinkSpatial has also integrated previous survey data, digitised features from aerial photography, and provided advice on survey options to the Council.

Cardinia Connection Alliance

ThinkSpatial was contracted by John Holland to provide surveying services during the construction of the Cardinia Desalination Pipeline. Construction began in March 2010 and was completed in early 2011.

ThinkSpatial provided a range of surveying services for the project including the establishment and verification of survey control, feature surveys, pipe setout, as-constructed data collection, and the setout of structures such as pump stations, chutes, and outlets. ThinkSpatial is also provided design model management and survey management services to the project.

Burrumbeet Flood Study

ThinkSpatial was engaged by Water Technology to undertake structure detail surveys, cross section surveys, and obtain floor levels as part of the Burrumbeet Flood Study. Approximately 35 structures (bridges, culverts, drains, pipes, and channels) and associated cross sections were surveyed. A number of these structures were located along the Western Highway and required particularly attention to OHS requirements (due to their large size and highly trafficked location). In addition, floor levels for approximately 30 properties were collected using a combination of GNSS and digital levelling.

Data delivery for this project consisted of an ArcGIS MXD containing the collected survey data (sections, structure details, floor levels) with the data provided in appropriate VFD layers. In addition, hyperlinked photos and sketches of the structures were provided within the GIS.

Channel Remediation Surveys

Over the past three years ThinkSpatial has been contracted by the Northern Victorian Irrigation Renewal Project (NVIRP) and its successor G-MW Connections, to undertake engineering surveys of channels throughout the Goulburn Murray Irrigation District. These surveys have included establishing survey control, feature and detail surveys of channels and channel structures, and the collection of both long and cross sections at various intervals.

In addition to the collection of accurate and timely survey data ThinkSpatial was also required to provide detailed plans, including the production of longitudinal and cross section plans. The final stage of each survey involves the set-out of title boundaries and easements for construction purposes.

We are spatial information specialists who utilise advanced technologies and techniques to solve your spatial information problems. Our expertise and skills in surveying, intelligent mapping, and spatial software development allow us to deliver innovative and efficient solutions, tailored to your needs.

In 2012, ThinkSpatial completed the Integrated Eye on the Reef (iEotR) web application for the Great Barrier Reef Marine Park Authority (GBRMPA). Prior to the development of the application, GBRMPA had three paper-based reef monitoring programs — Reef Health, Eye on the Reef, and BleachWatch. ThinkSpatial amalgamated, spatially enabled, and modernised these monitoring programs, thereby allowing the entire GBRMPA community (scientists, government agencies, tourism operators, and the public) to fully participate in GBRMPA's efforts to monitor the health of the reef.

The iEotR web application addresses two key objectives of GBRMPA's strategy for monitoring the health of the Great Barrier Reef. Firstly, iEotR efficiently collects reef health data via simple, intuitive, and intelligent data collection mechanisms (both online and offline). The data collected by the various monitoring programs is stored in a single database environment with a shared, spatially-enabled, data model. Secondly, ThinkSpatial's approach to the problems posed by managing data from three distinct monitoring programs has enabled GBRMPA to quickly and easily analyse the collected data to obtain information and knowledge about the health of the reef, which allows the various stakeholders to make informed management decisions. To accomplish this objective ThinkSpatial built powerful mapping, reporting, and charting tools into the iEotR that provide a variety of customised outputs, each of which addresses the needs of GBRMPA's stakeholders.

Warrandyte Backlog Sewer

ThinkSpatial recently completed the surveying and processing of a backlog sewer network in Warrandyte for GHD and Yarra Valley Water. The project involved the detailed feature survey of more than 30km of sewer network (including existing sewer and drainage assets). The sewer network services approximately 700 properties in the area. The project was undertaken by multiple survey crews within an extremely short timeframe (8 weeks for the bulk of the survey work).

In addition to the supply of engineering survey services, ThinkSpatial also organised for the provision of LiDAR data for the project (to minimise the amount of survey required in backyards — a significant cost saving measure).

In 2011, ThinkSpatial was engaged by John Holland to provide Survey Management services during the design and construction phases of the South Morang Rail Extension Project (SMREP).

ThinkSpatial provided a point of connection between the SMREP design team and the SMREP construction and delivery teams. ThinkSpatial's role was that of a gatekeeper for the issuing of design information (such as survey design models) by fielding requests and issuing models to relevant/appropriate persons. ThinkSpatial was also responsible for the collation and quality assurance of as-constructed data and for the timely delivery of this information to the SMREP design team and responsible authorities.

ThinkSpatial was recently engaged by the Moorabool Shire Council to undertake a comprehensive survey of the Council’s drainage network. The project commenced in January 2012 and will run until July 2014.

During this project ThinkSpatial will survey approximately 4500 pits and 5100 pipes as well as collect attribute and condition data in accordance with D-Spec. The drainage assets are located throughout the Council and include both urban and semi-rural areas.

The initial phase of the project (an audit of existing survey data) was completed in January 2013. Survey of the remaining pits and pipes commenced in mid-February and will continue at a steady pace over the next two years.

Sightings Network

ThinkSpatial, in conjunction with the Great Barrier Reef Marine Park Authority (GBRMPA) has designed and developed a novel crowd-sourcing application to monitor wildlife activity and incidents within the Great Barrier Reef Marine Park.

The web and mobile applications, known as the Sightings Network, combine spatial information, images, videos, and social media (Facebook) to engage the community in the management of the Great Barrier Reef. In return, the GBRMPA gains valuable macro level scientific data on health of reef and real-time notification of marine incidents.

Get it at the App Store Get it on Google Play

Rural Levees Assessment

ThinkSpatial, in collaboration with Water Technology, recently completed the survey and risk assessment of ~600km of levees throughout Northern Victoria, primarily along the Goulburn and Murray Rivers. The surveys were conducted for the Goulburn Broken CMA, North Central CMA, and the North Eastern CMA over a period of 12 months.

ThinkSpatial surveyed cross sections, longitudinal sections, geotagged photos, and any points of weakness that may have impacted on the integrity of the levee. The resulting data was used by Water Technology to determine existing levels of protection offered by the levees as well as prioritisation and costing of repairs.

Throughout the project ThinkSpatial provided the CMAs with interactive webmaps to track the progress of the survey. Deliverables included topographic data, long section plans, cross section plans, the points of weakness (and the associated risk assessment), and photos.

Esperance Port Access Corridor

The Esperance Port Access Corridor is a $126 million upgrade of the rail corridor into the Esperance Port, located in Western Australia. The project, which is expected to take 18 months to complete, consists of a rail tunnel, extensive rail duplication, numerous bridges, roads, retaining walls, and the upgrade of underground services. In late 2012, ThinkSpatial was engaged by John Holland to provide the surveying and spatial data management services for the duration of the project.

The surveying component of the project has involved the establishment of a survey control network, structure monitoring, setout surveys, as-built surveys, feature surveys, laser scanning, and the acquisition of aerial imagery using an Unmanned Aerial System.

In addition to providing the full range of surveying services ThinkSpatial has developed and manages the site-wide Geographic Information System (GIS). The GIS, a custom-built web mapping application, provides a variety of measurement, analysis, and printing tools in a familiar mapping interface and is constantly updated with the latest design data, as-built data, reports, and aerial imagery. The application has proven to be extremely useful for the construction management team, site engineers, foreman, and surveyors.

Geoid Correction Modelling

ThinkSpatial, in conjunction with Barwon Water and the Department of Environment and Primary Industries, has developed a Geoid Correction Model (GCM) for Greater Melbourne. The GCM was completed in 2008 and was primarily used in conjunction with AUSGeoid98 to directly determine accurate Australian Height Datum (AHD) heights. A version of the GCM was also developed for AUSGeoid09, but the improved AHD accuracy provided by AUSGeoid09 means the GCM offers only a minor improvement.

Geoid Correction Model

Developing the GCM involved a high quality GPS survey (and associated data processing) of numerous high-stability benchmarks to obtain accurate ellipsoidal heights for the benchmarks. Approximately 100 benchmarks distributed throughout Melbourne, Geelong, the Bellarine Peninsula, and the Otway Ranges were used. The processing was carried out using the Bernese GPS Processing software to ensure the best possible results.

GPS Survey of High-Stability Benchmark

The processing results were used to generate a geoid correction model over the project area, which is then used to “correct” existing geoid models (e.g. AUSGeoid98). This enables surveyors (and other spatial professionals) to directly obtain accurate AHD heights from technologies such as MelbPOS.


IPAWS is a spatially enabled decision-support and data management tool developed by ThinkSpatial for Victoria's Catchment Management Authorities. IPAWS assists referral authorities in the management of Planning Application Referrals, including the initial application submission, automatic timeframe notifications, generation of response documents, and the management of VCAT hearings and certification requests.

A key factor in the success of IPAWS is its “map-driven” interface; administrators are able to view and interact with outstanding and completed referrals in a Geographic Information System (GIS) such as ArcGIS or MapInfo. The GIS interface allows administrators to easily identify the relevant planning overlays, planning zones, and to factor any nearby applications into their decision-making.

Intelligent Mapping

ThinkSpatial has extensive experience in the production of intelligent, interactive, and cost-effective mapping solutions for deployment on desktops and/or mobile devices, in both online and offline environments. Our intelligent mapping solutions improve productivity, simplify workflows, and are practical and intuitive to use.

Surveying Services

Whether for specific tasks or whole-of-project survey management, our highly qualified professional surveyors have the practical experience and problem-solving abilities to deliver the highest-quality surveying solution for your organisation. ThinkSpatial utilises a range of surveying and data processing technologies such as GNSS Receivers, Network RTK, Robotic Total Stations, and Laser Scanners.

Unmanned Aerial System

Traversing the skies at an altitude of 115m ThinkSpatial's eBee provides high resolution aerial imagery (including near-infrared) in a fraction of the time required by conventional methods. ThinkSpatial is a CASA certified operator and we provide a range of services including aerial imagery, digital elevation models, and derived datasets (e.g. NDVI, roads, buildings).

Spatial Software

ThinkSpatial has a strong track record of designing and developing practical software and systems (for desktop and mobile devices) that solve clients' problems. Our spatial software services range from enterprise-wide management systems (IPAWS, iEotR) through to community engagement tools (Sightings Network) and standalone applications for specific purposes (ComQAT, RTQC).

Asset Capture & Inspection

ThinkSpatial provides asset capture and inspection services for local governments, management authorities, and private sector organisations throughout Victoria. Over the past few years we have developed an innovative combination of GNSS, consumer mobile devices, and a customised web mapping application to rapidly and accurately capture and inspect your asset base.

Bernese Processing

ThinkSpatial is the only commercial enterprise in Australia with the knowledge and technical skills required to efficiently use the Bernese Software — a scientific GNSS processing package used throughout the world to deliver the most accurate and precise GNSS positions and velocities. Our services include continuous monitoring and campaign-based processing.