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.
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.
Note
When using Pozi Publisher for generating public catalogues from QGIS projects, ensure the project is configured with the export=true keyword to enable the layers to be exported by Pozi Publisher.
Project Properties > QGIS Server > Service Capabilities > Keyword list > type export=true
Configuration
Configuration of Pozi Publisher tasks is set up in custom .INI files. These files detail where the source files can be found, where the resulting data will be saved and what format it will take, where to locate the QGIS Server instance, and more.
[Input]
| Key | Description | Example |
|---|---|---|
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]
| Key | Description | Example |
|---|---|---|
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]
| Key | Description | Example |
|---|---|---|
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]
| Key | Description | Example |
|---|---|---|
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]
| Key | Description | Example |
|---|---|---|
{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]
| Key | Description | Example |
|---|---|---|
bucket | Destination AWS S3 bucket | bucket=connect.pozi.com/userdata/gleneira-publisher |
key | Key | key={Add Key} |
secret | Secret | secret={Add Secret} |
[WFS]
| Key | Description | Example |
|---|---|---|
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 |
Running Publisher
In Powershell
- Open Powershell
- Navigate to the Pozi Publisher folder
cd C:\Pozi\Publisher - Run Pozi Publisher adding the
inisettings file as a parameter..\PoziPublisher.ps1 "C:\Pozi\Publisher\deeca-iws-wms-northerngrampians-lga.ini"
As a batch file
- 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. - 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 - 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. - Save this file.
- To run, simply double-click the file.
- 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
- Open
Task Schedulerin Windows. - Create a new scheduled task using
Create Task.... - Name the new scheduled task something meaningful like
Pozi Publisher Sync. - 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. - Under
Triggersset up the frequency the task should be run. Generally this will be either Daily or Weekly. - In the
Actionstab, create a new action.- The action should be
Start a program. - In the
Program/scriptdialog 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.
- The action should be
- Customise any further settings in the scheduled task.
Troubleshooting
Layers are not exported
- ensure that the WFS Output Extension is installed. See WFS Output Extension
- add
export=trueas 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 there are no antivirus or other security software restrictions for running the ogr2ogr executable