REPOSITORY
jbnu/spatial-information-db Private
[참조 MVP] 농경지 공간정보 DB — 농경지·장애물 GeoJSON 피처를 경계상자 기준으로 검색하는 경량 저장 모델입니다.
https://git.agrithing.ai/jbnu/spatial-information-db.git 3bc873b feat: adopt typescript VPU SDV reference implementation
7cfcc9e ci: add language-specific static and dynamic analysis
2aec80b docs: define component scope and interface contract
29690c7 ci: verify contract tests and evidence package
68d8ce2 feat: add executable reference MVP
ff0d18b docs: define component scope and interface contract
2 items · main
·/ src/component.mjs
javascript · 565 B · 1b0e440 Download
export function queryFeatures(bbox, features) { const [xmin, ymin, xmax, ymax] = bbox.map(Number); if (xmin > xmax || ymin > ymax) throw new Error('invalid bbox'); const matches = features.filter((feature) => xmin <= Number(feature.x) && Number(feature.x) <= xmax && ymin <= Number(feature.y) && Number(feature.y) <= ymax); return { type: 'FeatureCollection', count: matches.length, features: matches.map((item) => ({ type: 'Feature', id: item.id, properties: { feature_type: item.type }, geometry: { type: 'Point', coordinates: [item.x, item.y] } })) };}