Overview
Q2G allows you to upload layers from QGIS to GeoServer in multiple formats. The plugin handles format conversion, style export, and layer registration automatically.
Supported Upload Methods
- Direct Upload: Shapefiles, GeoPackages, GeoTIFF
- Importer API: For complex formats and batch operations
- PostGIS Registration: Direct database layer registration
- Format Conversion: Automatic conversion for unsupported formats
Preparing Layers for Upload
Layer Requirements
- CRS (Coordinate Reference System): Must be defined and valid
- Geometry: Must be valid (no invalid geometries)
- Attributes: Column names should be simple (avoid special characters)
- Data Source: Must be accessible (local files or database)
Checking Layer Properties
- Right-click the layer in QGIS Layers panel
- Select "Properties"
- Check the "Information" tab for CRS and geometry details
- Verify all information is correct
Fixing Common Issues
- Missing CRS: Right-click layer → Set Layer CRS
- Invalid geometries: Use Vector → Geometry Tools → Fix Geometries
- Special characters in names: Rename layer or attributes
Single Layer Upload
Step-by-Step Process
Ensure your GeoServer connection is configured and tested (see Configuration guide)
Choose the target workspace from the Workspace dropdown
In the QGIS Layers panel, check the checkbox next to the layer you want to upload
Set upload options:
- Auto-Overwrite: Check if you want to replace existing layers
- Upload SLD: Check to upload layer styles
- Overwrite SLD: Check to replace existing styles
Click the "Upload Layers" button to start the upload
Watch the upload log for progress messages. The upload log shows:
- Green messages: Successful operations
- Red messages: Errors or failures
- Blue messages: Information and debug details
Check the log for success messages and verify on GeoServer
Batch Layer Upload
Upload multiple layers at once for efficiency:
Batch Upload Process
- Select multiple layers by checking their checkboxes
- Configure upload options (same as single upload)
- Click "Upload Layers"
- The plugin will upload layers sequentially
- Monitor progress in the upload log
Batch Upload Features
- Sequential Processing: Layers are uploaded one at a time
- Error Handling: Failure of one layer doesn't stop others
- Progress Tracking: See which layer is being processed
- Summary Report: Final report shows success/failure counts
Best Practices for Batch Upload
- Start with a small batch (3-5 layers) to test
- Ensure all layers have valid CRS
- Check layer names don't conflict with existing layers
- Monitor the upload log for errors
- Verify results on GeoServer before uploading more
Supported Layer Formats
Vector Formats
| Format | Extension | Upload Method | Notes |
|---|---|---|---|
| Shapefile | .shp | Direct/Importer | Most common, fully supported |
| GeoPackage | .gpkg | Importer | Modern format, supports multiple layers |
| SQLite | .sqlite | Converted to Shapefile | Automatically converted for upload |
| PostGIS | Database | Direct Registration | Database layers, no file needed |
Raster Formats
| Format | Extension | Upload Method | Notes |
|---|---|---|---|
| GeoTIFF | .tif, .tiff | Importer | Georeferenced imagery, fully supported |
| JPEG2000 | .jp2 | Importer | Compressed imagery |
| PNG | .png | Importer | Requires georeferencing |
Upload Options Explained
Auto-Overwrite Existing Layers
When to use: Updating existing layers on GeoServer
What it does:
- Checks if layer already exists on GeoServer
- Deletes the existing layer and datastore
- Uploads the new layer
Caution: This will delete all data associated with the existing layer
Upload SLD Styles
When to use: When you want to apply QGIS styles to GeoServer layers
What it does:
- Exports the QGIS layer style as SLD
- Uploads the SLD to GeoServer
- Associates the style with the layer
Note: Not all QGIS styles can be perfectly converted to SLD
Overwrite Existing Styles
When to use: Updating styles for existing layers
What it does:
- Replaces the existing SLD style
- Applies the new style to the layer
Understanding Upload Progress
Upload Log Messages
- ✓ (Green): Successful operation
- ✗ (Red): Error or failure
- âš (Orange): Warning or non-critical issue
- ℹ (Blue): Information or debug message
Typical Upload Sequence
- Checking if layer exists on GeoServer
- Deleting existing layer (if auto-overwrite enabled)
- Creating import job
- Uploading file to GeoServer
- Executing import
- Publishing layer
- Exporting and uploading SLD style (if enabled)
- Associating style with layer
Handling Upload Errors
Common Error Messages
- "Layer already exists": Enable Auto-Overwrite or use a different name
- "Invalid CRS": Set the layer's CRS in QGIS
- "Connection refused": Check GeoServer is running
- "Authentication failed": Verify username/password
- "File too large": Split into smaller files or increase GeoServer limits
Troubleshooting Steps
- Check the upload log for detailed error messages
- Verify your GeoServer connection
- Check layer properties (CRS, geometry, etc.)
- Try uploading a different layer to test
- Check GeoServer logs for server-side errors
Upload Completion
Success Indicators
- Upload log shows "✓ Layer uploaded successfully"
- No error messages in the log
- Layer appears in GeoServer workspace
- Style is applied (if SLD upload was enabled)
After Upload
- Verify the layer on GeoServer
- Check if the style was applied correctly
- Test the layer in a web map
- Make any necessary adjustments
Performance Tips
- File Size: Smaller files upload faster. Consider splitting large files.
- Network: Faster network = faster uploads. Check your connection speed.
- GeoServer Load: Upload during off-peak hours for better performance.
- Batch Size: Upload 5-10 layers at a time for optimal performance.
- Compression: Use compressed formats (GeoPackage) when possible.
Next Steps
- Style Management - Manage layer styles
- Preview & Visualization - Preview your layers
- Troubleshooting - Solve common issues