Пример #1
0
    public BusStop(MapNode node) {
      super(node);

      if (node.getTags().contains("bin", "yes")) {
        node.addRepresentation(new WasteBasket(node));
      }
    }
Пример #2
0
  @Override
  protected void applyToNode(MapNode node) {

    TagGroup tags = node.getTags();
    if (!tags.containsKey("barrier") && !tags.containsKey("power"))
      return; // fast exit for common case

    if (Bollard.fits(tags)) {
      node.addRepresentation(new Bollard(node, tags));
    }
  }
Пример #3
0
  @Override
  protected void applyToNode(MapNode node) {

    if (!node.getTags().containsKey("traffic_sign")) return;

    if (isInHighway(node)) return; // only exact positions (next to highway)

    /* split the traffic sign value into its components */

    String tagValue = node.getTags().getValue("traffic_sign");
    String[] countryAndSigns = tagValue.split(":", 2);

    if (countryAndSigns.length != 2) return;

    String country = countryAndSigns[0];

    String[] signs = countryAndSigns[1].split("[;,]");

    /* match each individual sign to the list of supported types */

    List<TrafficSignType> types = new ArrayList<TrafficSignType>(signs.length);

    for (String sign : signs) {

      sign = sign.trim();
      sign = sign.replace('-', '_');

      try {
        types.add(TrafficSignType.valueOf(country + '_' + sign));
      } catch (IllegalArgumentException e) {
        // not a supported traffic sign type
      }
    }

    /* create a visual representation for the traffic sign */

    if (types.size() > 0) {
      node.addRepresentation(new TrafficSign(node, types));
    }
  }
  @Override
  protected void applyToNode(MapNode node) {
    if (node.getTags().containsKey("ele") && node.getRepresentations().isEmpty()) {

      boolean isInGroundSegment = false;
      for (MapSegment segment : node.getConnectedSegments()) {
        MapElement element;
        if (segment instanceof MapWaySegment) {
          element = (MapWaySegment) segment;
        } else {
          element = ((MapAreaSegment) segment).getArea();
        }
        if (element.getPrimaryRepresentation() != null
            && element.getPrimaryRepresentation().getGroundState() == GroundState.ON) {
          isInGroundSegment = true;
          break;
        }
      }

      if (node.getConnectedSegments().isEmpty() || isInGroundSegment) {
        node.addRepresentation(new InvisibleEleNode(node));
      }
    }
  }
Пример #5
0
 @Override
 protected void applyToNode(MapNode node) {
   if (node.getTags().contains("man_made", "flagpole")) {
     node.addRepresentation(new Flagpole(node));
   }
   if (node.getTags().contains("advertising", "column")) {
     node.addRepresentation(new AdvertisingColumn(node));
   }
   if (node.getTags().contains("advertising", "billboard")) {
     node.addRepresentation(new Billboard(node));
   }
   if (node.getTags().contains("amenity", "bench")) {
     node.addRepresentation(new Bench(node));
   }
   if (node.getTags().contains("highway", "bus_stop")) {
     node.addRepresentation(new BusStop(node));
   }
   if (node.getTags().contains("man_made", "cross")
       || node.getTags().contains("summit:cross", "yes")
       || node.getTags().contains("historic", "wayside_cross")) {
     node.addRepresentation(new Cross(node));
   }
   if (node.getTags().contains("amenity", "waste_basket")) {
     node.addRepresentation(new WasteBasket(node));
   }
   if (node.getTags().contains("amenity", "grit_bin")) {
     node.addRepresentation(new GritBin(node));
   }
   if (node.getTags().contains("amenity", "post_box")
       && (node.getTags().containsAnyKey(asList("operator", "brand")))) {
     node.addRepresentation(new PostBox(node));
   }
   if (node.getTags().contains("amenity", "telephone")
       && (node.getTags().containsAnyKey(asList("operator", "brand")))) {
     node.addRepresentation(new Phone(node));
   }
   if (node.getTags().contains("amenity", "vending_machine")
       && (node.getTags()
           .containsAny("vending", asList("parcel_pickup;parcel_mail_in", "parcel_mail_in")))) {
     node.addRepresentation(new ParcelMachine(node));
   }
   if (node.getTags().contains("amenity", "vending_machine")
       && (node.getTags()
           .containsAny("vending", asList("bicycle_tube", "cigarettes", "condoms")))) {
     node.addRepresentation(new VendingMachineVice(node));
   }
   if (node.getTags().contains("amenity", "recycling")
       && (node.getTags().contains("recycling_type", "container"))) {
     node.addRepresentation(new RecyclingContainer(node));
   }
   if (node.getTags().contains("emergency", "fire_hydrant")
       && node.getTags().contains("fire_hydrant:type", "pillar")) {
     node.addRepresentation(new FireHydrant(node));
   }
   if (node.getTags().contains("highway", "street_lamp")) {
     node.addRepresentation(new StreetLamp(node));
   }
   if (node.getTags().contains("tourism", "information")
       && node.getTags().contains("information", "board")) {
     node.addRepresentation(new Board(node));
   }
 }