Atlas Finder
- Project Started: June 18th 2015
- Last Worked on Version: 1.0
- Releases: 1 Major release
- Node.js & Express.js
- PG & PG Native
- Handlebars
- PostgreSQL & Elastic Search
- Redis & PostGIS
- Grunt
About
To help improve visualisation and analysis of geospatial data, I developed a new map infrastructure for use by the HSE and other OpenApp Clients. I aimed for the system to be as modular as possible and allow developers using it to create interactive maps with the minimum of effort and code.
To help consolidate data and resources, I also created a number of backend API's to provide common map layers & tiles, full text search as well as the provision of custom data requests. Each module and API is outlined in the following sections.
Named Area Module
The Named Area Module returns a SQL query based on a user request for a given set of areas by name. For example, someone could request the Irish counties "Kildare", "Meath" and "Dublin" and receive the query needed to select those features. The module supports multiple area types such as Counties, Electoral Districts, Small Areas and can be extended to virtually any layer once a mapping between name and feature is available.
Layer Cache Module
To help improve performance, the LayerCache module allows frequently accessed data to be stored and recalled from a Redis cache. This can help save roughly 100ms or more per request as it avoids a more costly PostgreSQL look up in favour of in memory cache.
Layer Mapper Module
The Layer Mapper module takes a given layer name and returns the required SQL and attributes for that layer. It can preform SQL queries by itself and return GeoJSON features or help with more complex queries as part of the Named Area module.
JMap Feature Server
The JMap Feature Server acts as a container for all the previously mentioned modules. It consists of an Express.js server and related modules which together provide an API for all map related requests. Each available data layer can return either full or partial results in GeoJSON format used by common frontend JavaScript mapping libraries such as OpenLayers and Leaflet.
JMap Search Server
Map layers that provide text attributes are fully searchable via the JMap Search Server API. Features in PostgreSQL are also partially stored and referenced by Elastic Search, allowing natural language and full text search ability to be used along with the spatial abilities of PostGIS.
JMap Tile Server
While the majority of data used is in vector format, some datasets are too large to be displayed by mobile devices and low end computers. To overcome this challenge, vector data can be rendered as PNG tiles and served using the Z/X/Y tile scheme. Elements of this server were derived from Open Source technology released my Mapbox, specifically their MBTiles format and SQLITE module.
JMap Client
In addition to the server side modules and API’s I also developed a client side library called JMap (JavaScript Map) Client. This library was written to automate and modularise common elements of map based web applications such as feature popups and accessing various map tile providers. The library itself is a wrapper around the popular OpenLayers Mapping Library and the Proj4.js toolset which supports various "Ireland specific" map projections including Irish Transverse Mercator and Irish National Grid.
As the OpenLayers project release new versions of their library, breaking changes are resolved by the JMap Client instead of end our user applications. This allows OpenApp to remain up to date with the minimum of per project maintenance.
These modules, APIs and Client are used in production by several HSE projects and by OpenApp's Rare Disease Registry product.