Skip to main content

FTPcaller

Download and Load Layers from FTP/FTPS

Overview

FTPcaller is a QGIS 3.40+ Processing algorithm that connects to an FTP or FTPS server, downloads a file, and optionally loads spatial data (vector or raster layers) directly into your QGIS project.

This algorithm is part of the KORTxyz ETL toolset and is designed for automated workflows that require fetching and ingesting remote geospatial data.

Features

  • FTP & FTPS support — Connect securely to implicit or explicit FTPS servers
  • Automatic layer loading — Detect and load GeoPackage tables, vector, and raster formats
  • Error resilience — Falls back to directory listing if download fails
  • Flexible output — Returns file paths for use in Processing models or layer ids for interactive use
  • Model Designer compatible — Works seamlessly within Processing model workflows

Parameters

Input Parameters

Parameter Type Description
FTP/FTPS host URL String Full URL to the remote file on the FTP server (e.g., ftp://example.com/data/layer.gpkg or ftps://secure.example.com/geodata.shp)
Username String FTP server login username
Password String FTP server login password
Load layers into project Boolean If checked, automatically adds downloaded layers to the current QGIS project after download completes. Uncheck to download only without loading.
Downloaded file File Destination Output path where the downloaded file will be saved (temporary or permanent)

Output Parameters

Output Type Description
Downloaded file path String Full file path to the downloaded file on your local system
Directory listing Variant If download fails, returns a list of files in the remote directory (fallback)

Supported Formats

Vector Formats (auto-loaded)

  • GeoPackage (.gpkg) — All tables within the package are loaded as separate layers
  • Shapefile (.shp)
  • GeoJSON (.geojson, .json)
  • KML (.kml)
  • GML (.gml)

Raster Formats (auto-loaded)

  • GeoTIFF (.tif, .tiff)
  • IMG (.img)

Note: Other formats are downloaded but not automatically loaded. You can manually import them via QGIS layer dialogs.

Usage Examples

Example 1: Download and Load a GeoPackage

  1. Open Processing Toolbox → Search for "FTPcaller"
  2. Fill parameters:
    • FTP/FTPS host URL: ftp://geoserver.example.com/public/denmark.gpkg
    • Username: [email protected]
    • Password: yourpassword
    • Load layers into project: ✓ (checked)
    • Downloaded file: (leave as temp output or specify a path)
  3. Run — All layers in denmark.gpkg will download and appear in your map canvas

Example 2: Download a Shapefile Without Auto-Load

  1. Fill parameters:
    • FTP/FTPS host URL: ftps://secure.example.com/roads/main_roads.shp
    • Username: geodata_user
    • Password: securepass123
    • Load layers into project: ☐ (unchecked)
    • Downloaded file: C:/projects/data/main_roads.shp
  2. Run — File downloads to the specified path; you can manually import it later or add it to a Processing model

Example 3: Use in a Processing Model

You can chain FTPcaller with other algorithms:

  1. Create a Processing model
  2. Add FTPcaller to download a GeoPackage
  3. Connect its output to subsequent steps (e.g., clipping, reprojection, analysis)
  4. Use Load layers into project = unchecked so the file is available for model processing without cluttering the canvas during each run

How Layer Loading Works

When "Load layers into project" is checked:

  1. File downloads to a temporary location (or your specified output path)
  2. Post-processing phase: The algorithm detects the file format and loads layers:
    • GeoPackage: Enumerates all tables and loads each as a vector layer
    • Vector formats: Creates a single vector layer with that filename
    • Raster formats: Creates a single raster layer
  3. Layers are added to the Layer Tree and styled with QGIS defaults
  4. If loading fails (unsupported format, corrupt file, etc.), a warning is logged but download succeeds

When "Load layers into project" is unchecked:

  • Only the file path is returned
  • No layers are added to the project
  • Useful for Processing models where you want to keep outputs clean

Technical Details

FTPS Support

FTPcaller supports implicit FTPS (port 990) and explicit FTP (port 21):

  • Explicit FTP: Detected when URL scheme is ftp:// or omitted
  • Implicit FTPS: Detected when URL scheme is ftps://

The algorithm automatically configures SSL/TLS wrapping for both control and data connections.

GeoPackage Layer Enumeration

When a .gpkg file is downloaded and layer loading is enabled:

  1. Connects to the GeoPackage using QGIS OGR provider metadata
  2. Lists all geometry tables in the package
  3. Loads each table as a separate vector layer with its original name

This is useful for multi-layer GeoPackages exported from ArcGIS, Shapefile batches, or other sources.

Error Handling

  • Connection failure: Reports error; attempts fallback directory listing
  • Invalid credentials: FTP login error is caught and logged
  • Download interrupted: File operation exceptions are caught; feedback is provided
  • Loading failure: If post-processing cannot load a layer, a warning is logged and the download result remains available

Common Issues & Solutions

"FTP error: 530 Login incorrect"

  • Verify username and password
  • Check that the FTP user has read permissions on the remote path

"Downloaded file path is empty"

  • Ensure the remote file exists and the path is correct
  • Check server logs for access denials or quota issues

Layers don't appear after download

  • Check that Load layers into project is enabled
  • Verify the file format is supported (see Supported Formats above)
  • Open the downloaded file manually to confirm it's not corrupt

"Directory listing failed"

  • The path may not exist or the user lacks directory listing permissions
  • This is a fallback error; the original download error (if any) is logged separately

Integration with KORTxyz

FTPcaller is part of the KORTxyz plugin suite for QGIS and complements:

  • GeoDK: Download and process GeoDanmark datasets
  • Unzipper: Extract and organize spatial data archives
  • Other ETL tools for Danish geospatial data workflows

Requirements

  • QGIS 3.40+ (uses QgsProcessingContext for advanced output handling)
  • Python 3.6+ (for SSL/TLS and URL parsing)
  • Network access to the FTP/FTPS server
  • Sufficient disk space for the downloaded file

Support & Feedback

For issues, feature requests, or questions:

  • Check the KORTxyz plugin repository
  • Review QGIS logs via PluginsManage and Install PluginsPython Console
  • Contact the maintainers through the repository issue tracker

Last Updated: December 2025
Algorithm Version: 1.0
QGIS Compatibility: 3.40+

Updated on Dec 11, 2025