uk.me.parabola.mkgmap.general
Class MapLine
java.lang.Object
uk.me.parabola.mkgmap.general.MapElement
uk.me.parabola.mkgmap.general.MapLine
- Direct Known Subclasses:
- MapRoad, MapShape
public class MapLine
- extends MapElement
Represent a line on a Garmin map. Lines are a list of points. They have
a type (major highway, stream etc) and a name. And that is just about it.
- Author:
- Steve Ratcliffe
Methods inherited from class uk.me.parabola.mkgmap.general.MapElement |
getCity, getCountry, getExtTypeAttributes, getHouseNumber, getIsIn, getMaxResolution, getMinResolution, getName, getPhone, getRef, getRegion, getStreet, getType, getZip, hasExtendedType, isSimilar, setCity, setCountry, setExtTypeAttributes, setHouseNumber, setIsIn, setMaxResolution, setMinResolution, setName, setPhone, setRef, setRegion, setStreet, setType, setZip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MapLine
public MapLine()
MapLine
public MapLine(MapLine orig)
copy
public MapLine copy()
- Description copied from class:
MapElement
- Provide a copy of this MapElement without geometry. This is used
when filtering and clipping to create modified versions.
- Specified by:
copy
in class MapElement
- Returns:
- the copy;
getPoints
public java.util.List<Coord> getPoints()
setPoints
public void setPoints(java.util.List<Coord> points)
testForConsecutivePoints
public void testForConsecutivePoints(java.util.List<Coord> points)
insertPointsAtStart
public void insertPointsAtStart(java.util.List<Coord> additionalPoints)
insertPointsAtEnd
public void insertPointsAtEnd(java.util.List<Coord> additionalPoints)
isDirection
public boolean isDirection()
setDirection
public void setDirection(boolean direction)
isRoad
public boolean isRoad()
getLocation
public Coord getLocation()
- Get the mid-point of the bounding box for this element. This is as good
an indication of 'where the element is' as any. Previously we just
used the location of the first point which would lead to biases in
allocating elements to subdivisions.
- Specified by:
getLocation
in class MapElement
- Returns:
- The mid-point of the bounding box.
getBounds
public Area getBounds()
- Get the region that this element covers.
- Returns:
- The area that bounds this element.