Package com4j

Examples of com4j.SafeArray$Bound


   */
  public void setOrigin(OSMData osmData) {
   
    if (osmData.getBounds() != null && !osmData.getBounds().isEmpty()) {
     
      Bound firstBound = osmData.getBounds().iterator().next();
     
      setOrigin(new LatLon(
          (firstBound.getTop() + firstBound.getBottom()) / 2,
          (firstBound.getLeft() + firstBound.getRight()) / 2));
     
    } else {
     
      if (osmData.getNodes().isEmpty()) {
        throw new IllegalArgumentException(
View Full Code Here


   */
  @Test
  public final void testProcess1() {
    BoundWriter bw = new BoundWriter("bound", 2, true);
    bw.setWriter(testBufferedWriter);
    bw.process(new Bound(20.123456, -21.987654, 22.555555, -23.234567, "originstring"));
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
      fail("IOException");
View Full Code Here

   */
  @Test
  public final void testProcess2() {
    BoundWriter bw = new BoundWriter("bound", 2, true);
    bw.setWriter(testBufferedWriter);
    bw.process(new Bound(20.123456, -21.987654, 22.555555, -23.234567, ""));
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
      fail("IOException");
View Full Code Here

      initialize();
    }
   
    // Build the bounds list.
    bounds = new ArrayList<Bound>();
    bounds.add(new Bound("Osmosis " + OsmosisConstants.VERSION));
   
    sources = new ArrayList<ReleasableIterator<EntityContainer>>();
   
    sources.add(new UpcastIterator<EntityContainer, BoundContainer>(
        new BoundContainerIterator(new ReleasableAdaptorForIterator<Bound>(bounds.iterator()))));
View Full Code Here

      initialize();
    }
   
    // Build the bounds list.
    bounds = new ArrayList<Bound>();
    bounds.add(new Bound(right, left, top, bottom, "Osmosis " + OsmosisConstants.VERSION));
   
    // PostgreSQL sometimes incorrectly chooses to perform full table scans, these options
    // prevent this. Note that this is not recommended practice according to documentation
    // but fixing this would require modifying the table statistics gathering
    // configuration to produce better plans.
View Full Code Here

    }
    origin = reader.getAttributeValue(null, ATTRIBUTE_NAME_ORIGIN);
    if (origin == null || origin.equals("")) {
      throw new OsmosisRuntimeException("Origin attribute of bound element is empty or missing.");
    }
    Bound bound = new Bound(right, left, top, bottom, origin);
   
    reader.nextTag();
    reader.nextTag();
   
    return bound;
View Full Code Here

    }
   
    reader.nextTag();
    reader.nextTag();

    return new Bound(right, left, top, bottom, origin);
  }
View Full Code Here

  @Test
  public void computeBoundNoNodesWithBound() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundComputer bc = new BoundComputer("NewBound");
    bc.setSink(inspector);
    bc.process(new BoundContainer(new Bound("Test")));
    bc.complete();
    bc.release();

    Assert.assertNull(inspector.getLastEntityContainer());
  }
View Full Code Here

    bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
    bc.complete();
    bc.release();

    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
    Assert.assertEquals(new Bound(2, 1, 2, 1, "NewBound"), ec.getEntity());
  }
View Full Code Here

    bc.complete();
    bc.release();

    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
    EntityContainer ec = iterator.next();
    Assert.assertEquals(new Bound(2, 1, 2, 1, "NewBound"), ec.getEntity());

    // Ensure there is no second bound.
    ec = iterator.next();
    Assert.assertEquals(EntityType.Node, ec.getEntity().getType());
  }
View Full Code Here

TOP

Related Classes of com4j.SafeArray$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.