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 CHANGED
@@ -1,4 +1,4 @@
1
- # geo-figure-mcp — 지리 시험용 지도·그래프 만들기 (0.2.2)
1
+ # geo-figure-mcp — 지리 시험용 지도·그래프 만들기 (0.2.3)
2
2
 
3
3
  만든 사람: 김한솔 (한백고등학교 지리 교사)
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-figure-mcp",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "지리 시험용 지도·그래프를 도형 하나하나 고칠 수 있는 PPTX·HWPX로 만드는 MCP 서버",
5
5
  "author": "김한솔 (한백고등학교)",
6
6
  "mcpName": "io.github.skyblue3925-svg/geo-figure-mcp",
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.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.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.level === 'sigungu') {
141
- const sidos = koreaFeatures('sido', detail, spec.edition);
142
- items.push(S.group('시·도 경계', sidos.flatMap((f) => rings(path, f.geo).map((r) => S.line([...r, r[0]], { stroke: 0.4, name: `${f.name} 경계` })))));
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);