Package net.buffalo.protocal.io

Examples of net.buffalo.protocal.io.FastStreamReader$Tag


        }

        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

  public static Node buildSampleNode() {
    return buildSampleNode(1);
  }

  public static Way buildSampleWay(long id, long... nodeIds) {
    List<Tag> tags = Arrays.asList(new Tag[] { new Tag("highway", "residential") });
    CommonEntityData entityData = new CommonEntityData(id, 0, new Date(), new OsmUser(1, "nco"), 1l, tags);
    List<WayNode> wayNodes = new ArrayList<WayNode>();
    for (int i = 0; i < nodeIds.length; i++)
      wayNodes.add(new WayNode(nodeIds[i]));
    return new Way(entityData, wayNodes);
View Full Code Here

  public final void testProcessNormalWay() {
    Way way =
      new Way(new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0));
    way.getWayNodes().add(new WayNode(1235));
    way.getWayNodes().add(new WayNode(1236));
    way.getTags().add(new Tag("waykey", "wayvalue"));
   
    testWayWriter.process(way);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of net.buffalo.protocal.io.FastStreamReader$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.