# Pozi Publisher

Pozi Publisher standardises a wide range of spatial information from inside and outside your organisation into easily digestible map catalogues that integrate seamlessly into Pozi Web GIS.

# Working with Catalogues

A map catalogue is a collection of map layers, typically in XML format generated by a WFS or WMS GetCapabilities, or a QGIS GetProjectSettings service call.

The catalogue is the unit around which the Pozi Publisher workflow is based, either generating catalogues from various sources, modifying catalogues for specific use cases, or extracting information from catalogues.

# Installation

# Install Pozi Publisher

  1. Create folder C:\Pozi\Publisher
  2. Obtain Publisher from Pozi Support, and extract to/past e to the new folder

# Installing AWS Tools for Powershell

  1. Type Install-Module -Name AWS.Tools.Installer
  2. Answer 'Y' to the various security prompts
  1. Download AWS Tools.
  2. Type $Env:PSModulePath on a PowerShell command line. This will provide a list of possible folders that the module zip file can be extracted in. It needs to be one that the application can access when running as a task or service.
  3. Extract the zip file into the chosen folder.

# Install AWS Tools Modules

  • Extra modules are required for authentication and using S3 buckets.
  • Type Install-AWSToolsModule AWS.Tools.EC2,AWS.Tools.S3 -CleanUp -Scope AllUsers

# Configuration

Section Key Description Example
[Input] folder QGIS project folder folder=C:\Pozi\Projects
file QGIS project file file=C:\Pozi\Projects\Assets.qgs
wms QGIS GetProjectSettings URL wms=http://localhost/pozi/qgisserver?MAP=C:/Pozi/Projects/Assets.qgs&SERVICE=WMS&REQUEST=GetProjectSettings
wfs WFS URL wfs=https://data.gov.au/geoserver/wfs?SERVICE=WFS&REQUEST=GetCapabilities
wms WMS URL wms=https://iws.maps.vic.gov.au/erdas-iws/ogc/wms/RDP?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
[Output] folder Destination folder for catalogue XML files, and also GeoJSON and SLD files for QGIS projects that have the setting export=true added to the Keyword list in either the project's or individual layer's settings. folder=C:\Pozi\Cache
name Name of destination XML file name=deeca-iws-wms-southerngrampians
dataFolder Destination folder for GeoJSON and SLD files when data is being extracted from a WFS service. If a QGIS project is being used data will be extracted into a subfolder of the output folder with the same name as the XML file. To enable data and style file extraction from a QGIS file, add export=true to the Keyword list either in the project's settings for all WFS layers, or individually to the Keyword list of specific layers. dataFolder=C:\Pozi\Cache
projection When data is extracted from a WFS service, the default projection of WGS84 Latitude/Longitude (EPSG:4326) can be overwritten by specifying the EPSG code. projection=7855
backupFolder Destination folder for creating time-stamped backup QGIS files, to enable version control. backupFolder=C:\Pozi\Backup
searchFolder Destination for SearchDB file. In order to set up a field for searching, go to the relevant layer's properties. Make sure the layer is published as WFS, and then add searchField={fieldName} into the Keyword list for the layer. To also specify an ID field add idField={idFieldName} into the Keyword list. Settings added in the Keyword list should be comma delimited. searchFolder=C:\Pozi\Search
order Comma-delimited list of layers in the order they should be presented in the output file. Regular expressions are recognised, so asterisks (*) should be used if the full name isn't going to be specified. Once the layers in the list have been processed, any remaining layers will be kept in their original order. Note: This uses layer names after Replace statements have been completed. order=*Centre,Kindergartens,Maternal Child Health Centres,Playgrounds,*Court*
[QGIS_Server] url If the source is a QGIS project file or folder of files (as opposed to a URL), specify the URL of the QGIS Server which is needed to serve the required GetProjectSettings responses. url=http://localhost/pozi/qgisserver
[Filters] exclude Comma-delimited list of layers to exclude from the output. Will exclude any layer that has a title which contains this text. exclude=meeting-rooms,soccer
include Comma-delimited list of layers to include in the output. Will include any layer that has a title which contains this text. Note: Include statements are processed after exclude statements. include=wimmera-grampians_2020dec20_air_vis_15cm_mga54
[Replace] {old text}={new text} Text in layer title to replace, and the replacement text. Regular expressions can be used in these statements to improve flexibility and accuracy of string replacements. For more information on regular expression, please see Microsoft's Powershell Documentation. wimmera-grampians_2020dec20_air_vis_15cm_mga54.ecw=Aerial Photo Dec 2020
[AWS] bucket Destination AWS S3 bucket bucket=connect.pozi.com/userdata/gleneira-publisher
key Key key={Add Key}
secret Secret secret={Add Secret}
[WFS] parameters Specify extra parameters when calling a WFS service. This is particularly important when calling large datasets that have a limit on records that will be returned on a single call, as it can enable pagination. Firstly, the full data name (defined by the <Name> element in the GetCapabilities call) needs to be specified. This is followed by a pipe (|) character, then the extra parameters that are to be concatenated to the end of the WFS service call. The cql_filter parameter is particularly useful for returning subsets of a large dataset - the example limits the records returned to active properties within a specific LGA. When requesting a dataset that requires pagination, it is critical that a sortBy criteria is added with a unique field to sort by. Without this the call will fail. parameters=open-data-platform:v_property_mp\|cql_filter=prop_lga_code IN (330) AND prop_status='A'&sortBy=prop_pfi

# Examples

# Generate map catalogues from QGIS projects

Generate production-ready OGC-compliant map catalogues from QGIS projects.

  • Improve load times in web map applications by pre-generating catalogues from internal and external web map servers into static XML files
  • Version control of QGIS projects
[Input]
folder=\\cscgisweb02\d$\Pozi

[Output]
folder=C:\Pozi\Cache

[QGIS_Server]
url=http://localhost/pozi/qgisserver

# Generate map catalogues from external sources

Save local versions of catalogues from external providers.

# Customise catalogues

Generate custom catalogues from external web servers.

  • Search and replace text
  • Filter layers
  • Embed custom metadata

# Bulk data generation/extraction

Export GeoJSON and SLD files for all layers in a catalogue.

  • Bulk download map data from external catalogues on a routine schedule

# Sync to cloud

Sync data generated from local sources up to S3.

  • Publish layers to the public from QGIS projects

# Build search indexes

Compile index of features and attributes for fast searching.

  • Search index generator

# Running Publisher

# In Powershell

  1. Open Powershell
  2. Navigate to the Pozi Publisher folder cd C:\Pozi\Publisher
  3. Run Pozi Publisher adding the ini settings file as a parameter. .\PoziPublisher.ps1 "C:\Pozi\Publisher\deeca-iws-wms-northerngrampians-lga.ini"

# As a batch file

  1. Create a new empty batch file. This file can be located in whatever folder suits, e.g. C:\Pozi\Publisher\PoziPublisherRun.bat. If it will frequently be run manually, a shortcut to this file can be created on the user's desktop.
  2. Edit this file, by adding a line similar to the following.
    powershell.exe "C:\Pozi\Publisher\PoziPublisher.ps1" -iniFiles "C:\Pozi\Publisher\deeca-iws-wms-northerngrampians-lga.ini" > "C:\Pozi\Publisher\deeca-iws-wms-northerngrampians-lga.log" 2>&1
  3. Replace the ini file (C:\Pozi\Publisher\deeca-iws-wms-northerngrampians-lga.ini) and generated log file (C:\Pozi\Publisher\deeca-iws-wms-northerngrampians-lga.log) entries in this line to reflect the desired file locations.
  4. Save this file.
  5. To run, simply double-click the file.
  6. Multiple ini files can be run from the one batch file by duplicating the line, and updating the ini and log file locations.

# As a scheduled task

  1. Open Task Scheduler in Windows.
  2. Create a new scheduled task using Create Task....
  3. Name the new scheduled task something meaningful like Pozi Publisher Sync.
  4. In most cases these tasks will need to be Run whether user is logged in or not, possibly with an administrator login, to ensure it can be run at any time.
  5. Under Triggers set up the frequency the task should be run. Generally this will be either Daily or Weekly.
  6. In the Actions tab, create a new action.
    • The action should be Start a program.
    • In the Program/script dialog box type the full location of your batch file created in the previous section e.g. C:\Pozi\Publisher\PoziPublisherRun.bat, or use the Browse button to locate this file.
  7. Customise any further settings in the scheduled task.

# Troubleshooting

  • ensure that the WFS Output Extension is installed. See WFS Output Extension
  • add export=true as a keyword in the project's QGIS Server 'Service Capabilities' or as a keyword for individual layers that need to be exported
  • make sure any layers to be exported are published as a WFS service in the project settings

Ensure that AWS Tools for Powershell is installed. See AWS Tools for Powershell