Skip to content

Empty shapefile output despite visible features in opened_map - Missing user feedback and visualization #4

Description

@wandering-sage

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

Image Image

Processing Results: opened_map, Final Shapefile output

Image Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions