public XLSType createXlsRequestTest(string number, string street1, string street2, string city, string requestID) { XlsDocument xLSDocument = XlsDocument.CreateDocument(); XLSType xLSType = xLSDocument.XLS.Append(); xLSType.lang.Value = ServiceConfigProperties.Language; // should be added one only RequestUtil.addXlsHeader(ref xLSType); addGeocodeRequest(ref xLSType, number, street1, street2, city, requestID); return(xLSType); }
private XLSType createRouteServiceRequest(double VDStart, double KDStart, double VDEnd, double KDEnd) { XlsDocument xLSDocument = XlsDocument.CreateDocument(); XLSType xLSTypeRequest = xLSDocument.XLS.Append(); // should be added one only RequestUtil.addXlsHeader(ref xLSTypeRequest); RequestType requestType = xLSTypeRequest.Request.Append(); requestType.methodName.Value = "DetermineRouteRequest"; DetermineRouteRequestType determineRouteRequest = requestType.DetermineRouteRequest.Append(); RoutePlanType routePlanType = determineRouteRequest.RoutePlan.Append(); RoutePreferenceTypeType routePreferenceTypeType = routePlanType.RoutePreference.Append(); routePreferenceTypeType.Value = "Shortest"; WayPointListType wayPointListType = routePlanType.WayPointList.Append(); // start WayPointType wayPointTypeStartPoint = wayPointListType.StartPoint.Append(); PositionType positionTypeStartPoint = wayPointTypeStartPoint.Position.Append(); PointType pointTypeStartPoint = positionTypeStartPoint.Point.Append(); DirectPositionType directPositionTypeStartPoint = pointTypeStartPoint.pos.Append(); directPositionTypeStartPoint.Value = VDStart.ToString() + " " + KDStart.ToString(); // end WayPointType wayPointTypeEndPoint = wayPointListType.EndPoint.Append(); PositionType positionTypeEndPoint = wayPointTypeEndPoint.Position.Append(); PointType pointTypeEndPoint = positionTypeEndPoint.Point.Append(); DirectPositionType directPositionTypeEndPoint = pointTypeEndPoint.pos.Append(); directPositionTypeEndPoint.Value = VDEnd.ToString() + " " + KDEnd.ToString(); determineRouteRequest.RouteGeometryRequest.Append(); // add this if need the text instructions RouteInstructionsRequestType routeInstructionsRequestType = determineRouteRequest.RouteInstructionsRequest.Append(); routeInstructionsRequestType.format.Value = "text/plain"; return(xLSTypeRequest); }
/// <summary> /// /// </summary> /// <param name="DuLieu"></param> /// <returns></returns> public XLSType CreateRequest(List <PointF> DuLieu) { XlsDocument xLSDocument = XlsDocument.CreateDocument(); XLSType xLSType = xLSDocument.XLS.Append(); xLSType.lang.Value = ServiceConfigProperties.Language; if (DuLieu.Count == 0) { return(xLSType); } RequestUtil.addXlsHeader(ref xLSType); for (int i = 0; i < DuLieu.Count; i++) { string strPoint = DuLieu[i].X + " " + DuLieu[i].Y; string requestId = "request_" + i.ToString(); addReverseGeocodeRequest(ref xLSType, strPoint, requestId); } return(xLSType); }
public XLSType createXlsRequestTest(double x, double y) { XlsDocument xLSDocument = XlsDocument.CreateDocument(); XLSType xLSType = xLSDocument.XLS.Append(); xLSType.lang.Value = ServiceConfigProperties.Language; // should be added one only RequestUtil.addXlsHeader(ref xLSType); // can be added more than one //double x = 105.81783721316403; //double y = 21.028330217040492; //Random random = new Random(); //for (int i = 0; i < 100; i++) //{ // double x1 = x + random.NextDouble() / 100; // double y1 = y + random.NextDouble() / 100; //string strPoint = y1 + " " + x1; //string requestId = "request_" + i; addReverseGeocodeRequest(ref xLSType, y + " " + x, "request_0"); //} return(xLSType); }