org.osm2world.core.map_data.data
Class MapData

Object
  extended by MapData

public class MapData
extends Object

OSM2World's abstraction of OSMData, consists of MapElements. Initially contains only a slightly altered representation of OSM map data. During later conversion steps, additional information is added to the MapElements.


Constructor Summary
MapData(List<MapNode> mapNodes, List<MapWaySegment> mapWaySegments, List<MapArea> mapAreas, AxisAlignedBoundingBoxXZ fileBoundary)
           
 
Method Summary
 AxisAlignedBoundingBoxXZ getBoundary()
          returns a boundary based on the bounds in the input file if available, otherwise returns the same as getDataBoundary()
 VectorXZ getCenter()
          calculates the center from the MapNodes' positions
 AxisAlignedBoundingBoxXZ getDataBoundary()
          returns a rectangular boundary polygon from the minimum/maximum of coordinates in the map data
 Collection<MapArea> getMapAreas()
           
 Iterable<MapElement> getMapElements()
           
 Collection<MapNode> getMapNodes()
           
 Collection<MapWaySegment> getMapWaySegments()
           
 Iterable<WorldObject> getWorldObjects()
          returns all WorldObjects from elements in this data set.
<T> Iterable<T>
getWorldObjects(Class<T> type)
          returns all WorldObjects from elements in this data set that are instances of a certain type.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapData

public MapData(List<MapNode> mapNodes,
               List<MapWaySegment> mapWaySegments,
               List<MapArea> mapAreas,
               AxisAlignedBoundingBoxXZ fileBoundary)
Method Detail

getMapElements

public Iterable<MapElement> getMapElements()

getMapAreas

public Collection<MapArea> getMapAreas()

getMapWaySegments

public Collection<MapWaySegment> getMapWaySegments()

getMapNodes

public Collection<MapNode> getMapNodes()

getDataBoundary

public AxisAlignedBoundingBoxXZ getDataBoundary()
returns a rectangular boundary polygon from the minimum/maximum of coordinates in the map data


getBoundary

public AxisAlignedBoundingBoxXZ getBoundary()
returns a boundary based on the bounds in the input file if available, otherwise returns the same as getDataBoundary()


getCenter

public VectorXZ getCenter()
calculates the center from the MapNodes' positions


getWorldObjects

public Iterable<WorldObject> getWorldObjects()
returns all WorldObjects from elements in this data set.


getWorldObjects

public <T> Iterable<T> getWorldObjects(Class<T> type)
returns all WorldObjects from elements in this data set that are instances of a certain type. Can be used, for example, to access all TerrainBoundaryWorldObjects in the grid.