feat(research): preserve urban geometry pipelines and qualification suites
Preserve offline geometry, marking, replay and evaluation pipelines with source manifests and synthetic tests. Research qualification does not activate these methods as production navigation.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Whole measured stroke ownership; retain positive paint during replacement."""
|
||||
import numpy as np
|
||||
import shapely
|
||||
from shapely.geometry import shape
|
||||
from marking_rules import plan_replacement,validate_removed,isolated_addition,POLICY
|
||||
|
||||
|
||||
def replacement(candidate,current,readers):
|
||||
p=candidate['polygons'][0]
|
||||
proposal={**candidate,'domain':p.buffer(POLICY['max_join_gap_m'])}
|
||||
plan=plan_replacement(proposal,current)
|
||||
if plan is None:return None,dict(reason='incompatible-ownership')
|
||||
ids,polygons=plan
|
||||
old=shapely.union_all([shapely.force_2d(shape(current[i]['geometry']))for i in ids])
|
||||
removed=old.difference(p.buffer(POLICY['retained_paint_tolerance_m']))
|
||||
if not removed.is_empty:
|
||||
axis=candidate['axis'];normal=np.array([-axis[1],axis[0]])
|
||||
transverse=(shapely.get_coordinates(removed)-candidate['origin'])@normal
|
||||
if np.max(abs(transverse))>.7:return None,dict(reason='removed-paint-outside-measurement')
|
||||
okay,evidence=validate_removed(old,p,candidate,readers)
|
||||
if not okay:return None,dict(reason='positive-or-unobserved-removed-paint',views=evidence)
|
||||
rest={i:f for i,f in current.items()if i not in ids}
|
||||
if not isolated_addition(p,rest):return None,dict(reason='unresolved-neighbor-seam')
|
||||
return ids,dict(reason='retained-or-two-view-dark',views=evidence)
|
||||
Reference in New Issue
Block a user