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

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


    return extent;
  }

  public Extent getExtentCitySQL(City city, int idLicenca) throws Exception {
    Extent extent = new Extent();

    try {
      if (Functions.IsNullOrEmpty(city.getCountry()))
        city.setCountry("Brasil");

      try {
        Connection con = dataBase.getConnection(Functions.getDataBase(idLicenca, city.getCountry()).getSource());

        CallableStatement cst = con.prepareCall("{call CP_WS_TB_CIDADES_SELECT_FONETICO(?,?,?,?,?)}");
        cst.setString(1, city.getName());
        cst.setString(2, city.getState());
        cst.setInt(3, 1);
        cst.setInt(4, 2);
        cst.setInt(5, 0);

        cst.execute();

        ResultSet rs1 = cst.getResultSet();

        while (rs1.next()) {

          extent.setXMax(rs1.getDouble("xmax"));
          extent.setXMin(rs1.getDouble("xmin"));
          extent.setYMax(rs1.getDouble("ymax"));
          extent.setYMin(rs1.getDouble("ymin"));
          break;
        }
        rs1.close();

        cst.close();
View Full Code Here


         
          String XMaxYMax = response.substring(response.indexOf("LLMAX=") + 6); //.substring(0, response.substring(response.indexOf("LLMAX=") + 6).indexOf(Pattern.quote("|")));
          XMaxYMax = XMaxYMax.substring(0, XMaxYMax.indexOf("|"));
          String XMinYMin = response.substring(response.indexOf("LLMIN=") + 6); //.substring(0, response.substring(response.indexOf("LLMIN=") + 6).indexOf(Pattern.quote("%")));
          XMinYMin = XMinYMin.substring(0, XMinYMin.indexOf("%"));
          Extent miEx = new Extent();

          miEx.setXMax(Double.parseDouble(XMaxYMax.split(",")[1].replace(",", ".")));
          miEx.setXMin(Double.parseDouble(XMinYMin.split(",")[1].replace(",", ".")));
          miEx.setYMax(Double.parseDouble(XMaxYMax.split(",")[0].replace(",", ".")));
          miEx.setYMin(Double.parseDouble(XMinYMin.split(",")[0].replace(",", ".")));

          mi.setExtent(miEx);

        } else {
          throw (new Exception("Falha ao gerar mapa"));
View Full Code Here

  public MapInfo getZoom(String routeId, Extent extent, double percZoom, MapOptions mo, int idLicenca, int methodID) throws Exception {
    MapInfo mi = new MapInfo();

    try {
      /*** Gerar o zoom da imagem ***/
      Extent extTmp = Functions.doZoom(extent, percZoom);
      mi = renderMap(routeId, "", extTmp, mo, idLicenca, methodID);
    } catch (Exception ex) {
      // throw (ex);
      throw (new Exception("getZoom: Falha ao efetuar zoom da imagem."));
    }
View Full Code Here

  public MapInfo getZoomRadius(String routeId, Point point, int radius, MapOptions mo, int idLicenca, int methodID, String mapType) throws Exception {
    MapInfo mi = new MapInfo();

    try {
      // Envelope env = new EnvelopeClass();
      Extent ext = Functions.CalcRadius(radius, point);
      mi = renderMap(routeId, "", ext, mo, idLicenca, methodID, mapType);
    } catch (Exception ex) {

      Utils.LogError("CC","getZoomRadius - IdWebservice : 7", "point.x -> " + point.getX() + " | " + "point.y -> " + point.getY() + " | "
          + "raio -> " + radius + " | " + ex.getMessage() + "|" + ex.getStackTrace());
View Full Code Here

  public MapInfo getZoomRadius(String routeId, String routeResponse, Extent extent, MapOptions mo, int idLicenca, int methodID) throws Exception {
    MapInfo mi = new MapInfo();

    try {
      // Envelope env = new EnvelopeClass();
      Extent ext = extent;

      mi = renderMap(routeId, routeResponse, ext, mo, idLicenca, methodID);
    } catch (Exception ex) {

      Utils.LogError("CC","getZoomRadius - IdWebservice : 7", ex.getMessage() + "|" + ex.getStackTrace());
View Full Code Here

  public MapInfo getZoomWindow(String routeId, Extent oldExtent, Extent newExtentInPixels, MapOptions mo, int idLicenca, int methodID)
      throws Exception {
    MapInfo mi = new MapInfo();

    try {
      Extent newExtent = getNewExtent(oldExtent, newExtentInPixels, mo.getMapSize());
      mi = renderMap(routeId, "", newExtent, mo, idLicenca, methodID);

    } catch (Exception ex) {

      Utils.LogError("CC","getZoomWindow- IdWebservice : 8", ex.getMessage() + "|" + ex.getStackTrace());
View Full Code Here

    MapInfo mi = new MapInfo();

    try {
      Point point = new Point(-62.9569009522848, -21.3320991286825);

      Extent ext = Functions.CalcRadius(3800045, point);

      mi = renderMap(routeId, "", ext, mo, idLicenca, methodID);
    } catch (Exception ex) {
      Utils.LogError("CC","getZoomFullExtent- IdWebservice : 3", ex.getMessage() + "|" + ex.getStackTrace());
View Full Code Here

  public static Extent CalcRadius(Integer radius, Point point) {
    /*** Calcula o extent do raio ***/
    double raio = radius * 9.7125097125097125097125097125097e-6;

    // Envelope env = new EnvelopeClass();
    Extent ext = new Extent(point.getX() - raio, point.getY() - raio, point.getX() + raio, point.getY() + raio);

    return ext;
  }
View Full Code Here

      String fields = po.getFieldList();
      String orderBy = "";
     
      fields = fields.replace("|", ",");
     
      Extent ext = new Extent();
     
      double raio = radius * 9.7125097125097125097125097125097e-6;
     
      ext.setXMin(point.getX() - raio);
      ext.setXMax(point.getX() + raio);
      ext.setYMin(point.getY() + raio);
      ext.setYMax(point.getY() - raio);
     
      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");
     
      st = con.createStatement();
View Full Code Here

      routeOptions.getVehicle().setTollFeeCat(ro.getVehicle().getTollFeeCat());
      CommonRoute r = new CommonRoute(_maquina, _server, _port, _output, _dns, _dataSource, _dataSourceMapa);
      rpi = r.getRoute(idLicenca, rs, routeOptions, CommonRoute._getRoute);
     
      ri.setMapInfo(new MapInfo());
      ri.getMapInfo().setExtent(new Extent());
      ri.getMapInfo().getExtent().setXMax(rpi.getMapInfo().getExtent().getXMax());
      ri.getMapInfo().getExtent().setXMin(rpi.getMapInfo().getExtent().getXMin());
      ri.getMapInfo().getExtent().setYMax(rpi.getMapInfo().getExtent().getYMax());
      ri.getMapInfo().getExtent().setYMin(rpi.getMapInfo().getExtent().getYMin());
      ri.getMapInfo().setUrl(rpi.getMapInfo().getUrl());
View Full Code Here

TOP

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

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.