geo-figure-mcp 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/maps.js +16 -4
package/README.md
CHANGED
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"title": "Geo Figure (지리 시험 지도·그래프)",
|
|
5
5
|
"description": "지리 시험용 지도·그래프를 실제 통계로, 도형 하나하나 고칠 수 있는 PPTX·HWPX로 만든다.",
|
|
6
6
|
"repository": { "url": "https://github.com/skyblue3925-svg/geo-figure-mcp", "source": "github" },
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.3",
|
|
8
8
|
"packages": [
|
|
9
9
|
{
|
|
10
10
|
"registryType": "npm",
|
|
11
11
|
"identifier": "geo-figure-mcp",
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.3",
|
|
13
13
|
"transport": { "type": "stdio" },
|
|
14
14
|
"environmentVariables": [
|
|
15
15
|
{ "name": "GEO_FIGURE_OUT", "description": "만든 파일을 저장할 폴더 (기본: 문서/지리시험자료)", "isRequired": false, "isSecret": false }
|
package/src/maps.js
CHANGED
|
@@ -136,10 +136,22 @@ export function makeMap(spec, st = DEFAULT_STYLE) {
|
|
|
136
136
|
areas.push(S.poly(rs, { fill, stroke: inFocus.has(f) ? 0.2 : 0.12, name: f.full }));
|
|
137
137
|
}
|
|
138
138
|
items.push(S.group(isKorea ? '행정 구역' : '국가', areas));
|
|
139
|
-
|
|
140
|
-
if (isKorea && spec.
|
|
141
|
-
const sidos = koreaFeatures('sido', detail, spec.edition);
|
|
142
|
-
|
|
139
|
+
const isSigungu = spec.level === 'sigungu';
|
|
140
|
+
if (isKorea && (isSigungu || spec.within?.length)) {
|
|
141
|
+
const sidos = isSigungu ? koreaFeatures('sido', detail, spec.edition) : feats;
|
|
142
|
+
const selected = new Set(spec.within);
|
|
143
|
+
const context = isSigungu ? sidos.filter((f) => !selected.has(f.name)).flatMap((f) =>
|
|
144
|
+
rings(path, f.geo).map((r) => S.line([...r, r[0]], { stroke: 0.4, name: `${f.name} 경계` }))) : [];
|
|
145
|
+
// 같은 시·도의 시·군·구를 합친 경계를 위에 그려 내부 경계와 구분한다.
|
|
146
|
+
const outlines = sidos.filter((f) => selected.has(f.name)).flatMap((f) => {
|
|
147
|
+
const style = { stroke: 0.7, name: `${f.name} 경계` };
|
|
148
|
+
if (!spec.bbox) return rings(path, f.geo).map((r) => S.poly([r], style));
|
|
149
|
+
// 잘린 면을 닫으면 지도 틀이 경계처럼 보일 수 있으므로 원래 경계선만 자른다.
|
|
150
|
+
const { type, coordinates } = f.geo.geometry;
|
|
151
|
+
const boundary = { type: 'MultiLineString', coordinates: type === 'Polygon' ? coordinates : coordinates.flat() };
|
|
152
|
+
return lines(path, boundary).filter((pts) => pts.some(([x, y]) => x !== pts[0][0] || y !== pts[0][1])).map((pts) => S.line(pts, style));
|
|
153
|
+
});
|
|
154
|
+
items.push(S.group('시·도 경계', [...context, ...outlines]));
|
|
143
155
|
}
|
|
144
156
|
for (const [n, lab] of Object.entries(spec.labels || {})) {
|
|
145
157
|
const f = find(n);
|