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

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


  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

        mapOptionsDependencyObjects[1] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[1].object = new Icon[0];
        mapOptionsDependencyObjects[1].alias = "icon";
       
        mapOptionsDependencyObjects[2] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[2].object = new Icon();
        mapOptionsDependencyObjects[2].alias = "Icon";
       
        mapOptionsDependencyObjects[3] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[3].object = new Point();
        mapOptionsDependencyObjects[3].alias = "point";
 
        MapOptions mo = (MapOptions) cr.getObjectFromXML(ph.XMLFile, "mo", MapOptions.class, mapOptionsDependencyObjects);
       
        String routeId = cr.getFieldFromXML(ph.XMLFile, "routeId");
        int radius = Integer.valueOf(cr.getFieldFromXML(ph.XMLFile, "radius"));
       
        try
        {
          mi = cMr.getZoomRadius(routeId, point, radius, mo, id_licenca, mapType);
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
       
        response.setContentType("text/xml");
        response.setCharacterEncoding("UTF-8");
       
        ObjectsHelper[] dependencyObjects = new ObjectsHelper[2];
       
        dependencyObjects[0] = cr.new ObjectsHelper();
        dependencyObjects[0].object = new Extent();
        dependencyObjects[0].alias = "extent";
       
        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new MapInfo();
        dependencyObjects[1].alias = "MapInfo";

        response.getWriter().write("<?xml version='1.0' encoding='UTF-8'?>\n" + cr.getXMLFromObject(mi, dependencyObjects) + "");
      }
      if (ph.fields[0].equals("getMap"))
      {
        MapInfo mi = new MapInfo();
       
        String mapType = cr.getFieldFromXML(ph.XMLFile, "maptype");
       
        if (!mapType.toLowerCase().equals("gif") && !mapType.toLowerCase().equals("png") && !mapType.toLowerCase().equals("jpg") ){
          mapType = "png";
        }
       
        Extent extent = (Extent) cr.getObjectFromXML(ph.XMLFile, "extent", Extent.class, null);
       
        ObjectsHelper[] mapOptionsDependencyObjects = new ObjectsHelper[4];
       
        mapOptionsDependencyObjects[0] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[0].object = new MapSize();
        mapOptionsDependencyObjects[0].alias = "mapSize";
       
        mapOptionsDependencyObjects[1] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[1].object = new Icon[0];
        mapOptionsDependencyObjects[1].alias = "icon";
       
        mapOptionsDependencyObjects[2] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[2].object = new Icon();
        mapOptionsDependencyObjects[2].alias = "Icon";
       
        mapOptionsDependencyObjects[3] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[3].object = new Point();
        mapOptionsDependencyObjects[3].alias = "point";
View Full Code Here

    line = new LinePoint[coords.split(";").length];

    // l� inversamente caso necess�rio
    if (!blnInverse) {
      for (i = 0; i < line.length; i++) {
        line[i] = new LinePoint();
        line[i].setPoint(new Point());
        line[i].getPoint().setX(Double.parseDouble(coords.split(";")[i].split(" ")[0].toString()));
        line[i].getPoint().setY(Double.parseDouble(coords.split(";")[i].split(" ")[1].toString()));
      }
    } else {
      for (i = line.length - 1; i > -1; i--) {
        line[z] = new LinePoint();
        line[z].setPoint(new Point());
        line[z].getPoint().setX(Double.parseDouble(coords.split(";")[i].split(" ")[0].toString()));
        line[z].getPoint().setY(Double.parseDouble(coords.split(";")[i].split(" ")[1].toString()));
        z++;
      }
View Full Code Here

      ri.setRouteId(routeID);

      // ri.setProximityList(getRouteProximity(response, ro.radius,
      // idLicenca, ro.routeDetails.getRouteType()));

      MapInfo mapInfo = new MapInfo();
      mapInfo.setUrl("");

      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("%"));

      mapInfo.setExtent(new Extent());
      mapInfo.getExtent().setXMax(Double.parseDouble(XMaxYMax.split(Pattern.quote(","))[1]));
      mapInfo.getExtent().setXMin(Double.parseDouble(XMinYMin.split(Pattern.quote(","))[1]));
      mapInfo.getExtent().setYMax(Double.parseDouble(XMaxYMax.split(Pattern.quote(","))[0]));
      mapInfo.getExtent().setYMin(Double.parseDouble(XMinYMin.split(Pattern.quote(","))[0]));

      ri.setMapInfo(mapInfo);
      ri.setSegDescription(getSegmentDescriptionAlternative(response, ro.getVehicle().getTollFeeCat(), ro, rs, _dataSource, idLicenca));
      ri.setRouteTotals(getTotals(ri.getSegDescription(), ro, rs, totalPedagios));
      ri.setRoadType(getRoadType(ri.getSegDescription()));
View Full Code Here

TOP

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

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.