Problem
When extracting hand-drawn lines from Paper2GIS maps, the output shapefile was empty despite clearly visible features in the opened_map (step 6 of the processing pipeline). This issue particularly affects horizontal and vertical lines, which are mistakenly removed by the default filters.
The user experience was poor because:
❌ No feedback - The process completes silently with no indication why features were filtered out
❌ No visual verification - Demo mode saves intermediate PNG files but not the final shapefile output as an image
❌ Difficult to debug - Users cannot tell if filtering parameters are too aggressive or if image processing failed
Visual Evidence
Input Images: Reference, Target
Processing Results: opened_map, Final Shapefile output
Solution
1. Added comprehensive logging
Add detailed logging to cleanWriteShapefile() to help users understand what's happening:
Total features extracted: 10
Rejected by area filter: 0
Rejected by ratio filter: 7
Rejected as empty after edge clip: 0
Features written to shapefile: 3
2. Add Shapefile Visualization to Demo Mode
When --demo True is enabled, save an additional step:
./demo/7.shapefile_output.png
This PNG would show the final shapefile output rendered back as an image.
3. Add Preset Option
python p2g.py extract --preset lines ... # Optimized for thin features
python p2g.py extract --preset polygons ... # Current defaults
python p2g.py extract --preset points ... # For point extraction
Problem
When extracting hand-drawn lines from Paper2GIS maps, the output shapefile was empty despite clearly visible features in the opened_map (step 6 of the processing pipeline). This issue particularly affects horizontal and vertical lines, which are mistakenly removed by the default filters.
The user experience was poor because:
❌ No feedback - The process completes silently with no indication why features were filtered out
❌ No visual verification - Demo mode saves intermediate PNG files but not the final shapefile output as an image
❌ Difficult to debug - Users cannot tell if filtering parameters are too aggressive or if image processing failed
Visual Evidence
Input Images: Reference, Target
Processing Results: opened_map, Final Shapefile output
Solution
1. Added comprehensive logging
Add detailed logging to cleanWriteShapefile() to help users understand what's happening:
2. Add Shapefile Visualization to Demo Mode
When
--demo Trueis enabled, save an additional step:This PNG would show the final shapefile output rendered back as an image.
3. Add Preset Option