Skip to main content

MCP Server PROJ - 坐标系统转换服务器

Project description

MCP Server PROJ

基于 MCP 协议的坐标系统转换服务器,支持多种坐标系统格式之间的转换。

功能特点

  • 支持多种坐标系统格式:
    • EPSG 代码
    • WKT 格式
    • Proj 字符串格式
  • 批量坐标转换
  • 简单易用的 API
  • 支持作为服务器运行或库形式使用

安装

pip install mcp-server-proj

使用方法

作为服务器运行

mcp-server-proj

作为库使用

from mcp_server_proj import CoordinateTransformer

# 创建转换器实例
transformer = CoordinateTransformer()

# 设置源和目标坐标系
transformer.set_source_crs("EPSG:4326")  # WGS84
transformer.set_target_crs("EPSG:3857")  # Web墨卡托

# 初始化转换器
transformer.initialize_transformer()

# 转换坐标
x, y = transformer.transform_point(116.3, 39.9)
print(f"转换后的坐标: ({x}, {y})")

API 文档

CoordinateTransformer

主要的坐标转换类,提供以下方法:

  • set_source_crs(crs: str): 设置源坐标系
  • set_target_crs(crs: str): 设置目标坐标系
  • initialize_transformer(): 初始化转换器
  • transform_point(x: float, y: float) -> tuple[float, float]: 转换单个点的坐标

Server

MCP 协议服务器类,提供以下工具:

  • transform-coordinates: 坐标转换工具
  • list-supported-crs: 列出支持的坐标系统

依赖

  • Python >= 3.12
  • mcp >= 1.3.0
  • pyproj >= 3.0.0

许可证

MIT

作者

radial-hks (radialjiajie@gmail.com)

贡献

欢迎提交 Issue 和 Pull Request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_proj-0.2.0.tar.gz (111.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_proj-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_proj-0.2.0.tar.gz.

File metadata

  • Download URL: mcp_server_proj-0.2.0.tar.gz
  • Upload date:
  • Size: 111.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_server_proj-0.2.0.tar.gz
Algorithm Hash digest
SHA256 90f6a971612192525fbf290d43ba362ee44a28f0419c87c0b3ec53bc9988e46c
MD5 5144183973ce752125017f11ad968ccd
BLAKE2b-256 04341398530df253a31d6f8491beafe0a0dc5713cc09e35b80c371ca25a89956

See more details on using hashes here.

File details

Details for the file mcp_server_proj-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_proj-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5553279d0eb01f561a6c9310d0ceac766665415e06af4f7da2ac5c52372ee79e
MD5 f7f829cd18941d9c42af6fa853006dee
BLAKE2b-256 693d7eb7504b029f9b60eeb563d682e275a3f0425863314a1c3d820806f82f7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page