天天看點

gps糾偏示範示例

示範示例代碼:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

using System.Net;

using System.IO;

using System.IO.Compression;

using System.Text.RegularExpressions;

using System.Web.Script.Serialization;

namespace map

{

    class Program

    {

        static void Main(string[] args)

        {

            string key = "************************";

            string old_lnglat="116.44361,39.93554";

            string url = "http://api.haoservice.com/api/Convertlnglat?old_lnglat="+old_lnglat+"&key="+key;

            WebClient wc = new WebClient();

            wc.Encoding = Encoding.UTF8;

            string str = wc.DownloadString(url);

            Console.WriteLine(str);

            Console.ReadKey();

        }

    }

}

gps糾偏接口傳回示例

接口資訊

URL:http://api.haoservice.com/api/convertlnglat

支援格式:json

http請求方式:GET POST

DEMO:http://api.haoservice.com/api/Convertlnglat?old_lnglat=116.44361,39.93554&key=您申請的KEY

傳回結果:

{"error_code":0,

                    "reason":"成功",

                    "result":

                    {"Address":"直轄市北京市朝陽區幸福村中路東直門街道(東城區)三裡屯首開幸福廣場東北",

                    "province":"直轄市",

                    "city":"北京市",

                    "dist":"朝陽區",

                    "area":"幸福村中路",

                    "town":"東直門街道(東城區)",

                    "village":"三裡屯",

                    "poi":"首開幸福廣場",

                    "poitype":"小區",

                    "direction":"東北",

                    "distance":0.0,

                    "roadname":"三裡屯東三街",

                    "roadDirection":"北",

                    "roadDistance":0.0}

                    }

}

備注:

在網頁(http://www.haoservice.com/docs/15)申請key值,将key和所需查詢old_lnglat參數傳入運作即可

若出現錯誤可參照一下代碼表:

 傳回碼 說明

 0 成功

 10001 錯誤的請求KEY

 10002 該KEY無請求權限

 10003 KEY過期

 10004 錯誤的SDK KEY

 10005 應用未稽核逾時,請送出認證

 10007 未知的請求源,(伺服器沒有擷取到IP位址)

 10008 被禁止的IP

 10009 被禁止的KEY

 10011 目前IP請求超過限制

 10012 目前Key請求超過限制

 10013 測試KEY超過請求限制

 10020 接口維護

 10021 接口停用

 10022 appKey按需剩餘請求次數為零

 10023 請求IP無效

 10024 網絡錯誤

 10025 沒有查詢到結果