{
    "openapi": "3.0.0",
    "info": {
        "title": "坐标系转换 - API文档",
        "version": "1.0.0",
        "description": "支持最多20个WGS84坐标系（国际坐标）、GCJ02火星坐标系（中国坐标）、BD09百度坐标系的经纬度同时转换。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/geotrans\/index": {
            "get": {
                "summary": "坐标系转换",
                "tags": [
                    "坐标系转换"
                ],
                "description": "支持WGS坐标系、火星坐标系、百度坐标系转换",
                "parameters": [
                    {
                        "name": "to",
                        "in": "query",
                        "description": "目标坐标系，WGS84、GCJ02、BD09",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GCJ02",
                            "description": "目标坐标系，WGS84、GCJ02、BD09"
                        }
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "源坐标系，WGS84、GCJ02、BD09",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "WGS84",
                            "description": "源坐标系，WGS84、GCJ02、BD09"
                        }
                    },
                    {
                        "name": "location",
                        "in": "query",
                        "description": "坐标值，经纬度以逗号,分隔。多个经纬度以;分隔，最多支持20个",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "100.198351,36.262502",
                            "description": "坐标值，经纬度以逗号,分隔。多个经纬度以;分隔，最多支持20个"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "to": {
                                            "type": "string",
                                            "example": "GCJ02",
                                            "description": "目标坐标系"
                                        },
                                        "lat": {
                                            "type": "float",
                                            "example": "36.2623061667584",
                                            "description": "转换后纬度"
                                        },
                                        "lng": {
                                            "type": "float",
                                            "example": "100.19980703506313",
                                            "description": "转换后经度"
                                        },
                                        "from": {
                                            "type": "string",
                                            "example": "WGS84",
                                            "description": "源坐标系"
                                        },
                                        "location": {
                                            "type": "string",
                                            "example": "100.198351,36.262502",
                                            "description": "源坐标值"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "to": "GCJ02",
                                        "from": "WGS84",
                                        "list": [
                                            {
                                                "lat": 36.2623061667584,
                                                "lng": 100.19980703506312,
                                                "location": "100.198351,36.262502"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "坐标系转换",
                "tags": [
                    "坐标系转换"
                ],
                "description": "支持WGS坐标系、火星坐标系、百度坐标系转换",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "example": "GCJ02",
                                        "description": "目标坐标系，WGS84、GCJ02、BD09"
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "from": {
                                        "type": "string",
                                        "example": "WGS84",
                                        "description": "源坐标系，WGS84、GCJ02、BD09"
                                    },
                                    "location": {
                                        "type": "string",
                                        "example": "100.198351,36.262502",
                                        "description": "坐标值，经纬度以逗号,分隔。多个经纬度以;分隔，最多支持20个"
                                    }
                                },
                                "required": [
                                    "to",
                                    "key",
                                    "from",
                                    "location"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "to": {
                                            "type": "string",
                                            "example": "GCJ02",
                                            "description": "目标坐标系"
                                        },
                                        "lat": {
                                            "type": "float",
                                            "example": "36.2623061667584",
                                            "description": "转换后纬度"
                                        },
                                        "lng": {
                                            "type": "float",
                                            "example": "100.19980703506313",
                                            "description": "转换后经度"
                                        },
                                        "from": {
                                            "type": "string",
                                            "example": "WGS84",
                                            "description": "源坐标系"
                                        },
                                        "location": {
                                            "type": "string",
                                            "example": "100.198351,36.262502",
                                            "description": "源坐标值"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "to": "GCJ02",
                                        "from": "WGS84",
                                        "list": [
                                            {
                                                "lat": 36.2623061667584,
                                                "lng": 100.19980703506312,
                                                "location": "100.198351,36.262502"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}