Package java.util.regex

Examples of java.util.regex.Pattern$Bound


    polygonFile = new File(getClass().getResource("testPolygon.txt").getFile());
    entityInspector = new SinkEntityInspector();
    // polyAreaFilter has a notch out of the Northeast corner.
    polyAreaFilter = new PolygonFilter(IdTrackerType.Dynamic, polygonFile, false, false, false, false);
    polyAreaFilter.setSink(entityInspector);
    intersectingBound = new Bound(30, 0, 30, 0, "intersecting");
    crossingIntersectingBound = new Bound(-10, 10, 30, -30, "crossing intersecting");
    nonIntersectingBound = new Bound(30, 15, 30, 15, "nonintersecting");
    inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 5, 10);
    outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 15, 15);
    edgeNode = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 15, 10);
  }
View Full Code Here


  /**
   * Test passing a Bound which intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer1() {
    Bound compareBound;
    polyAreaFilter.process(new BoundContainer(intersectingBound));
    polyAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), 0) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
    assertTrue(Double.compare(compareBound.getBottom(), 0) == 0);
    assertTrue(compareBound.getOrigin().equals("intersecting"));
  }
View Full Code Here

  /**
   * Test passing a Bound which crosses the antimeredian and intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer2() {
    Bound compareBound;
    polyAreaFilter.process(new BoundContainer(crossingIntersectingBound));
    polyAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), -20) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
    assertTrue(Double.compare(compareBound.getBottom(), -20) == 0);
    assertTrue(compareBound.getOrigin().equals("crossing intersecting"));
  }
View Full Code Here

  public final void testBoundElement1() {
    parseString(OSM_PREFIX
            + "<bound box=\"-12.34567,-23.45678,34.56789,45.67891\""
            + " origin=\"someorigin\"/>"
            + OSM_SUFFIX);
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(b.getRight(), 45.67891) == 0
            && Double.compare(b.getLeft(), -23.45678) == 0
            && Double.compare(b.getTop(), 34.56789) == 0
            && Double.compare(b.getBottom(), -12.34567) == 0);
    assertTrue(b.getOrigin().equals("someorigin"));
  }
View Full Code Here

  @Test
  public void testBoundsNoOrigin() {
    parseString(OSM_PREFIX
        + "<bounds minlat=\"-1.234\" minlon=\"-1.234\" maxlat=\"1.234\" maxlon=\"1.234\"/>"
        + OSM_SUFFIX);
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertEquals(-1.234, b.getLeft(), 1E-6);
    assertEquals(-1.234, b.getBottom(), 1E-6);
    assertEquals(1.234, b.getRight(), 1E-6);
    assertEquals(1.234, b.getTop(), 1E-6);
    assertNull(b.getOrigin());
  }
View Full Code Here

  public void testBoundsWithOrigin() {
    parseString(OSM_PREFIX
        + "<bounds minlat=\"-1\" minlon=\"-1\" maxlat=\"1\" maxlon=\"1\" "
        + " origin=\"someorigin\"/>"
        + OSM_SUFFIX);
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertEquals("someorigin", b.getOrigin());
  }
View Full Code Here

    if (unsupportedFeatures.size() > 0) {
      throw new OsmosisRuntimeException("PBF file contains unsupported features " + unsupportedFeatures);
    }

    // Build a new bound object which corresponds to the header.
    Bound bound;
    if (header.hasBbox()) {
      HeaderBBox bbox = header.getBbox();
      bound = new Bound(bbox.getRight() * COORDINATE_SCALING_FACTOR, bbox.getLeft() * COORDINATE_SCALING_FACTOR,
          bbox.getTop() * COORDINATE_SCALING_FACTOR, bbox.getBottom() * COORDINATE_SCALING_FACTOR,
          header.getSource());
    } else {
      bound = new Bound(header.getSource());
    }

    // Add the bound object to the results.
    decodedEntities.add(new BoundContainer(bound));
  }
View Full Code Here

  public void testBoundsOriginInheritance() {
    parseString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
          + "<osm version=\"0.6\" generator=\"somegenerator\">"
          + "<bounds minlat=\"-1.234\" minlon=\"-1.234\" maxlat=\"1.234\" maxlon=\"1.234\"/>"
          + "</osm>");
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertEquals("somegenerator", b.getOrigin());
  }
View Full Code Here

          boolean completeWays,
          boolean completeRelations,
          boolean cascadingRelations) {
    super(idTrackerType, clipIncompleteEntities, completeWays, completeRelations, cascadingRelations);
   
    this.bound = new Bound(right, left, top, bottom, "");
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void process(BoundContainer boundContainer) {
    Bound newBound;
    /*
     * The order of calling intersect is important because the first non-empty origin string
     * will be used for the resulting Bound, and we want the origin string from the pipeline
     * Bound to be used.
     */
 
View Full Code Here

TOP

Related Classes of java.util.regex.Pattern$Bound

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.