Files
NODEDC_MISSION_CORE/simulation/urban-plan-research/replay/arrow_frames.py
T
DCCONSTRUCTIONS 69dc566665 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.
2026-10-29 09:10:00 +03:00

15 lines
542 B
Python

"""Transform complete catalog geometry and its probes through the same frame."""
import numpy as np
from shapely.ops import transform
def points_in_frame(points,matrix):
h=np.asarray(matrix,float);xy=np.asarray(points,float)
p=np.c_[xy[:,:2],np.ones(len(xy))]@h.T
if np.any(abs(p[:,2])<1e-8):raise ValueError('Singular glyph frame')
return p[:,:2]/p[:,2,None]
def geometry_in_frame(geometry,matrix):
def fn(x,y,z=None):
p=points_in_frame(np.c_[x,y],matrix);return p[:,0],p[:,1]
return transform(fn,geometry)