Package org.opensolaris.opengrok.analysis

Examples of org.opensolaris.opengrok.analysis.Definitions$Tag


        if (collection.isEmpty()) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        for (Iterator<Tag> it = collection.iterator(); it.hasNext();) {
            Tag e = it.next();
            String key = e.getKey();
            if (key == null || key.isEmpty()) {
                continue;
            }
            String value = e.getValue();
            sb.append(key).append(':').append(value);
            if (it.hasNext()) {
                sb.append('|');
            }
        }
View Full Code Here


        if (tagsString != null) {
            String[] tokens = tagsString.split("\\|");
            for (String token : tokens) {
                int idx = token.lastIndexOf(':');
                if (idx != -1) {
                    Tag tag = new Tag(token.substring(0, idx), token.substring(idx + 1));
                    tags.add(tag);
                } else {
                    LOGGER.info("found tag token '{}' with no value in tagString '{}'", token,
                            tagsString);
                }
View Full Code Here

        }

        Collection<Tag> newTags = Lists.newArrayList();
        Set<Entry<String, String>> entries = tagsMap.entrySet();
        for (Entry<String, String> entry : entries) {
            newTags.add(new Tag(entry.getKey(), entry.getValue()));
        }
        featureBuilder.set("tags", OSMUtils.buildTagsString(newTags));
        featureBuilder.set("location", feature.getDefaultGeometry());
        featureBuilder.set("changeset", changeset);
        featureBuilder.set("timestamp", timestamp);
View Full Code Here

        }

        tags.clear();
        Set<Entry<String, String>> entries = tagsMap.entrySet();
        for (Entry<String, String> entry : entries) {
            tags.add(new Tag(entry.getKey(), entry.getValue()));
        }

        Geometry geom = (Geometry) feature.getDefaultGeometry();
        LineString line;
        if (geom instanceof LineString) {
View Full Code Here

  public void buildFromNodeEntity() {
    // Setup
    Node node = mock(Node.class);
    when(node.getId()).thenReturn(1l);
    List<Tag> tags = new ArrayList<Tag>();
    tags.add(new Tag("highway", "primary"));
    when(node.getTags()).thenReturn(tags);
    when(node.getLatitude()).thenReturn(1.0);
    when(node.getLongitude()).thenReturn(2.0);

    ESNode expected = ESNode.Builder.create().id(1l).location(1.0, 2.0)
View Full Code Here

  public void buildFromWayEntity() {
    // Setup
    Way way = mock(Way.class);
    when(way.getId()).thenReturn(1l);
    List<Tag> tags = new ArrayList<Tag>();
    tags.add(new Tag("highway", "primary"));
    when(way.getTags()).thenReturn(tags);
    List<WayNode> wayNodes = new ArrayList<WayNode>();
    wayNodes.add(new WayNode(1l));
    wayNodes.add(new WayNode(2l));
    when(way.getWayNodes()).thenReturn(wayNodes);
View Full Code Here

  public void buildFromWayEntity_withIncorrectWayNodeSize() {
    // Setup
    Way way = mock(Way.class);
    when(way.getId()).thenReturn(1l);
    List<Tag> tags = new ArrayList<Tag>();
    tags.add(new Tag("highway", "primary"));
    when(way.getTags()).thenReturn(tags);
    List<WayNode> wayNodes = new ArrayList<WayNode>();
    wayNodes.add(new WayNode(1l));
    wayNodes.add(new WayNode(2l));
    when(way.getWayNodes()).thenReturn(wayNodes);
View Full Code Here

    Assert.assertEquals(expected.getLongitude(), actual.getLongitude());
    // Verify Tags
    Iterator<Tag> expectedTags = expected.getTags().iterator();
    Iterator<Tag> actualTags = actual.getTags().iterator();
    while (expectedTags.hasNext() && actualTags.hasNext()) {
      Tag expectedTag = expectedTags.next();
      Tag actualTag = actualTags.next();
      Assert.assertEquals(0, expectedTag.compareTo(actualTag));
    }
    Assert.assertFalse(expectedTags.hasNext() || actualTags.hasNext());
  }
View Full Code Here

    Assert.assertEquals(expected.getId(), actual.getId());
    // Verify Tags
    Iterator<Tag> expectedTags = expected.getTags().iterator();
    Iterator<Tag> actualTags = actual.getTags().iterator();
    while (expectedTags.hasNext() && actualTags.hasNext()) {
      Tag expectedTag = expectedTags.next();
      Tag actualTag = actualTags.next();
      Assert.assertEquals(0, expectedTag.compareTo(actualTag));
    }
    Assert.assertFalse(expectedTags.hasNext() || actualTags.hasNext());
    // Verify WayNodes
    Iterator<WayNode> expectedWayNodes = expected.getWayNodes().iterator();
View Full Code Here

import org.openstreetmap.osmosis.plugin.elasticsearch.model.entity.ESWay;

public class OsmDataBuilder {

  public static Node buildSampleNode(long id) {
    List<Tag> tags = Arrays.asList(new Tag[] { new Tag("highway", "traffic_signals") });
    CommonEntityData entityData = new CommonEntityData(id, 0, new Date(), new OsmUser(1, "nco"), 1l, tags);
    return new Node(entityData, 1.0d, 2.0d);
  }
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.analysis.Definitions$Tag

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.