Package org.osm2world.core.map_data.data

Examples of org.osm2world.core.map_data.data.MapArea


      for (MapOverlap<?,?> overlap : area.getOverlaps()) {
        MapElement other = overlap.getOther(area);
        if (other instanceof MapArea
            && other.getTags().containsKey("building:part")) {
         
          MapArea otherArea = (MapArea)other;
         
          //TODO: check whether the building contains the part (instead of just touching it)
          if (area.getPolygon().contains(
              otherArea.getPolygon().getOuter())) {
            parts.add(new BuildingPart(this, otherArea,
              otherArea.getPolygon(), useBuildingColors,
              drawBuildingWindows));
          }
         
        }
      }
View Full Code Here


    private boolean isContainedWithinRiverbank() {
      boolean containedWithinRiverbank = false;
     
      for (MapOverlap<?,?> overlap : segment.getOverlaps()) {
        if (overlap.getOther(segment) instanceof MapArea) {
          MapArea area = (MapArea)overlap.getOther(segment);
          if (area.getPrimaryRepresentation() instanceof Water &&
              area.getPolygon().contains(segment.getLineSegment())) {
            containedWithinRiverbank = true;
            break;
          }
        }
      }
View Full Code Here

    // first column
    for (int z = endZ - 2; z >= startZ /* start will be added again */; z--) {
      nodes.add(nodeGrid[startX][z]);
    }
   
    return new MapArea(EMPTY_SURFACE_WAY, nodes);
   
  }
View Full Code Here

        }
       
      }
    }
   
    return singleton(new MapArea(tagSource, outerNodes, holes));
   
  }
View Full Code Here

      for (Ring innerRing : innerRings) {
        holes.add(innerRing.closedNodeSequence);
        holesXZ.add(innerRing.getPolygon());
      }
     
      MapArea area = new MapArea(relation, outerRing.getNodeLoop(), holes,
          new PolygonWithHolesXZ(outerRing.getPolygon(), holesXZ));
     
      finishedPolygons.add(area);
     
      rings.remove(outerRing);
View Full Code Here

              nodes.add(nodeMap.get(boundaryOSMNode));
            }
           
            try {
             
              MapArea mapArea = new MapArea((OSMElement)way, nodes);
             
              mapAreas.add(mapArea);
              areaMap.put(way, mapArea);
             
            } catch (InvalidGeometryException e) {
View Full Code Here

   
    assertSame(13, mapData.getMapNodes().size());
    assertSame(0, mapData.getMapWaySegments().size());
    assertSame(1, mapData.getMapAreas().size());
   
    MapArea area = mapData.getMapAreas().iterator().next();

    assertSame(2, area.getHoles().size());
    assertSame(6, area.getOuterPolygon().size());
    assertSame(13, area.getAreaSegments().size());
   
  }
View Full Code Here

          return true;
        }
        return false;
       
      } else { // element instanceof MapArea
        MapArea area = ((MapArea)element);
               
        for (MapNode node : area.getBoundaryNodes()) {
          if (contains(node.getPos())) {
            return true;
          }
        }
       
        if (boundary.intersects(area.getPolygon().getOuter())
            || area.getPolygon().contains(boundary)) {
          //SUGGEST (performance): use that the box is axis-aligned?
          return true;
        }
       
        return false;
View Full Code Here

TOP

Related Classes of org.osm2world.core.map_data.data.MapArea

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.