Authenticated WFS service via iShare Studio

System Category

Addressing

Source

DataVia API

Available since

2023

Organisation

Why not read our blog on Free DataVia workflow for iShare GIS.

If your username and password do not contain any special characters you might be able to connect to an authenticated WFS using the conventional Workflow WFS Connection and passing the credentials in the URL string, for example like this, please notice that this has not been tested:

https://user:password@domain/to/WFS/service?

There will be times that you will need to connect to an Authenticated WFS service such as the DataVia API from GeoPlace, using your account details (username/password). Usually, you would use a Workflow WFS Connection, however in this case this is not possible as this configuration doesn’t allow you to enter a username and a password.

To configure iShare Studio to allow a connection to an Authenticated WFS service you will need to use the following steps:

  1. Add VRT file types to the ConTypes.xml (E:\iShareData\LIVE\config\studio\config)

    <FileConType> <Name>VRT File</Name> <FormatName>VRT</FormatName> <Direction>Both</Direction> <FileFilter>VRT files (*.vrt)|*.vrt</FileFilter> </FileConType>
  2. Create a vrt file, under E:\iShareData\Utilities (or whenever you think appropriate) and enter the connection details there for example:

    <OGRWFSDataSource> <URL><https://www.datavia.geoplace.co.uk/api/OgcService/basic/nsg-services-basic</URL>> <UserPwd>yourname@yourcouncil.gov.uk:yourpassword</UserPwd> <HttpAuth>BASIC</HttpAuth> <Version>1.1.0</Version> </OGRWFSDataSource>
  3. Create a Spatial Data Transformation Task, which points to the vrt file, and create the tables you wish for from the available features of the WFS service, for example:

     

  4. In the Additional parameters you will need to add your SQL select statement and the configuration option GDAL_HTTP_UNSAFESSL YES so the curl library skips SSL host certificate verification, as the default for this option is NO e.g.

    -sql "select * from tableName" --config GDAL_HTTP_UNSAFESSL YES
  5. If you wish to automate this process then you can add this Task to a Workflow Job and Schedule the Job to run at a suitable time.