org.osm2world.core.map_data.data
Class MapArea

Object
  extended by MapArea
All Implemented Interfaces:
MapElement, IntersectionTestObject

public class MapArea
extends Object
implements MapElement


Constructor Summary
MapArea(OSMElement objectWithTags, List<MapNode> nodes)
           
MapArea(OSMElement objectWithTags, List<MapNode> nodes, List<List<MapNode>> holes)
           
MapArea(OSMElement objectWithTags, List<MapNode> nodes, List<List<MapNode>> holes, PolygonWithHolesXZ polygon)
           
 
Method Summary
 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
 AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
           
 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
 SimplePolygonXZ getOuterPolygon()
           
 Collection<MapOverlap<?,?>> getOverlaps()
          returns all overlaps between this MapElement and other MapElements.
 PolygonWithHolesXZ getPolygon()
          returns the area as a 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
static SimplePolygonXZ polygonFromMapNodeLoop(List<MapNode> nodes)
           
 void setElevationProfile(AreaElevationProfile elevationProfile)
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapArea

public MapArea(OSMElement objectWithTags,
               List<MapNode> nodes)

MapArea

public MapArea(OSMElement objectWithTags,
               List<MapNode> nodes,
               List<List<MapNode>> holes)

MapArea

public MapArea(OSMElement objectWithTags,
               List<MapNode> nodes,
               List<List<MapNode>> holes,
               PolygonWithHolesXZ polygon)
Method Detail

polygonFromMapNodeLoop

public static final SimplePolygonXZ polygonFromMapNodeLoop(List<MapNode> nodes)

getBoundaryNodes

public List<MapNode> getBoundaryNodes()

getLayer

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

getHoles

public Collection<List<MapNode>> getHoles()

getOsmObject

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


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 as a polygon.


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

getAxisAlignedBoundingBoxXZ

public AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
Specified by:
getAxisAlignedBoundingBoxXZ in interface IntersectionTestObject

toString

public String toString()
Overrides:
toString in class Object