org.osm2world.core.map_data.data
Class MapArea

Object
  extended by MapArea
All Implemented Interfaces:
MapElement

public class MapArea
extends Object
implements MapElement


Constructor Summary
MapArea(OSMElement objectWithTags, OSMWay osmWay)
           
MapArea(OSMWay osmWay)
           
 
Method Summary
 void addBoundaryNode(MapNode boundaryNode)
           
 void addOverlap(MapOverlap<?,?> overlap)
           
 void addRepresentation(AreaWorldObject representation)
          adds a visual representation for this area
 Collection<MapAreaSegment> getAreaSegments()
          returns the segments making up this area's outer and inner boundaries
 List<MapNode> getBoundaryNodes()
           
 AreaElevationProfile getElevationProfile()
          returns the elevation information for this GridElement.
 Collection<List<MapNode>> getHoles()
           
 int getLayer()
           
 OSMElement getOsmObject()
          returns the way or relation with the tags for this area
 OSMWay getOsmWay()
          returns the way that is the outer boundary of this object.
 SimplePolygonXZ getOuterPolygon()
           
 Collection<MapOverlap<?,?>> getOverlaps()
          returns all overlaps between this MapElement and other MapElements.
 PolygonWithHolesXZ getPolygon()
          returns the area's polygon.
 AreaWorldObject getPrimaryRepresentation()
          returns the primary representation, or null if the object doesn't have any.
 List<AreaWorldObject> getRepresentations()
          returns the visual representations of this element.
 TagGroup getTags()
          returns the tags of the underlying OSMElement
 void setElevationProfile(AreaElevationProfile elevationProfile)
           
 void setHoles(Collection<List<MapNode>> holes)
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapArea

public MapArea(OSMElement objectWithTags,
               OSMWay osmWay)

MapArea

public MapArea(OSMWay osmWay)
Method Detail

addBoundaryNode

public void addBoundaryNode(MapNode boundaryNode)

getBoundaryNodes

public List<MapNode> getBoundaryNodes()

getLayer

public int getLayer()
Specified by:
getLayer in interface MapElement

setHoles

public void setHoles(Collection<List<MapNode>> holes)

getHoles

public Collection<List<MapNode>> getHoles()

getOsmObject

public OSMElement getOsmObject()
returns the way or relation with the tags for this area


getOsmWay

public OSMWay getOsmWay()
returns the way that is the outer boundary of this object. Not necessarily the same as getOsmObject() (because of multipolygons)!


getTags

public TagGroup getTags()
Description copied from interface: MapElement
returns the tags of the underlying OSMElement

Specified by:
getTags in interface MapElement

getPolygon

public PolygonWithHolesXZ getPolygon()
returns the area's polygon. Must not be called before all boundary nodes have been added!


getOuterPolygon

public SimplePolygonXZ getOuterPolygon()

getAreaSegments

public Collection<MapAreaSegment> getAreaSegments()
returns the segments making up this area's outer and inner boundaries


getRepresentations

public List<AreaWorldObject> getRepresentations()
Description copied from interface: MapElement
returns the visual representations of this element. The order should match the order in which they were added, so that dependencies are preserved (elements that depend on another element should be placed after that element). The first element is considered the "primary" representation, and for some purposes - such as elevation calculation -, only this representation will be used.

Specified by:
getRepresentations in interface MapElement

getPrimaryRepresentation

public AreaWorldObject getPrimaryRepresentation()
Description copied from interface: MapElement
returns the primary representation, or null if the object doesn't have any.

Specified by:
getPrimaryRepresentation in interface MapElement
See Also:
MapElement.getRepresentations()

addRepresentation

public void addRepresentation(AreaWorldObject representation)
adds a visual representation for this area


getElevationProfile

public AreaElevationProfile getElevationProfile()
Description copied from interface: MapElement
returns the elevation information for this GridElement. Can be null if no elevations have been set yet or if the element was ignored during elevation calculation because it didn't have a representation.

Specified by:
getElevationProfile in interface MapElement

setElevationProfile

public void setElevationProfile(AreaElevationProfile elevationProfile)

addOverlap

public void addOverlap(MapOverlap<?,?> overlap)

getOverlaps

public Collection<MapOverlap<?,?>> getOverlaps()
Description copied from interface: MapElement
returns all overlaps between this MapElement and other MapElements.

Specified by:
getOverlaps in interface MapElement

toString

public String toString()
Overrides:
toString in class Object