πLand Parcel Numbering Tool
Available from v3.0.0
This tool provides comprehensive functionality for interactively numbering land parcels in QGIS. It combines manual control with powerful auto-numbering algorithms designed for different parcel layouts.
π Key Featuresβ
- Advanced Auto-Numbering Dialog: Configure custom fields, start corners, custom start features, flow directions, sorting patterns, and algorithms.
- Interactive Visual Preview: Visualize the proposed numbering path and sequence numbers on the map canvas before committing.
- Intelligent Manual Numbering: Click-to-assign with automatic duplicate detection and smart sequence tracking.
- Edit Mode Auto-Detection: Automatically handles layer locking/unlocking.
- Data Integrity: Built-in safeguards against accidental data overwrites.
- Visual Feedback: Color-coded symbology to instantly see status (Duplicates, Edited, Auto-numbered).
π οΈ The Toolbar Interfaceβ
The toolbar is vertically split into Map Tools (Left) and Data Tools (Right).
Map Tools (Left Side)β
Use these for navigation and numbering operations.
- Zoom In / Out: Standard map navigation.
- Pan: Click and drag to move the map.
- Smart Select: Draw a rectangle to select a subset of parcels. Only selected parcels will be auto-numbered.
- Deselect: Clear the current selection.
- Auto Number Settings (Gear/Snake Icons): Opens the advanced Auto Number Settings dialog.
- Manual Numbering (Crosshair): Point-and-click numbering tool.
Data Tools (Right Side)β
Use these to manage the underlying database.
- Open Attribute Table: Opens the standard QGIS attribute table for the layer.
- Delete Label Field (Trash Icon): Opens a multi-select dialog to delete fields (e.g., to clear
LP_NOand start fresh).
βοΈ Advanced Auto-Numbering Dialog Settingsβ
When you launch the Auto Number tool, a dialog with the following settings will appear:
- Field Name: An editable combobox where you can select an existing attribute field (defaults to
LP_NO) or type a new field name to create it. - Start Number: A numeric input indicating the starting sequence number. The tool automatically detects and defaults to
last max value + 1or1if empty. - Start Corner: Choose which quadrant of the target area to begin numbering from:
- Top-Left (NW)
- Top-Right (NE)
- Bottom-Left (SW)
- Bottom-Right (SE)
- Manual Start (Selected Start): Click the "Select on Canvas..." button and click directly on a parcel in the QGIS canvas. The numbering sequence will begin exactly at this parcel, overriding the default mathematical corner.
- Flow Direction:
- Row-wise (Horizontal): Groups features into horizontal rows and numbers them along the X-axis.
- Column-wise (Vertical): Groups features into vertical columns and numbers them along the Y-axis.
- Pattern:
- Serpentine (Snake): Reverses the sequence direction on every alternate row or column, creating a continuous winding flow.
- Z-Pattern: Numbers each row/column in the same direction, resetting back to the start side for the next row/column.
- Algorithm:
- Smart (Adjacency): Guided by adjacency checks. It traverses greedily to adjacent features sharing a boundary, prioritizing local neighbors and larger shared boundaries. Ideal for irregular or curved parcel layouts.
- Original (Strict Grid): Follows the coordinates and sorting pattern strictly. Recommended for clean grid/checkerboard layouts.
𧬠Spatial Sorting & Adjacency Logicβ
To handle tilted grids and irregular parcels, the "Smart" auto-numbering algorithm runs the following steps under the hood:
- Dominant Angle Detection: Analyzes segment orientations to compute the dominant angle.
- Coordinate Rotation: Rotates the coordinates of the feature centroids by the dominant angle to align the grid axes.
- Row/Column Grouping: Groups centroids into rows or columns using a spatial tolerance (e.g.,
0.75 * avg_heightfor rows) before sorting. - Adjacency Guided Traversal: Traverses features starting from Rank 0, jumping to the neighbor with the largest shared boundary to keep numbering contiguous.
ποΈ Visual Numbering Previewβ
Before applying the numbering to your database:
- Click the "Preview" button in the dialog.
- A green dashed path line (
QgsRubberBand) will appear on the canvas connecting the centroids of the parcels in the calculated sequence. - Sequence numbers will be rendered on the map canvas as a temporary layer so you can inspect the flow.
- Change settings (e.g., swap start corner or pattern) and click "Preview" again to see the updated path instantly.
- Click "OK" to write the numbers to the attribute field and clear the preview, or click "Cancel" to discard.
π Step-by-Step Usageβ
Auto-Numbering Workflowβ
- Select (Optional): Use the Smart Select tool to highlight a block of parcels. If nothing is selected, the entire layer is processed.
- Open Settings: Click the Auto Number icon to open the settings dialog.
- Configure: Select the target field, start number, corner, flow direction, pattern, and algorithm.
- Preview: Click Preview to visually verify the path on your map canvas.
- Apply: Click OK to write the numbers.
Manual Numbering Workflowβ
- Click the Manual Numbering (Crosshair) tool.
- Basic Assignment: Left-click on a parcel to assign the current sequence number.
- Advanced Swiping (Drag to Label):
- Right Click + Drag: Draw a line across multiple parcels. Any parcel the line touches will be numbered in sequence instantly.
- Ctrl + Left Click + Drag: Alternative way to draw a numbering line.
- Editing: Hold Alt + Click on a parcel to edit its existing number.
- Duplicates: If you assign a duplicate number, the tool will warn you and highlight duplicates in Red.
π¨ Symbology & Status Codesβ
The tool automatically applies a rule-based style to help you visualize progress.
| Color | Status | Meaning |
|---|---|---|
| Green π’ | Unique | Valid, unique number. |
| Red π΄ | Duplicate | This number exists on multiple parcels. |
| Yellow π‘ | Edited | Manually changed by user (tracked for quality control). |
| Blue π΅ | Cleared | Was a duplicate, but you fixed/cleared it. |
| Gray βͺ | Null | Unnumbered parcel. |
Note: The tool tracks these states in a hidden STATUS field (auto, manual_edit, duplicate, etc.) for your reference.
β‘ Power User Tipsβ
- Clean Slate: To completely restart, use the Delete Label Field (Trash Can) to delete the
LP_NOfield. - Keyboard Shortcuts:
- Ctrl + Z: Undo the last manual action.
- Ctrl + Y: Redo.
- Alt + Click: Edit a specific label.
- Performance: For layers with 10,000+ parcels, Select a smaller area before auto-numbering. Processing the entire layer at once may take a few seconds.
β Troubleshootingβ
"Layer is not in edit mode"
- The tool now handles this! Just click "Yes" when prompted to start editing.
"My numbers are jumping across the street!"
- Try the Smart (Adjacency) algorithm. It is better at detecting "local neighbors" than the strict grid algorithm. Also verify that you have chosen the correct flow direction (Row-wise vs Column-wise) matching the road layout.
"I can't see the labels!"
- Click the Refresh button in QGIS or toggle visibility. Ensure the specified field exists (use the Attribute Table button to check).