Examples of Routing


Examples of es.emergya.bbdd.bean.Routing

                .latlon2eastNorth(new LatLon(x, y)), view
                .getScale());
          }
        } else if (centerOptions.getSelectedItem().equals(
            i18n.getString("map.street"))) {
          Routing r = RoutingConsultas.find(street.getText());
          if (r != null && r.getGeometria() != null) {
            Point center = r.getGeometria().getCentroid()
                .getCentroid();
            view
                .zoomTo(Main.proj.latlon2eastNorth(new LatLon(
                    center.getY(), center.getX())), view
                    .getScale());
          }

        } else if (centerOptions.getSelectedItem().equals(
            i18n.getString("map.incidence"))) {

          final Object incidencia = incidences.getSelectedItem();
          if (incidencia == null) {
            return null;
          }

          Incidencia i = null;
          if (incidencia instanceof Incidencia) {
            i = (Incidencia) incidencia;
          } else {
            i = IncidenciaConsultas.find(incidencia.toString());
          }

          Geometry geom = i.getGeometria();
          if (geom == null) {
            return null;
          }

          Point center = geom.getCentroid();
          view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(center
              .getY(), center.getX())), view.getScale());
          return null;

        } else if (centerOptions.getSelectedItem().equals(
            i18n.getString("map.resource"))) {
          final Object selectedItem = resources.getSelectedItem();
          if (selectedItem == null) {
            return null;
          }
          if (selectedItem instanceof Recurso) {
            Recurso r = (Recurso) selectedItem;
            HistoricoGPS h = null;
            if (r.getId() != null) {
              h = HistoricoGPSConsultas.lastGPSForRecurso(r);
            } else
              try {
                h = r.getHistoricoGps();
              } catch (Throwable t) {
                h = null;
              }
            if (h == null) {
              return null;
            }
            view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(h
                .getPosY(), h.getPosX())), view.getScale());
          } else if (selectedItem instanceof String) {
            String r = (String) selectedItem;
            HistoricoGPS h = HistoricoGPSConsultas
                .lastGPSForRecurso(r);
            if (h == null) {
              return null;
            }
            view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(h
                .getPosY(), h.getPosX())), view.getScale());
          } else if (selectedItem instanceof GpxLayer) {
            MyGpxLayer r = (MyGpxLayer) selectedItem;
            if (r == null || r.getLatLon() == null) {
              return null;
            }

            view.zoomTo(Main.proj.latlon2eastNorth(r.getLatLon()),
                view.getScale());
          }
        }
        return null;
      }
View Full Code Here

Examples of es.emergya.bbdd.bean.Routing

      this.name = texto;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      Routing r = RoutingConsultas.find(this.name);
      if (r != null && r.getGeometria() != null) {
        Point center = r.getGeometria().getCentroid().getCentroid();
        view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(
            center.getY(), center.getX())), view.getScale());
      }
    }
View Full Code Here

Examples of es.emergya.bbdd.bean.Routing

   * @param num
   * @return list of streets
   */
  @Transactional(readOnly = true, rollbackFor = Throwable.class)
  public Routing find(final String calle) {
    Routing res = null;
    try {
      res = (Routing) getSession().createCriteria(Routing.class).add(
          Restrictions.eq("name", calle)).add(
          Restrictions.isNotNull("geometria")).addOrder(
          Order.asc("id")).setMaxResults(1).uniqueResult();
View Full Code Here

Examples of io.crate.metadata.Routing

        return modules;
    }

    @Test
    public void testPartitionNameFromAssignmentWithBytesRef() throws Exception {
        TableInfo tableInfo = TestingTableInfo.builder(new TableIdent("doc", "users"), RowGranularity.DOC, new Routing(null))
                .add("name", DataTypes.STRING, null, true)
                .addPrimaryKey("name").build();

        PartitionName partitionName = PartitionPropertiesAnalyzer.toPartitionName(
                tableInfo,
View Full Code Here

Examples of io.crate.metadata.Routing

        countInfo = new FunctionInfo(new FunctionIdent(CountAggregation.NAME, ImmutableList.<DataType>of()), DataTypes.LONG);
    }

    @Test
    public void testGetOutputStreamersFromCollectNode() throws Exception {
        CollectNode collectNode = new CollectNode("bla", new Routing(new HashMap<String, Map<String, Set<Integer>>>()));
        collectNode.outputTypes(Arrays.<DataType>asList(DataTypes.BOOLEAN, DataTypes.FLOAT, DataTypes.OBJECT));
        PlanNodeStreamerVisitor.Context ctx = visitor.process(collectNode);
        Streamer<?>[] streamers = ctx.outputStreamers();
        assertThat(streamers.length, is(3));
        assertThat(streamers[0], instanceOf(DataTypes.BOOLEAN.streamer().getClass()));
View Full Code Here

Examples of io.crate.metadata.Routing

    }

    @Test
    public void testGetOutputStreamersFromCollectNodeWithWrongNull() throws Exception {
        // null means we expect an aggstate here
        CollectNode collectNode = new CollectNode("bla", new Routing(new HashMap<String, Map<String, Set<Integer>>>()));
        collectNode.outputTypes(Arrays.<DataType>asList(DataTypes.BOOLEAN, null, DataTypes.OBJECT));
        PlanNodeStreamerVisitor.Context ctx = visitor.process(collectNode);
        // assume an unknown column
        assertEquals(DataTypes.UNDEFINED.streamer(), ctx.outputStreamers()[1]);
    }
View Full Code Here

Examples of io.crate.metadata.Routing

        assertEquals(DataTypes.UNDEFINED.streamer(), ctx.outputStreamers()[1]);
    }

    @Test
    public void testGetOutputStreamersFromCollectNodeWithAggregations() throws Exception {
        CollectNode collectNode = new CollectNode("bla", new Routing(new HashMap<String, Map<String, Set<Integer>>>()));
        collectNode.outputTypes(Arrays.<DataType>asList(DataTypes.BOOLEAN, null, null, DataTypes.DOUBLE));
        AggregationProjection aggregationProjection = new AggregationProjection();
        aggregationProjection.aggregations(Arrays.asList( // not a real use case, only for test convenience, sorry
                new Aggregation(maxInfo, Arrays.<Symbol>asList(new InputColumn(0)), Aggregation.Step.ITER, Aggregation.Step.FINAL),
                new Aggregation(maxInfo, Arrays.<Symbol>asList(new InputColumn(1)), Aggregation.Step.ITER, Aggregation.Step.PARTIAL)
View Full Code Here

Examples of io.crate.metadata.Routing

        searchNode = mock(QueryThenFetchNode.class);
        Map<String, Map<String, Set<Integer>>> locations = new HashMap<>();
        HashMap<String, Set<Integer>> location1 = new HashMap<String, Set<Integer>>();
        location1.put("loc1", new HashSet<Integer>(Arrays.asList(1)));
        locations.put("node_1", location1);
        Routing routing = new Routing(locations);
        when(searchNode.routing()).thenReturn(routing);

        clusterService = mock(ClusterService.class);
        ClusterState state = mock(ClusterState.class);
        when(clusterService.state()).thenReturn(state);
View Full Code Here

Examples of io.crate.metadata.Routing

        }

        maxRowgranularity = RowGranularity.fromStream(in);

        if (in.readBoolean()) {
            routing = new Routing();
            routing.readFrom(in);
        }

        whereClause = new WhereClause(in);
View Full Code Here

Examples of io.crate.metadata.Routing

        this.concreteIndices = new String[]{ident.name()};
        Map<String, Map<String, Set<Integer>>> locations = new HashMap<>(1);
        Map<String, Set<Integer>> tableLocation = new HashMap<>(1);
        tableLocation.put(ident.fqn(), null);
        locations.put(null, tableLocation);
        this.routing = new Routing(locations);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.