A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

jbnu/spatial-information-db Private

[참조 MVP] 농경지 공간정보 DB — 농경지·장애물 GeoJSON 피처를 경계상자 기준으로 검색하는 경량 저장 모델입니다.

https://git.agrithing.ai/jbnu/spatial-information-db.git
6 commits
2 items · main
·/ src/component.ts
typescript · 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] } })) };}