PAGE CONTENTS
WFS data in local spatial database
AfriGIS data can be added directly into a local spatial database using WFS.
How to add a WFS layer into a database
To insert the WFS data directly into a local spatial database, AfriGIS recommends the use of a reliable, well-tested library such as ogr2ogr (part of GDAL) to download the WFS and automatically create the table.
Below is an example of the command for a MSSQL database:
ogr2ogr -f MSSQLSpatial “MSSQL:Provider=SQL Server;server=hostname;database=database_name;Uid=username;Pwd=password” WFS:”https://ogc.afrigis.co.za/mapservice/wfs?authkey=_YOUR_KEY_HERE_&service=WFS&version=1.0.0&request=GetFeature&typeName=zaf:zaf_country”
ogr2ogr is available via Docker (docker pull osgeo/gdal:latest). Just note that the MSSQL driver is not included in smaller images, only in the full image (latest). More common database drivers like PostgreSQL are available in smaller images.
Authentication
These products make use of an AuthKey for authentication. To integrate, sign up for a free trial account by contacting [email protected]
For detailed integration instructions using an AuthKey, please click on the following link: https://developers.afrigis.co.za/authkey-authentication/
To view technical documentation describing the details of data via WFS, click on the button below.