Skip to content

Unintentional gaps in bounding boxes / data loss #6

@christopherusky

Description

@christopherusky

Gap-Free Bounding Boxes & Increase Sample Size

Problem

The existing code uses corner offsets of width / (2 * sqrt(2)) at 45-degree angles, producing boxes with side length width / sqrt(2) (approximately 70% of intended size). Combined with spacing of width/2, this results in gaps between bounding boxes and sample size reduction.

How to Fix

Each box is a width x width square aligned with the road segment direction. For a segment with angle theta:

  • Along-road unit vector: (cos theta, sin theta)
  • Perpendicular unit vector: (-sin theta, cos theta)
  • Four corners: midpoint +/- (width/2) * along +/- (width/2) * perpendicular

Overlap

Add a fixed 25% overlap (no UI control). Spacing formula:

step = width * (1 - 0.25) = width * 0.75

With width = 10m: boxes are 10m wide, spaced 7.5m apart, giving 2.5m overlap between adjacent boxes. This maximises raster data coverage along road centre lines and gives more data for your efforts :)

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions