Package org.openstreetmap.osmosis.core.domain.v0_6

Examples of org.openstreetmap.osmosis.core.domain.v0_6.EntityType


     * @param type
     * @return String
     */
    public EntityList getDependencies(String type) {
        try {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            Collection<String> entityNames = configStore.getEntities(entityType);
            if (entityNames == null || entityNames.equals("")) {
                return new EntityList(new Entity[] {});
            }
            Entity[] entities = new Entity[entityNames.size()];
View Full Code Here


     * @param entityName
     * @return String
     */
    public String getEntityDefinition(String type, String entityName) {
        try {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            Entity entity = configStore.get(entityType, entityName);
            if (entity == null) {
                throw new NoSuchElementException(entityName + " (" + type + ") not found");
            }
            return entity.toString();
View Full Code Here

            throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);
        }
    }

    private void checkSchedulableEntity(String type) throws UnschedulableEntityException {
        EntityType entityType = EntityType.valueOf(type.toUpperCase());
        if (!entityType.isSchedulable()) {
            throw new UnschedulableEntityException("Entity type (" + type + ") " + " cannot be Scheduled/Suspended/Resumed");
        }
    }
View Full Code Here

    protected void checkType(String type) {
        if (StringUtils.isEmpty(type)) {
            throw IvoryWebException.newInstanceException("entity type is empty",
                    Response.Status.BAD_REQUEST);
        } else {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            if (entityType == EntityType.CLUSTER) {
                throw IvoryWebException.newInstanceException("Instance management functions don't apply to Cluster entities",
                        Response.Status.BAD_REQUEST);
            }
        }
View Full Code Here

    }
    return entity;       
  }

  public static <T extends Entity> T getEntity(String type, String entityName) throws IvoryException {
    EntityType entityType;
    try {
      entityType = EntityType.valueOf(type.toUpperCase());
    } catch (IllegalArgumentException e) {
      throw new IvoryException("Invalid entity type: " + type, e);
    }
View Full Code Here

   */
  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

TOP

Related Classes of org.openstreetmap.osmosis.core.domain.v0_6.EntityType

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.