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.1.0.tar.gz (110.3 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.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_proj-0.1.0.tar.gz
  • Upload date:
  • Size: 110.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 5c0cf251db9426ff91f1f6a61a89b2f1f2880cefca36f1b0fb303a2404861ad7
MD5 c51745f643658fb3b6c98dc473c07869
BLAKE2b-256 8d836ec6a0f9f8b03a7d53892ac2eb163ea88c8380bfe53177edec6cc52e84d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_proj-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 462ded5cda29e8255dc37887feadc40134670ce9c645d556588db94078997cb2
MD5 ebcd90aa16ad0595cab35d51aef4a955
BLAKE2b-256 75381abeb90221891917173ebf07cc1aac4d1f12f900318a09d28b398df84743

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