Package com.lbslocal.cc.objects.v0.common

Examples of com.lbslocal.cc.objects.v0.common.LinePoint


        AddressLocation al = new AddressLocation();

       
       
        Double tolerance = Double.valueOf(cr.getFieldFromXML(ph.XMLFile, "tolerance"));
        Point point = (Point) cr.getObjectFromXML(ph.XMLFile, "point", Point.class, null);

        try {
          al = cAf.getAddress(point, tolerance, id_licenca);
        } catch (Exception e) {
          e.printStackTrace();
        }

        ObjectsHelper[] dependencyObjects = new ObjectsHelper[3];

        dependencyObjects[0] = cr.new ObjectsHelper();
        dependencyObjects[0].object = new Address();
        dependencyObjects[0].alias = "address";

        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new Point();
        dependencyObjects[1].alias = "point";

        dependencyObjects[2] = cr.new ObjectsHelper();
        dependencyObjects[2].object = new AddressLocation();
        dependencyObjects[2].alias = "AddressLocation";
View Full Code Here


    this.tollFee = "";
    this.tollFeeDetails = new TollFeeDetails();
    this.roadType = "";
    this.distance = 0;
    this.cumulativeDistance = 0;
    this.point = new Point();
    this.time = "";
  }
View Full Code Here

        RouteInfo ri = new RouteInfo();
       
        ObjectsHelper[] routeStopDependencyObjects = new ObjectsHelper[3];
       
        routeStopDependencyObjects[0] = cr.new ObjectsHelper();
        routeStopDependencyObjects[0].object = new Point();
        routeStopDependencyObjects[0].alias = "point";
       
        routeStopDependencyObjects[1] = cr.new ObjectsHelper();
        routeStopDependencyObjects[1].object = new RouteStop();
        routeStopDependencyObjects[1].alias = "RouteStop";
       
        routeStopDependencyObjects[2] = cr.new ObjectsHelper();
        routeStopDependencyObjects[2].object = new RouteStop[0];
        routeStopDependencyObjects[2].alias = "rs";
       
        ObjectsHelper[] routeOptionsDependencyObjects = new ObjectsHelper[7];
       
        routeOptionsDependencyObjects[0] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[0].object = new RouteDetails();
        routeOptionsDependencyObjects[0].alias = "routeDetails";
       
        routeOptionsDependencyObjects[1] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[1].object = new Vehicle();
        routeOptionsDependencyObjects[1].alias = "vehicle";
       
        routeOptionsDependencyObjects[2] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[2].object = new RouteLine[0];
        routeOptionsDependencyObjects[2].alias = "routeLine";
       
        routeOptionsDependencyObjects[3] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[3].object = new RouteLine();
        routeOptionsDependencyObjects[3].alias = "RouteLine";
       
        routeOptionsDependencyObjects[4] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[4].object = new Point[0];
        routeOptionsDependencyObjects[4].alias = "barrierPoints";
       
        routeOptionsDependencyObjects[5] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[5].object = new String[0];
        routeOptionsDependencyObjects[5].alias = "barriersList";
       
        routeOptionsDependencyObjects[6] = cr.new ObjectsHelper();
        routeOptionsDependencyObjects[6].object = new String[0];
        routeOptionsDependencyObjects[6].alias = "poiRoute";
       
        RouteStop[] rs = (RouteStop[]) cr.getObjectFromXML(ph.XMLFile, "rs", RouteStop.class, routeStopDependencyObjects);
        RouteOptions ro = (RouteOptions) cr.getObjectFromXML(ph.XMLFile, "ro", RouteOptions.class, routeOptionsDependencyObjects);
       
        try
        {
          ri = cRoute.getRoute(rs, ro, id_licenca);
          if (fullCoords.equals("true")){
            ri.setCoords(cRoute.getRouteFullCoords(ri.getRouteId()));
          }
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
       
        response.setContentType("text/xml");
        response.setCharacterEncoding("UTF-8");
       
        ObjectsHelper[] dependencyObjects = new ObjectsHelper[6];
       
        dependencyObjects[0] = cr.new ObjectsHelper();
        dependencyObjects[0].object = new MapInfo();
        dependencyObjects[0].alias = "MapInfo";
       
        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new SegmentDescription();
        dependencyObjects[1].alias = "SegmentDescription";
       
        dependencyObjects[2] = cr.new ObjectsHelper();
        dependencyObjects[2].object = new RouteTotals();
        dependencyObjects[2].alias = "routeTotals";
       
        dependencyObjects[3] = cr.new ObjectsHelper();
        dependencyObjects[3].object = new RouteSummary();
        dependencyObjects[3].alias = "routeSummary";
       
        dependencyObjects[4] = cr.new ObjectsHelper();
        dependencyObjects[4].object = new RoadType();
        dependencyObjects[4].alias = "roadType";
       
        dependencyObjects[5] = cr.new ObjectsHelper();
        dependencyObjects[5].object = new RouteInfo();
        dependencyObjects[5].alias = "RouteInfo";

       
        response.getWriter().write("<?xml version='1.0' encoding='UTF-8'?>\n" + cr.getXMLFromObject(ri, dependencyObjects) + "");
      }
      if (ph.fields[0].equals("setRouteFence"))
      {
        String routeId = cr.getFieldFromXML(ph.XMLFile, "routeId");
        double meters = Double.parseDouble(cr.getFieldFromXML(ph.XMLFile, "meters"));
        boolean generate = true;
        try
        {
          generate = cRoute.setRouteFence(routeId, meters, id_licenca);
        }
        catch (Exception e)
        {
          generate = false;
          e.printStackTrace();
        }
        response.getWriter().write("<?xml version='1.0' encoding='UTF-8'?>\n<setRouteFence><FenceGenerate>" + generate + "</FenceGenerate></setRouteFence>");
       
      }
      if (ph.fields[0].equals("checkFence"))
      {
        boolean dentro = false;
        String routeId = cr.getFieldFromXML(ph.XMLFile, "routeId");
        Point point = (Point) cr.getObjectFromXML(ph.XMLFile, "point", Point.class, null);
        try
        {
          dentro = cRoute.checkFence(routeId, point, id_licenca);
        }
        catch (Exception e)
View Full Code Here

      String fields = po.getFieldList();
      String orderBy = "";
     
      fields = fields.replace("|", ",");
     
      Point point = new Point();
     
      point.setX(ext.getXMin() + (ext.getXMax() - ext.getXMin()) / 2);
      point.setY(ext.getYMin() + (ext.getYMax() - ext.getYMin()) / 2);
     
      if (fields.split(Pattern.quote(",")).length > 0)
        orderBy = " , " + fields.split(Pattern.quote(","))[0];
     
      if (whereClause[0] != "")
        whereClause[0] = "and " + whereClause[0];
     
      strSelect = "select count(1) as total from dados_clientes." + tb[i] + " where x<>0 and ((x>=" + ext.getXMin() + " and x<=" + ext.getXMax() + ") and (y>=" + ext.getYMin() + " and y<="
          + ext.getYMax() + "))" + whereClause[0];
     
      Connection con = dataBase.getConnection("DADOS_WEBSERVICES");
     
      Statement st = con.createStatement();
      ResultSet rr = st.executeQuery(strSelect.toUpperCase());
     
      rr.next();
      int nrReg = rr.getInt("total");
     
      rr.close();
      st.close();
      con.close();
     
      if (po.getResultRange().getRecordsPerPage() > 50)
        po.getResultRange().setRecordsPerPage(50);
     
      if (po.getResultRange().getRecordsPerPage() < 1)
        po.getResultRange().setRecordsPerPage(5);
     
      Pagination pg = Functions.definePage(nrReg, po.getResultRange().getRecordsPerPage(), po.getResultRange().getPageIndex());
     
      strSelect = "select tabela, x, y, 102960 *  SQRT(POWER(x - " + point.getX() + ",2) + POWER(y - " + point.getY() + ",2)) as distancia, " + fields + " from dados_clientes." + tb[i]
          + " where x<>0 and ((x>=" + ext.getXMin() + " and x<=" + ext.getXMax() + ") and (y>=" + ext.getYMin() + " and y<=" + ext.getYMax() + "))" + whereClause[0] + " order by distancia "
          + orderBy + " LIMIT " + (pg.getRecordsInitial() - 1) + "," + (pg.getRecordsFinal());
     
      con = dataBase.getConnection("DADOS_WEBSERVICES");
     
View Full Code Here

  }

  public Point getRoadXY(Road road, int idLicenca) throws Exception {
    iniDate = System.currentTimeMillis();

    Point pt = new Point();

    try {
      pt = ca.getRoadXY(road, idLicenca);
      Functions.gravarLogUnique(idLicenca, CommonAddress._findPOI, 0, iniDate, 0);
    } catch (Exception e) {
View Full Code Here

  }

  public Point getXY(Address address, int idLicenca) throws Exception {
    iniDate = System.currentTimeMillis();

    Point point = new Point();

    try {
      point = ca.getXY(address, idLicenca);
      Functions.gravarLogUnique(idLicenca, CommonAddress._getXY, 0, iniDate, 0);
    } catch (Exception e) {
View Full Code Here

  }

  public Point getXY(String key, Address address, int idLicenca) throws Exception {
    iniDate = System.currentTimeMillis();

    Point point = new Point();

    try {
      point = ca.getXY(address, idLicenca);
      Functions.gravarLogUnique(idLicenca, CommonAddress._getXY, 0, iniDate, 0);
    } catch (Exception e) {
View Full Code Here

      if (((co[z + 1]).toString().replace("|", "").length() < (precision + 2))) {
        DecimalFormat df = new DecimalFormat(format.replace("0", "#"));
        df.setMinimumFractionDigits(precision);

        Point pt = new Point();
        pt.setY(Double.parseDouble(df.format(
            (Integer.parseInt(df.format(ptList.get(y).getY()).replace(",", "").replace(".", "")) + Integer.parseInt(co[z]))
                * Math.pow(10, -precision)).replace(",", ".")));
        pt.setX(Double.parseDouble(df.format(
            (Integer.parseInt(df.format(ptList.get(y).getX()).replace(",", "").replace(".", "")) + Integer.parseInt(co[z + 1]))
                * Math.pow(10, -precision)).replace(",", ".")));

        ptList.add(pt);

        y++;
      } else {
        DecimalFormat df = new DecimalFormat(format.replace("0", "#"));
        df.setMinimumFractionDigits(precision);

        Point pt = new Point();
        pt.setY(Double.parseDouble(df.format(Integer.parseInt(co[z]) * Math.pow(10, -precision)).replace(",", ".")));
        pt.setX(Double.parseDouble(df.format(Integer.parseInt(co[z + 1]) * Math.pow(10, -precision)).replace(",", ".")));

        ptList.add(pt);
      }

      z++;
View Full Code Here

    Value[0] = 0;
    Value[1] = 0;

    try {
      ShapeDetect shp = new ShapeDetect();

      for (int x = 0; x < rs.length; x++) {
        try {
          shp = Functions.getCity(rs[x].getPoint(), _server, _port, _dataSource);
View Full Code Here

  public static ShapeDetect getCity(Point ptClick, String server, Integer port, String dataSource) throws Exception {
    if (ptClick.getX() == 0 && ptClick.getY() == 0) {
      throw (new Exception("Coordenadas do ponto devem ser informadas."));
    }

    ShapeDetect shp = new ShapeDetect();

    try {
      TCPClientDecarta tcpDecarta = new TCPClientDecarta(server, port);
      String response = tcpDecarta.Send("S2LN|%LL=" + String.valueOf(ptClick.getY()).replace(",", ".") + ","
          + String.valueOf(ptClick.getX()).replace(",", ".") + "|%RAD=m15%INTERPADDR%ALLATTRS%LL%DS=" + dataSource + "||");
View Full Code Here

TOP

Related Classes of com.lbslocal.cc.objects.v0.common.LinePoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.