/// <summary> /// 创建地理围栏 /// </summary> /// <param name="fenceInfo">地理围栏信息</param> /// <returns>创建结果</returns> public GaoDeErrResult <CreateFenceResult> CreateFence(GeoFenceInfo fenceInfo) { string url = GaoDeConst.WebAPIHost + "/v4/geofence/meta?key=" + GaoDeConfig.AppKey; GaoDeErrResult <CreateFenceResult> result = WebRequestHelper.PostHttp <GaoDeErrResult <CreateFenceResult> >(url, fenceInfo); return(result); }
/// <summary> /// 抓取道路驾驶轨迹信息 /// <para>根据坐标点抓取道路,即根据给定的坐标点、车辆的方位角以及行驶速度,将用户的轨迹纠偏到路上,从而返回用户实际驾车经过的道路坐标</para> /// </summary> /// <param name="driveRoads">抓取到的驾驶坐标信息数组</param> /// <returns>道路驾驶轨迹信息结果</returns> public GaoDeErrResult <DrivePointsResult> FetchDrivingInfo(DriveRoadInfo[] driveRoads) { string url = GaoDeConst.WebAPIHost + "/v4/grasproad/driving?key=" + GaoDeConfig.AppKey; GaoDeErrResult <DrivePointsResult> result = WebRequestHelper.PostHttp <GaoDeErrResult <DrivePointsResult> >(url, driveRoads); return(result); }
/// <summary> /// 删除地理围栏 /// </summary> /// <param name="gid">围栏全局id</param> /// <returns>删除结果</returns> public GaoDeErrResult <UpdateFenceResult> DeleteFence(string gid) { string url = GaoDeConst.WebAPIHost + "/v4/geofence/meta?key=" + GaoDeConfig.AppKey + "&gid=" + gid; string jsonResult = WebRequestHelper.DeleteHttp(url); GaoDeErrResult <UpdateFenceResult> updateResult = JsonConvert.DeserializeObject <GaoDeErrResult <UpdateFenceResult> >(jsonResult); return(updateResult); }
/// <summary> /// 围栏启动或停止地理围栏 /// </summary> /// <param name="gid">围栏全局id</param> /// <param name="isEnabled">是否启用,否则停止</param> /// <returns>启动或停止结果</returns> public GaoDeErrResult <UpdateFenceResult> EnableFence(string gid, bool isEnabled = true) { string url = GaoDeConst.WebAPIHost + "/v4/geofence/meta?key=" + GaoDeConfig.AppKey + "&gid=" + gid; string jsonResult = WebRequestHelper.PatchHttp(url, new { enable = isEnabled }); GaoDeErrResult <UpdateFenceResult> updateResult = JsonConvert.DeserializeObject <GaoDeErrResult <UpdateFenceResult> >(jsonResult); return(updateResult); }