Common Mistakes & Solutions
Avoid frequent pitfalls and resolve issues quickly with this troubleshooting guide.
Overviewβ
This guide documents the most common mistakes users encounter when using FilterMate, along with clear solutions and prevention strategies.
Quick Navigation:
- Empty Filter Results
- PostgreSQL Backend Unavailable
- Slow Performance
- Incorrect Spatial Results
- Expression Errors
- Export Failures
- Filter History Lost
- CRS Issues
1. Empty Filter Resultsβ
Symptom: Filter returns 0 features, but you expected matches.
Common Causesβ
Cause A: CRS Mismatchβ
Problem: Layers have different coordinate systems that don't overlap geographically.
Example:
Layer 1: EPSG:4326 (WGS84) - Global coordinates
Layer 2: EPSG:2154 (Lambert 93) - France only
Solution: β FilterMate handles CRS reprojection automatically, but verify layers overlap:
- Right-click each layer β Zoom to Layer
- Check if both layers appear in same geographic area
- Look for π reprojection indicator in FilterMate logs
Prevention:
- Use layers from same geographic region
- Check layer extent in Properties β Information
Cause B: Invalid Geometriesβ
Problem: Corrupt or self-intersecting geometries prevent spatial operations.
Symptoms:
- "GEOS error" in logs
- Inconsistent results
- Some features missing unexpectedly
Solution: β Run geometry repair before filtering:
# In QGIS Processing Toolbox
1. Vector geometry β Fix geometries
2. Input: Your problematic layer
3. Output: layer_fixed
4. Use fixed layer in FilterMate
Quick Check:
# Processing Toolbox
Vector geometry β Check validity
Cause C: Buffer Distance Too Smallβ
Problem: Buffer zone doesn't reach any features.
Example:
Buffer: 10 meters
Reality: Nearest feature is 50 meters away
Result: 0 features found
Solution: β Progressively increase buffer distance:
Try: 50m β 100m β 500m β 1000m
β Test without buffer first:
- Use "Intersects" predicate without buffer
- If this returns results, buffer distance is the issue
Cause D: Wrong Attribute Valuesβ
Problem: Filtering for values that don't exist in the data.
Example:
-- Your expression:
city = 'Paris'
-- Actual values in data:
city = 'PARIS' (uppercase)
city = 'Paris, France' (includes country)
Solution: β Check actual field values first:
- Right-click layer β Attribute Table
- Look at actual values in the field
- Adjust expression to match exactly
β Use case-insensitive matching:
-- Instead of:
city = 'Paris'
-- Use:
upper(city) = 'PARIS'
-- or
city ILIKE 'paris'
Cause E: Layers Don't Overlap Geographicallyβ
Problem: Reference layer and target layer are in different locations.
Example:
Target: Buildings in New York
Reference: Roads in London
Result: No overlap = 0 results
Solution: β Verify geographic overlap:
- Select both layers in Layers Panel
- Right-click β Zoom to Layers
- Both should appear in same map view
Debug Workflow for Empty Resultsβ
Step 1: Test with simple expression
1 = 1 -- Should return ALL features
If this fails β Backend or layer issue
Step 2: Test attribute filter only
-- Remove spatial filter
-- Test: population > 0
If this works β Spatial configuration issue
Step 3: Test spatial filter only
-- Remove attribute filter
-- Use basic "Intersects" without buffer
If this works β Attribute expression issue
Step 4: Check logs
QGIS β View β Panels β Log Messages β FilterMate
Look for red error messages
2. PostgreSQL Backend Unavailableβ
Symptom: Warning message: PostgreSQL backend unavailable - using fallback
Root Causeβ
Problem: psycopg2 Python package not installed in QGIS Python environment.
Impact:
- 10-50Γ slower performance on large datasets
- No materialized views or server-side processing
- Falls back to Spatialite or OGR backend
Solution: Install psycopg2β
- Windows
- Linux
- macOS
# Method A: OSGeo4W Shell (Recommended)
# Open OSGeo4W Shell as Administrator
# Run these commands:
py3_env
pip install psycopg2-binary
# Method B: QGIS Python Console
# QGIS β Plugins β Python Console
# Run this code:
import subprocess
subprocess.check_call(['python', '-m', 'pip', 'install', 'psycopg2-binary'])
# Ubuntu/Debian
sudo apt-get install python3-psycopg2
# Or via pip
pip3 install psycopg2-binary
# Verify installation
python3 -c "import psycopg2; print(psycopg2.__version__)"
# Via pip (QGIS Python)
/Applications/QGIS.app/Contents/MacOS/bin/pip3 install psycopg2-binary
# Or via Homebrew
brew install postgresql
pip3 install psycopg2-binary
Verificationβ
Check if psycopg2 is installed:
# QGIS Python Console
import psycopg2
print(psycopg2.__version__)
# Expected: '2.9.x (dt dec pq3 ext lo64)'
Check FilterMate logs:
β
Success: "PostgreSQL backend available"
β Warning: "psycopg2 not found, using Spatialite"
When NOT to Worryβ
You can skip PostgreSQL installation if:
- Dataset has
<10,000features (Spatialite is fast enough) - Using OGR layers (Shapefile, GeoPackage) and can't migrate
- Only occasional filtering (performance not critical)
- No PostgreSQL database available
3. Slow Performance (>30 seconds)β
Symptom: Filter operation takes more than 30 seconds.
Diagnosisβ
Check backend in use:
FilterMate panel β Layer info:
Provider: ogr (β οΈ Slowest)
Provider: spatialite (β±οΈ Medium)
Provider: postgresql (β‘ Fastest)
Solutions by Backendβ
OGR Backend (Shapefile, GeoPackage)β
Problem: No native spatial indexes, in-memory processing.
Solution 1: Migrate to PostgreSQL
# Best for datasets >50k` features
1. Set up PostgreSQL+PostGIS
2. DB Manager β Import layer
3. Reconnect in QGIS
4. 10-50Γ speedup
Solution 2: Migrate to Spatialite
# Good for datasets 10k-50k features
1. Processing Toolbox β Vector general β Package layers
2. Choose Spatialite format
3. 3-5Γ speedup vs Shapefile
Solution 3: Optimize query
-- Add attribute filter FIRST (reduces spatial query scope)
population > 10000 AND ...spatial query...
-- Instead of:
...spatial query... AND population > 10000
Spatialite Backendβ
Problem: Large dataset (>50k` features).
Solution: Migrate to PostgreSQL
- Expected improvement: 5-10Γ faster
- Sub-second queries on 100k+ features
Workaround: Reduce query scope
-- Pre-filter with bounding box
bbox($geometry,
$xmin, $ymin,
$xmax, $ymax)
AND ...your filter...
PostgreSQL Backend (Already Fast)β
Problem: Slow despite using PostgreSQL (rare).
Possible Causes:
- β Missing spatial index
- β Invalid geometries
- β Network latency (remote database)
Solutions:
-- 1. Check spatial index exists
SELECT * FROM pg_indexes
WHERE tablename = 'your_table'
AND indexdef LIKE '%GIST%';
-- 2. Create index if missing
CREATE INDEX idx_geom ON your_table USING GIST(geom);
-- 3. Fix geometries
UPDATE your_table SET geom = ST_MakeValid(geom);
Performance Benchmarksβ
| Backend | 10k features | 50k features | 100k features |
|---|---|---|---|
| PostgreSQL | 0.1s β‘ | 0.3s β‘ | 0.8s β‘ |
| Spatialite | 0.4s β | 4.5s β±οΈ | 18s β±οΈ |
| OGR (GPKG) | 2.1s | 25s β οΈ | 95s π |
| OGR (SHP) | 3.8s | 45s π | 180s π |
Recommendation: Use PostgreSQL for >50k` features.
4. Incorrect Spatial Resultsβ
Symptom: Features far from reference geometry are included in results.
Common Causesβ
Cause A: Buffer Distance in Wrong Unitsβ
Problem: Using degrees when you need meters (or vice versa).
Example:
Buffer: 500 (assumed meters)
Layer CRS: EPSG:4326 (degrees!)
Result: 500-degree buffer (~55,000 km!)
Solution: β FilterMate auto-converts geographic CRS to EPSG:3857 for metric buffers
- Look for π indicator in logs
- Manual check: Layer Properties β Information β CRS units
β Use appropriate CRS:
Degrees: EPSG:4326 (WGS84) - Auto-converted β
Meters: EPSG:3857 (Web Mercator)
Meters: Local UTM zones (most accurate)
Cause B: Wrong Spatial Predicateβ
Problem: Using "Contains" when you need "Intersects".
Predicate Meanings:
Intersects: Touch or overlap (most permissive)
Contains: A completely wraps B (strict)
Within: A completely inside B (opposite of Contains)
Crosses: Linear intersection only
Example:
β Wrong: Contains
- Finds parcels that CONTAIN roads (opposite!)
β
Right: Intersects
- Finds parcels that TOUCH roads
Solution: See Spatial Predicates Reference for visual guide.
Cause C: Reference Layer is Wrongβ
Problem: Selected wrong layer as spatial reference.
Example:
Goal: Buildings near ROADS
Actual: Reference layer = RIVERS
Result: Wrong features selected
Solution: β Double-check reference layer dropdown:
- Layer name should match your intent
- Icon shows geometry type (point/line/polygon)
Verification Stepsβ
Manual Check:
- Use QGIS Measure Tool (Ctrl+Shift+M)
- Measure distance from filtered feature to nearest reference feature
- Distance should be β€ your buffer setting
Visual Check:
- Identify Tool β Click reference feature
- Right-click β Zoom to Feature
- Look at surrounding filtered features
- They should form a ring around reference feature (if buffer used)
5. Expression Syntax Errorsβ
Symptom: Red β in expression builder with error message.
Common Syntax Mistakesβ
Missing Quotes Around Textβ
β Wrong:
city = Paris
β
Correct:
city = 'Paris'
Case-Sensitive Field Names (Spatialite)β
β Wrong (Spatialite):
name = 'test' -- Field is 'NAME', not 'name'
β
Correct:
"NAME" = 'test' -- Double quotes for case-sensitive fields
Using = with NULLβ
β Wrong:
population = NULL
β
Correct:
population IS NULL
String Concatenationβ
β Wrong:
city + ', ' + country
β
Correct:
city || ', ' || country
Date Comparisonsβ
β Wrong:
date_field > '2024-01-01' -- String comparison
β
Correct:
date_field > to_date('2024-01-01')
-- or
year(date_field) = 2024
Expression Debuggingβ
Step 1: Test in Expression Builder
QGIS Layer β Open Attribute Table β
Field Calculator β Test expression
Step 2: Use Expression Preview
Click "Preview" button to see result on first feature
Step 3: Simplify Expression
-- Start simple:
1 = 1 -- Always true
-- Add complexity gradually:
city = 'Paris'
city = 'Paris' AND population > 100000
6. Export Failuresβ
Symptom: Export button does nothing or shows error.
Common Causesβ
Cause A: Permission Deniedβ
Problem: Can't write to destination folder.
Solution:
# Windows: Choose user folder
C:\Users\YourName\Documents\
# Linux/macOS: Check permissions
chmod 755 /path/to/output/folder
Cause B: Invalid Characters in Filenameβ
Problem: Special characters not allowed by filesystem.
β Wrong:
exports/data:2024.gpkg -- Colon not allowed (Windows)
β
Correct:
exports/data_2024.gpkg
Cause C: Target CRS Invalidβ
Problem: Selected CRS doesn't exist or isn't recognized.
Solution: β Use common CRS codes:
EPSG:4326 - WGS84 (worldwide)
EPSG:3857 - Web Mercator (web maps)
EPSG:2154 - Lambert 93 (France)
Cause D: Layer Name Contains Spaces (PostgreSQL export)β
Problem: PostgreSQL table names with spaces require quotes.
Solution:
β Wrong: my layer name
β
Correct: my_layer_name
7. Filter History Lost After Restartβ
Symptom: Undo/redo history is empty after closing QGIS.
Expected Behaviorβ
Filter history is session-based - it's not saved to the QGIS project file.
Why:
- History can become large (100+ operations)
- May contain sensitive filter criteria
- Performance optimization
Workaround: Use Favoritesβ
Save important filters:
- Apply your filter
- Click "Add to Favorites" button (β icon)
- Give it a descriptive name
- Favorites ARE saved to project file
Recall favorite filters:
- Click "Favorites" dropdown
- Select saved filter
- Click "Apply"
8. CRS Mismatch Problemsβ
Symptom: Features appear in wrong location or spatial queries fail.
Automatic CRS Handlingβ
FilterMate automatically reprojects layers during spatial operations.
You'll see:
π Reprojecting layer from EPSG:4326 to EPSG:3857
This is NORMAL and expected - no action needed.
When CRS Causes Issuesβ
Issue: Geographic CRS Used for Buffersβ
Problem: Buffer distance interpreted as degrees instead of meters.
FilterMate Solution: β Automatically converts EPSG:4326 β EPSG:3857 for metric operations
- π indicator appears in logs
- No manual intervention needed
Manual Override (if needed):
- Right-click layer β Export β Save Features As
- Set CRS to local projected system (UTM, State Plane, etc.)
- Use exported layer in FilterMate
Issue: Layer Shows Wrong Locationβ
Problem: Layer assigned wrong CRS.
Symptoms:
- Layer appears far from expected location
- Might be on opposite side of world
- Jumps to 0Β°,0Β° (Gulf of Guinea)
Solution:
# Fix layer CRS
1. Right-click layer β Set Layer CRS
2. Select correct CRS (check data documentation)
3. Don't use "Set Project CRS from Layer" - fixes display only
Identify Correct CRS:
- Check metadata file (.xml, .prj, .qmd)
- Look at coordinate values in attribute table
- Large numbers (e.g., 500,000) β Projected CRS
- Small numbers (-180 to 180) β Geographic CRS
- Google the data source for CRS information
Prevention Checklistβ
Before filtering, verify:
Data Qualityβ
- Layers load and display correctly
- Geometries are valid (run Check Geometries)
- Attribute table has expected values
- Layers overlap geographically
Configurationβ
- Correct target layer selected
- Correct reference layer (for spatial queries)
- Expression shows green β checkmark
- Buffer distance and units appropriate
- Spatial predicate matches intent
Performanceβ
- Backend type is appropriate for dataset size
- psycopg2 installed if using PostgreSQL
- Spatial indexes exist (PostgreSQL)
Getting Helpβ
Self-Service Resourcesβ
- Check Logs: QGIS β View β Panels β Log Messages β FilterMate
- Read Error Message: Often tells you exactly what's wrong
- Search Documentation: Use search bar (Ctrl+K)
- Try Simplified Version: Remove complexity to isolate issue
Community Supportβ
- π Bug Reports: GitHub Issues
- π¬ Questions: GitHub Discussions
- π§ Contact: Include QGIS version, FilterMate version, and error logs
Summaryβ
Most Common Mistakes:
- Empty results β Check attribute values and buffer distance
- PostgreSQL unavailable β Install psycopg2
- Slow performance β Use PostgreSQL for large datasets
- Wrong spatial results β Verify buffer units and predicate
- Expression errors β Check syntax and field names
Key Takeaways:
- FilterMate handles CRS automatically (look for indicators)
- Always test with simplified expressions first
- Check logs for detailed error messages
- PostgreSQL provides best performance for >50k` features
- Filter history is session-based (use Favorites for persistence)
Still stuck? Check the Troubleshooting Guide or ask on GitHub Discussions.